Code:
[
{
"id": "fc3e5c2c.93124",
"type": "inject",
"z": "ed680496.1bd7d8",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "1",
"crontab": "",
"once": false,
"x": 186.5,
"y": 222,
"wires": [
[
"adbf4729.fa4208"
]
]
},
{
"id": "38eb3796.e1e098",
"type": "debug",
"z": "ed680496.1bd7d8",
"name": "",
"active": false,
"console": "false",
"complete": "payload",
"x": 710,
"y": 220,
"wires": []
},
{
"id": "adbf4729.fa4208",
"type": "termux-location",
"z": "ed680496.1bd7d8",
"name": "",
"topic": "",
"provider": "gps",
"request": "once",
"x": 360,
"y": 260,
"wires": [
[
"ccef0d38.f5b85"
]
]
},
{
"id": "ccef0d38.f5b85",
"type": "function",
"z": "ed680496.1bd7d8",
"name": "",
"func": "var lat = msg.payload.latitude; // get lat from location message object\nvar long = -msg.payload.longitude;\n\nvar longMinutes = 60 * (long - Math.floor(long));\nlong=Math.floor(long)*100 + longMinutes;\n\nvar latMinutes = 60 * (lat - Math.floor(lat));\nlat=Math.floor(lat)*100 + latMinutes;\n\n\n\nmsg.payload= 'GPGLL,' + lat + ',N,' + long + ',W';\n\nvar nmea = msg.payload;\nvar checksum = 0; \n\nfor(var i = 0; i < nmea.length; i++) { \n checksum = checksum ^ nmea.charCodeAt(i); \n}\nchecksum = checksum.toString(16); //convert to hex\nnmea = '$' + nmea + '*' + checksum; //make the full nmea sentence again\n\nvar msg1 = { payload:nmea + '\\r\\n' };\n\nmsg = null;\n\nreturn msg1;",
"outputs": 1,
"noerr": 0,
"x": 530,
"y": 300,
"wires": [
[
"38eb3796.e1e098",
"2f773ed7.267842"
]
]
},
{
"id": "2f773ed7.267842",
"type": "tcp out",
"z": "ed680496.1bd7d8",
"host": "",
"port": "10114",
"beserver": "server",
"base64": false,
"end": false,
"name": "",
"x": 730,
"y": 300,
"wires": []
}
]