GPS GP-20U7 connect to raspberry pi 3
import gps
gpsobj = gps.gps('127.0.0.1', 2947) ;
gpsobj.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)
try:
for rpt in gpsobj:
try:
print rpt
except StopIteration:
# Attempt to restart
gpsobj = gps.gps()
gpsobj.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)
except:
gpsobj.stream(gps.WATCH_DISABLE)
print ("\nTerminated GPS Example 1")