Changes between Version 26 and Version 27 of gps


Ignore:
Timestamp:
06/30/2025 11:44:00 PM (4 hours ago)
Author:
Tim Harvey
Comment:

added gpsd details about baudrate

Legend:

Unmodified
Added
Removed
Modified
  • gps

    v26 v27  
    408408root@focal-venice:~# apt-get install gpsd gpsd-clients
    409409}}}
    410   2. Configure gpsd via /etc/defaults/gpsd
     410  1. Configure gpsd via /etc/defaults/gpsd
    411411{{{
    412412root@focal-venice:~# cat /etc/default/gpsd
     
    427427root@focal-venice:~# cat /etc/default/gpsd
    428428root@focal-venice:~# sed -i 's;DEVICES="";DEVICES="/dev/ttymxc0";' /etc/default/gpsd
    429 }}}
    430    * replace the above with the proper GPS device for your system - see [#uart]
    431   3. Restart the gpsd service
     429root@focal-venice:~# sed -i 's;GPSD_OPTIONS="";GPSD_OPTIONS="-s 38400";' /etc/default/gpsd
     430}}}
     431   * replace the above with the proper GPS device and baudrate for the GPS on your board - see [#uart]
     432  1. Restart the gpsd service
    432433{{{#!bash
    433434root@focal-venice:~# systemctl restart gpsd.socket
    434435}}}
    435   4. Verify gpsd is listening:
     436  1. Verify gpsd is listening:
    436437{{{#!bash
    437438root@focal-venice:~# netstat -a | grep gpsd
     
    440441unix  2      [ ACC ]     STREAM     LISTENING     23508    /run/gpsd.sock
    441442}}}
    442   4. Verify gpsd is working using one of its client apps, for example cgps which is a simple terminal client:
     443  1. Verify gpsd is working using one of its client apps, for example cgps which is a simple terminal client:
    443444{{{#!bash
    444445root@focal-venice:~# cgps
     
    459460gpsd:INFO: startup at 2021-10-08T21:30:00.000Z (1633728600)
    460461}}}
     462 * gpsd will switch baudrates if it can't make sense of the data received however this can take several minutes for it to land on the proper baudrate depending upon how many times it has to change as the gpsd code will try the tty default baudrate first (which is usually 9600), then 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 in that order. If for example the GPS default baudrate is 38400 that will be the 5th fallback which takes minutes. To address this you can either:
     463  - add an 'stty -F /dev/ttymxc0 384000' (change for your GPS device and baudrate) to an ExecStartPre setting under the gpsd.service (ie 'sudo systemctl edit gpsd.service)
     464  - add a '-s 384000' option to GPSD_OPTIONS as shown in he example above
    461465
    462466