Fri, 23 Sep 2022

6:48 PM - GPS on Ubuntu

Purchased a USB gps device to play around with on Ubuntu 22.04.  Device is https://smile.amazon.com/dp/B00NWEEWW8?ref=ppx_yo2ov_dt_b_product_details&th=1

The device is recognized as /dev/ttyACM0.  You can cat it to see it's working. 

Setup for ntpd

sudo apt-get update
sudo apt-get install gpsd gpsd-clients  ntp 

sudo vi /etc/defaults/gpsd
DEVICES="/dev/ttyACM0"
GPSD_OPTIONS="-n"

n flag is required for NTP to work. 

sudo vi /etc/ntp.conf

gps

server 127.127.28.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.0 time1 0.000 refid GPS stratum 15

Test lock with:
cgps -s

ntpq -p
...and you'll see a line in the resulting text that looks something like this:
*SHM(0) .GPS. 15 l 14 16 377 0.000 3.505 3.556
If "poll" and "reach" are zero it's not working.

0 comments