$ sudo apt-get update
$ sudo apt-get install gpsd gpsd-client python-gps
Enable the serial interface and disable serial login shell with raspi-config
then reboot.
Confirm /dev/ttyS0 exists
$ ls -l /dev/serial*
lrwxrwxrwx 1 root root 5 May 9 10:38 /dev/serial0 -> ttyS0
lrwxrwxrwx 1 root root 7 May 9 10:38 /dev/serial1 -> ttyAMA0
Configure gpsd to use /dev/ttyS0 in /etc/defaults/gpsd then restart gpsd service.
Use cgps
command to make sure it works.
Thank you for this. Is there a way to get the speed in km/h instead of m/s?? I've tried taking "gpsd.fix.speed" value and then converting that into km/h. But unfortunately that wasn't fruitful, I tried something like this
speed = gpsd.fix.speed
km_h = ((speed*18)/5)