vshymanskyy / TinyGSM

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

[LilyGO-T-SIM7000G] GPS as DDMM.MMMM-format and Date/Time of GPSraw #627

Closed MichaelLeipzig closed 2 years ago

MichaelLeipzig commented 2 years ago

Hello,

is it possible to get the GPS-Coordinates in the format: DDFF.FFFF with the LilyGO-T-SIM7000G and TinyGSM? As I have to use an existing GPS-Server the only way to get GPS in is as NMEA-format.

At the moment I´ve only this format: GPSraw: 1,1,20211224065413.000,51.397520,12.383932,124.800,0.00,75.5,1,,0.6,0.9,0.6,,26,7,6,,45,, modem.getGPS: lat:51.397518 lon:12.383932 vsat:0.000000 usat:0.000000 year:1.750042 hour:1.750035 minute:3.040040

Tried to convert these coordinates like this: float lat2angle = lat2; float lat2degree = lat2angle; float lat2minutes = (lat2angle - (lat2degree) * 60.0); float lat2seconds = ((lat2angle - lat2degree - lat2minutes / 60.0) * 60.0 * 60.0 );

But this seems to produce the wrong solution: ToDegree: lat2degree:51.397518 lat2minutes:-3032.453613 lat2seconds:181947.218750

And is it possible to get the Date/Time out of GPSraw? At the moment I use the "getGsmLocation", but the right Date/Time is available at the GPSraw.

All the other things (GSM, GPRS, MQTT) run really great for me! Thank You!

Thank You and Merry Christmas Michael from Germany