$ 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.
I have this issue in RaspberryPi (Raspbian):
I did => sudo apt-get install python-gps and executed gpsdData.py script
I am getting the following error. Can someone please help?
Traceback (most recent call last):
File "/home/pi/Desktop/pythonGPSData.py", line 29, in
gpsp = GpsPoller() # create the thread
File "/home/pi/Desktop/pythonGPSData.py", line 19, in init
gpsd = gps(mode=WATCH_ENABLE) #starting the stream of info
NameError: global name 'gps' is not defined