Civlo85 / gsmHat

Using the Waveshare GSM/GPRS/GNSS Hat for Raspberry Pi with Python
MIT License
61 stars 26 forks source link

Not getting any gps data in GPSobj #16

Open Swevrs opened 2 years ago

Swevrs commented 2 years ago

when I got the hat working with the serial communication I have a problem. it seems that the GPSObj not stores the values when I running the test codes for the gps data ex:

`GPSObj = gsm.GetActualGPS()

print('Latitude: %s' % str(GPSObj.Latitude)) print('Longitude: %s' % str(GPSObj.Longitude)) print('Altitude: %s' % str(GPSObj.Altitude))`

it just returning: Latitude: 0.0 Longitude: 0.0 Altitude: 0.0

i have checked my gpsHat logfile and I can see that i get the gps cordinate from the gps reciver:

2022-05-09 19:57:28,604 - gsmHat.gsmHat - DEBUG - Sent to hat: AT+CGNSINF

2022-05-09 19:57:28,705 - gsmHat.gsmHat - DEBUG - Received Data: AT+CGNSINF 2022-05-09 19:57:28,715 - gsmHat.gsmHat - DEBUG - Received Data: +CGNSINF: 1,1,20220509175728.000,60.502652,15.313006,101.952,0.00,0.0,1,,0.7,1.0,0.7,,13,16,,,46,, 2022-05-09 19:57:28,715 - gsmHat.gsmHat - DEBUG - New GPS Data: 2022-05-09 19:57:28,717 - gsmHat.gsmHat - DEBUG - Received Data: OK 2022-05-09 19:57:28,717 - gsmHat.gsmHat - DEBUG - Lock Off 2022-05-09 19:57:29,419 - gsmHat.gsmHat - DEBUG - Sent to hat: AT+CPMS="SM"

2022-05-09 19:57:29,521 - gsmHat.gsmHat - DEBUG - Received Data: AT+CPMS="SM" 2022-05-09 19:57:29,523 - gsmHat.gsmHat - DEBUG - Received Data: +CPMS: 0,30,0,30,0,30 2022-05-09 19:57:29,524 - gsmHat.gsmHat - DEBUG - Received Data: OK

Someone that has this problem to or know how to do to fix it?

running on a raspberry pie zero 2 w with latest raspian lite