How do I read the data a GPS chip gives me?

64 Views Asked by At

I am working on a system involving a Raspberry Pi Pico reading the location of a GPS chip. I had some issues getting them communicating, but I have sorted them.

Now I have the data, I don't know how to interpret it into something that is useful for my application (Latitude and Longitude, and speed if it has it.) I have tried to do some research, but haven't really found anything definitive.

I am using a sr1612z1 GPS module with the provided antenna: https://www.aliexpress.com/item/1005004218023349.html

Here is the data I am receiving:

$GNGLL,,,,,235950.000,V,M*6F
$GNGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5,1*01
$GNGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5,4*04
$GNGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5,2*02
$GPGSV,3,1,10,05,25,120,27,10,17,279,21,13,34,130,24,15,66,111,20,0*6C
$GPGSV,3,2,1...

I used the micropython .split command on the list to split it at ',':

buff = str(gpsModule.read())
parts = buff.split(',')
print(parts)

The resulting array is:

["b'$GNGLL", '', '', '', '', '235950.000', 'V', 'M*6F\\r\\n$GNGSA', 'A', '1', '', '', '', '', '', '', '', '', '', '', '', '', '25.5', '25.5', '25.5', '1*01\\r\\n$GNGSA', 'A', '1', '', '', '', '', '', '', '', '', '', '', '', '', '25.5', '25.5', '25.5', '4*04\\r\\n$GNGSA', 'A', '1', '', '', '', '', '', '', '', '', '', '', '', '', '25.5', '25.5', '25.5', '2*02\\r\\n$GPGSV', '3', '1', '10', '05', '25', '120', '27', '10', '17', '279', '21', '13', '34', '130', '24', '15', '66', '111', '20', '0*6C\\r\\n$GPGSV', '3', '2', "1'"]

I have tried googling how to interpret it and I think it is NMEA, but it seems to have too many sections in the list for it to fit any of the examples I found. I have a feeling however that the first $GPGSV is what I am after.

0

There are 0 best solutions below