Yes sorry missed that part:
from subprocess import Popen, PIPE
Ugh I was just trying to get this to work myself. What is annoying is there IS a write function that allows a no address write, but no corresponding read! Not sure why this was part of the kickstarter if its not easy to control, at least via python.
Very cool- pretty similar to what I did. I added an animation while it was getting the fix. Just starts marching across the screen. I'll have to upload my script at some point.
FYI, you don't need to save a file with the data. You can call ubus directly:
gpsDataProcess = Popen(["ubus", "call", "gps", "info"], stdout=PIPE) gpsDataJSON = gpsDataProcess.communicate() gpsDataProcess.stdout.close() if ( gpsDataProcess.returncode == 0 ): # gps available gpsData = json.loads(gpsDataJSON)