This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Android tablet as source of nmea gps data
#1
Did you know you can run node-red on an  android?
https://nodered.org/docs/platforms/android

Just been playing around and almost got it to act as a source of nmea GPS data for openplotter sent over wifi.

Shame it doesn't actually work ;Wink but pretty sure that because the nmea message is badly created in node-red by me. 

Interesting though Cool  

Flow on the tablet >

[Image: WUWYdVu.png]

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": []
   }
]




[Image: dgYfLvC.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)