sixfab / Sixfab_RPi_3G-4G-LTE_Base_HAT

MIT License
10 stars 11 forks source link

IndexError: list index out of range #5

Open jsonpoindexter opened 2 years ago

jsonpoindexter commented 2 years ago

I am currently experiencing IndexError: list index out of range in GPS.py for Quectel Module: Quectel EG25-G.

Connecting Port..
Receiving GPS data

$GPGSA,A,2,08,10,18,23,24,27,32,,,,,,1.2,0.9,0.8*32
$GPGSV,2,1,08,08,33,295,20,10,68,004,28,18,27,120,24,21,09,309,18*77
$GPGSV,2,2,08,23,42,057,29,24,19,066,32,27,47,255,29,32,55,194,25*75
$GPGGA,180205.00,*removed*,N,*removed*,W,1,06,1.1,1426.6,M,-7.0,M,,*51
$GPVTG,163.5,T,148.1,M,0.0,N,0.0,K,A*2E
$GPRMC,180205.00,A,*removed*,N,*removed*,W,0.0,163.5,141021,15.5,E,A*14
-----Parsing GPRMC-----
Traceback (most recent call last):
  File "GPS.py", line 66, in <module>
    parseGPS(data)
  File "GPS.py", line 28, in parseGPS
    degreeChecksum = sdata[13] #Checksum
IndexError: list index out of range

When I print out sdata: ['$GPRMC', '180205.00', 'A', '*removed*', 'N', '*removed*', 'W', '0.0', '163.5', '141021', '15.5', 'E', 'A*14\r\n']

saeedjohar commented 2 years ago

Please change line 28 by degreeChecksum = sdata[12] and try again.