FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
580 views 1 comments
by anonymous

The map shows:

FIX TIME LATITUDE LONGITUDE
2020-09-03 21:34:42 53.248878 -6.658738

The data i get from HTTP shows:

"$GPGGA,212533.00,5314.932656,N,00639.524180,W,1,08,0.7,95.4,M,48.0,M,,*49",

Why are they not the same?
I might add one of the locations is correct.
by anonymous
Was working on getting the info into node red made the following and now it adds up:

// Split msg.payload at \n and loop over what we get

for (var Entry of msg.payload.split('\n')) {

    

    // Select $GPGGA

    if (Entry.includes("$GPGGA")) {

        

        // Split entry at ,

        Entry = Entry.split(',')

        

        // 2 = Latitude

        // 4 = Longitude

        // 5 = Longitude E/W

        

        // Get everything after the first 2 didgets and / 60

        var Latitude = Number(Entry[2].substring(2, Entry[2].length)) / 60

        

        // Add the first 2 didgets to what we got

        Latitude += Number(Entry[2].substring(0, 2))

        

        // Round to 6 decimal places

        Latitude = Number(parseFloat(Latitude).toFixed(6))

        // Get everything after the first 3 didgets and / 60

        var Longitude = Number(Entry[4].substring(3, Entry[4].length)) / 60

        

        // Add the first 3 didgets to what we got

        Longitude += Number(Entry[4].substring(0, 3))

        

        // Round to 6 decimal places

        Longitude = parseFloat(Longitude).toFixed(6)

        

        // 5 is Longitude E/W We need to * -1 on West

        if (Entry[5] == 'W') {

            Longitude = Longitude * -1

        }

        

        

    }

}

msg.Latitude = Latitude

msg.Longitude = Longitude

return msg;

1 Answer

+1 vote
by anonymous

Hi!

You can use online NMEA decoders to see where does that "parsed" message lead you

In this website insert your GPGGA data ( $GPGGA,212533.00,5314.932656,N,00639.524180,W,1,08,0.7,95.4,M,48.0,M,,*49ant just look for a difference with the MAP FIX you got in WebUI, in this scenario:

53.248878 -6.658738

You can insert this latitude and longitude info in Google MAPS and it will indeed show you the same place you checked with NMEA decoder before.


EB.