gpsd-users
[Top][All Lists]
Advanced

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

Re: powering on gps device


From: Gary E. Miller
Subject: Re: powering on gps device
Date: Wed, 23 Jun 2021 09:54:22 -0700

Yo Nachiket!

On Wed, 23 Jun 2021 14:28:46 +0530
Nachiket Gokhale <gokhalen@gmail.com> wrote:

> I think I was able to get gpsd to open the serial port /dev/ttyS0 and
> read from it. I think the problem was that there were other gpsds
> listening. However, gpsmon still cannot open /dev/ttyS0. And gpsd
> cannot open /dev/ttyS0 after "gpsmon /dev/ttyS0" is used. However, if
> gpsmon is not used before gpsd, gpsd seems to access /dev/ttyS0.

Use this to see who else has a port open: lsof /dev/ttyS0

An easy way to help us help you debug is to download, and run, gpsdebuginfo:

https://gpsd.io/gpsdebuginfo

Then show us the results.

> >   So we need to know what model of receiver you have to help.  
> 
> I believe it is a SIMCom SIM808

My condolences.  It has minimal doc on the GPS funcions.

> >  Good.  Are you installing a package, from a tar ball, or from git?
> >  
> 
> I'm installing on a Raspberry Pi using apt. So it must be the
> Ubuntu/Debian package.

Then it is not from us.  We do not create packages.

> >  And you forgot to run as root?  
> 
> No, I'm running everything as root.

Odd.

> My problem now is that gpsd does not seem to read the NMEA (GPGGA)
> sentences sent by the GPS unit to /dev/ttyS0.  When gpsd is not
> running I can cat /dev/ttyS0 and see the GPGGA sentences. If I
> terminate gpsd using ctrl+C the sentences stop coming to /dev/ttyS0

I don't understand...  You say they stop coming to gpsd, so they were
coming to gpsd?

> The following is the output of my GPSD
> 
> gpsd -N -D3  /dev/ttyS0

You forgot to use -n.  Witht -n, gpsd ony connects to the recevier
when it has a client connection.

> gpsd:INFO: launching (Version 3.17)

Very old.  Older than your SIMCOM.  Can you try something newer?

> gpsd:INFO: listening on port gpsd
> gpsd:INFO: stashing device /dev/ttyS0 at slot 0
> gpsd:INFO: running with effective group ID 20
> gpsd:INFO: running with effective user ID 115
> gpsd:INFO: startup at 2021-06-23T06:59:03.000Z (1624431543)
> gpsd:CLIENT: => client(0):
> {"class":"VERSION","release":"3.17","rev":"3.17","proto_major":3,"proto_minor":12}\x0d\x0a
> gpsd:CLIENT: <= client(0): ?WATCH={"enable":true,"json":true}\x0a

You said nothing of running a gpsd client??

> {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyS0","activated":"2021-06-23T06:59:15.245Z","native":0,"bps":115200,"parity":"N","stopbits":1,"cycle":1.00}]}\x0d\x0a{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}\x0d\x0a

Did it stop there?  It was just getting interesting.

> I don't understand why it runs with an effective group ID of 20 and
> effective user ID of 115. Shouldn't these IDs be 0 for processes
> started by root? I am launching gpsd as root.

No.  gpsd starts as root, then drops priviledges for better security.
gpsd only needs root to start, so safer to drop root after it is needed.

> Also, as you can see, clients seem to connect to it.

Actually, I do not see that.

> However, the
> client only receives the following data.

What client??

> There is no GPGGA data
> forwarded to the client.

Not least because the client did not ask for NMEA.

> {'class': 'VERSION', 'release': '3.17', 'rev': '3.17', 'proto_major':
> 3, 'proto_minor': 12}
> ----------------------------------------
> {'class': 'DEVICES', 'devices': [{'class': 'DEVICE', 'path':
> '/dev/ttyS0', 'activated': '2021-06-23T07:15:34.175Z', 'native': 0,
> 'bps': 115200, 'parity': 'N', 'stopbits': 1, 'cycle': 1.0}]}
> ----------------------------------------
> {'class': 'WATCH', 'enable': True, 'json': True, 'nmea': False,
> 'raw': 0, 'scaled': False, 'timing': False, 'split24': False, 'pps':
> False}

notice the "nmea": False?  NMEA was not requested.

> CGPS shows only the following output
> 
> {"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"
> 115200,"parity":"N","stopbits":1,"cycle":1.00}]}
> {"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"
> timing":false,"split24":false,"pps":false}

I assume you mean cgps?  How long did you wait?  It can take a GPS
over 13 munutes to wake from a cold boot.

> Any help would be much appreciated. It almost seems that the receiver
> stops sending the GPGGA data once gpsd is connected to /dev/ttyS0.

Did you try to rerun your AT commands after gpsd is running?

The SIMCOM chips are a PITA.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  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: pgpcgyT4CsSBW.pgp
Description: OpenPGP digital signature


reply via email to

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