Posts: 1
Joined: Wed Feb 05, 2020 3:33 pm

Saving GPS data to a csv

Wed Feb 05, 2020 4:07 pm

Hi, I have bought a Dragino Lora/GPS Hat and I get a GPS 3D-Fix, when I go outside, but now I need to save this very data into a csv file.

I have written already a Python script based on this link:
https://ozzmaker.com/how-to-save-gps-da ... ng-python/

Unfortunately, my version does not work and it does not find any class 'TPV' or any devices at all! I mean regardless, whether I am inside my room and do not have a 3D-Fix GPS or outside with the 3D-Fix, it should recognize my device not?. Any one have a clue, how to modify it to solve it?

This helped me to get the GPS working and the 3D-Fix:
https://wiki.dragino.com/index.php?titl ... _3_Model_B

Thank you for your attention and help!

In this link, you will find my code:
https://www.bilder-upload.eu/bild-6451c ... 9.jpg.html

User avatar
Posts: 2493
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Saving GPS data to a csv

Fri Feb 07, 2020 6:51 pm

You look to have an extra os call that might be confusing things. When I've got GPS fixes I've just read nmea from the serial. But prob not feasible with hat. In your case, if you can't get the GPS python library to work then you could call the command line you know works and capture the output. I would use subprocess Popen with pipe. You should be able to find many examples on line.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”