The 1st and biggest bug bear is trying to force the serial baud rate that the gpsd service uses.
I can setup the baud rate via the command line as follows and it just works: -
'gpsctlx' - this is just a different version of gpsctl than the one that's already installed and works 100% as expected - it sets the baud rate on the HAT to 115200 and saves it to the HAT's configuration - all works fine with the gpsd service at the command line doing it manually.
Code: Select all
sudo service gpsd stop sudo /bin/stty -F /dev/ttyAMA0 ispeed 115200 ospeed 115200 sudo /usr/bin/gpsctx --port /dev/serial0 -b 115200 -B 115200 sudo /usr/bin/gpsctx --port /dev/serial0 -b 115200 --nmea yes sudo /usr/bin/gpsctlx --port /dev/serial0 -b 115200 --save_config sudo service gpsd start
But, if this config is added to say rc.local after reboots, it seems that the gpsd service randomly chooses to default to trying to use a baud rate of 9600?
Is there any other, or more reliable way, of forcing the gpsd service to always be fixed to using only 115200 as the serial baud rate - can't see it as a gpsd service option, unless I'm looking in the wrong pkaces?