I seek local time details from an external GPS device. NMEA's ZDA sentence furnishes this information. See here for details.
I wish to gain an understanding of how the different sentence types are generated and can be queried. As a starter, I have attempted the following...
In the following code, replacing "$GPGGA" with "$GPZDA" yields no result.
Would greatly appreciate assistance with addressing the concern.Code:import socket address, services = socket.bt_discover() print "Discovered: %s, %s" % (address, services) target = (address, services.values()[0]) conn = socket.socket(socket.AF_BT, socket.SOCK_STREAM) conn.connect(target) to_gps = conn.makefile("r", 0) while True: msg = to_gps.readline() if msg.startswith("$GPGGA"): gps_data = msg.split(",") lat = gps_data[2] lon = gps_data[4] break to_gps.close() conn.close() print "You are now at latitude %s and longitude %s" % (lat, lon)
Best,
wirefree

Reply With Quote

