[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening port for remote access to gpsd

From: Gary E. Miller
Subject: Re: Opening port for remote access to gpsd
Date: Wed, 22 Jul 2020 12:58:06 -0700

Yo S. Joshua!

On Wed, 22 Jul 2020 15:31:37 +0000
"Stein, S. Joshua" <> wrote:

> I have an application wherein a GPS unit is attached to a Raspian
> machine. I have gpsd running and receiving info from the GPS on
> /dev/ttyUSB0. Connection to the daemon works fine on localhost.

A common configuration.  But what distro?  distro version? gpsd version?

> I would like to connect to that same daemon from a remote machine
> using the HOST kwarg when instantiating the gps object. As it stands
> now, this will fail since the daemon is set up to only listen to
> localhost.

A common default, but this is your distro defaults, not gpsd defaults.

> So I change the arguments which fire off gpsd and add the ‘-G’ flag.

Uh?  Change what?  Where?

What is your entire set of options?

> Upon reboot, I see that gpsd has been invoked properly:
> ● gpsd.service - GPS (Global Positioning System) Daemon

If you call using gpsd under systemd(umb) "proper".  I do not.

Did you use "-n"?  Do you know gpsd is really running?  Run these two,
as root, and report back:

    # pstree -paul | fgrep gpsd
    # netstat -apn | fgrep 2947

> However when I attempt to connect remotely, I am prevented from doing
> so (ConnectionRefusedError).

Before connecting from client, you need to know the daemon is running
"properly" on the host.

> If I kill the daemon process (gpsd.socket and gpsd.service) and then
> invoke gpsd from the command line with:
> >gpsd -G \dev\ttyUSB0  

You forgot -n

> I am able to connect remotely just fine. So it appears the issue is
> with how systemd (systemctl) is firing off the daemon

Yup.  And the systemd files you are using are NOT part of gpsd, so we
have no idea what your unnamed distro did wrong.

> I then tried changing the SocketMode parameter within the gpsd.socket
> file from:

Nor would I expect it to.  You are tying to use TCP to connect remotely,
not a socket.  Sockets are local only.

> I realize this issue is likely one of my incomplete understanding of
> the systemd/systemctl process for handling sockets

Thinking of this as a socket problem is one of your mistakes.

> but my hope in
> posting here is that someone else has encountered this issue and can
> point me to the “AHA!” moment.

I don't use sysytemd(unmber) with gpsd and recommend against it.  It
causes much grief, as a search of the list archives will show you.

We can't debug what we cant see, so provide us your gpsd.service
and config file.

Before you send that, have you read the doc on this?

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpBPsCvCpSit.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]