vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.91k stars 708 forks source link

error parsing time #758

Closed yazantab closed 1 month ago

yazantab commented 8 months ago

https://github.com/vshymanskyy/TinyGSM/blob/92c0ba372195ecd463305d99e98552b5dd2bd1ff/src/TinyGsmClientBG96.h#L357

on line 357, GF(GSM_NL "+QGPSLOC:" should be replaced by GF(GSM_NL "+QGPSLOC: " (with a space at the end before the dopple quotation mark) to solve a parsing problem. when you try to get the time the data will be wrong, because out of a NMEA-msg: +QGPSLOC: 083244.0 ...... the time should be as following: hh: 08 mm: 32 ss: 44

however because of the space the getGPS method will consider the space as a digit and give for that reason the following time: hh: 0 mm: 83 ss: 244

ihour = streamGetIntLength(2); // Two digit hour here the space will be considers as digit

the suggested solution at the top would solve the problem