Getting started to Building a GPS tracking platform

Hello everyone,

I have submitted posts in the past regarding GPS Tracking and I want to get more proactive to get something into action.

I have already had a responsive HTML and App User interface built, which is ready to go, apart from a few little changes which I will be doing as needed before production takes place.

In the past, I was advised that there was a cookbook regarding putting together a GPS Tracking solution, which I was not able to find.

To make a start and to get more proactive, can I ask;

  • Can the UI be hosted or installed on Node-Red, and is there an access control/customer login function available?

  • Is there an actual cookbook or similar which has the formula or instructions on building the essentials to get started, including generating reports, etc? Or is there someone that is willing to get paid to provide support in building this infrastructure.

Thank you in advance,
Michael

Yes, depending on what you already have / what you want, the answer has conditions.
e.g.

  • node-red-dashboard can build your entire UI in node-red nodes.
  • uibuilder can host a vue SPA (or other other non complied, compiled web apps)

If you built a web app with login capabilities - yes (serve it via uibuilder)
Or
You could build a login system using endpoints in node-red (cookbook recipes for endpoints) and make use of JSON web token nodes etc

As for node-red-dashboard, this is not really feasible due to single user design. (tho it can be faked - been discussed on forum many times)

No, but there are plenty of threads in the forum on grabbing data from a database & building CSV/Excel/PDF docs. Additionally, many of the contrib nodes have built-in help and built-in demo flows (CTRL+I to import). Lastly, be sure to search for example flows on the flows library.

You can post in the jobs section on the forum and slack.

Hello Steve-Mcl.
Thank you for your reply.

In regards to the UI, it is HTML based that is already built. What would you recommend regarding that?

In regards to the devices, is there somewhere in the TCP node or anywhere for that matter where I can add protocol data for the devices please.

uibuilder. It is a very comprehensive and capable contrib node that can host just about anything HTML/JS/CSS

The TCP node (like most nodes) are fairly atomic by design - in that they do one thing - in this case, TCP stuff.
To support/build a custom protocol, you simply string a bunch of nodes together to decode the TCP data - waa-laa a custom TCP driver built in low-code.

However, GPS has come up a few times - it might be you are using the same device as others have so you may find some snippets of code around the forum already. But since you have not described the device (nor its protocol) I can't tell you if there is already a contrib node or demo flow for this device/protocol.

Thank you for this.

Where do I find uibuilder please?

With the following protocol;
$RPT;V01;85000;1;20081017074156;+37.478519;+126.886819;12;300;1;1;11010;8.5
...how do I go about integrating this as a protocol into a node?

↓ in the flows library (or the palette manager in node-red)

You can probably just use the CSV node to separate on ; - but what does each part mean? Can you provide a breakdown of the individual parts?

Each ; is separated by new lines...

$RPT Message identifier
V01 Protocol version (Vxx)
85000 Device ID (xxxxx)
1 Event code (xxx)
20081017074156 DateTime (yyyyMMddHHmmss)
+37.478519 Latitude (+/-xx.xxxxxx)
+126.886819 Longitude (+/-xxx.xxxxxx)
12 Speed (Km/h) (xxx)
300 Course (degrees) (xxx)
1 GPS Status (0=GPS is not fixed;1=GPS is fixed) (x)
1 GSM Status (0=disconnected;1=connected) (x)
11010 Sensors (S3 + S2 + S1 + Speed + Ignition) (0=Off; 1=On) (xxxxx)
8.5 Main power voltage (xx.x)

Hope this helps

Thank you as well zenofmud

In which case, this is a very simple protocol to parse...

image

Demo flow (Use CTRL+I to import)

[{"id":"5abeb37bde42c093","type":"inject","z":"c1ebfd3083f3904f","name":"Fake TCP Comm $RPT;V01;...","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$RPT;V01;85000;1;20081017074156;+37.478519;+126.886819;12;300;1;1;11010;8.5","payloadType":"str","x":2280,"y":80,"wires":[["51b4b1a014d24a17"]]},{"id":"51b4b1a014d24a17","type":"csv","z":"c1ebfd3083f3904f","name":"","sep":";","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"MessageIdentifier,ProtocolVersion,DeviceID,Eventcode,DateTime,Latitude,Longitude,Speed_Kmh,Course_degrees,GPSStatus,GSMStatus,Sensors,Voltage","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":2220,"y":140,"wires":[["f2357b53de6e1814"]]},{"id":"f2357b53de6e1814","type":"function","z":"c1ebfd3083f3904f","name":"parse","func":"var Sensors = msg.payload.Sensors.toString().split(\"\").reverse().map(e=>e === \"1\");\nmsg.payload.Sensors = {\n    Ignition: Sensors[0],\n    Speed: Sensors[1],\n    S1: Sensors[2],\n    S2: Sensors[3],\n    S3: Sensors[3],\n}\nmsg.payload.Latitude = Number(msg.payload.Latitude);\nmsg.payload.Longitude = Number(msg.payload.Longitude);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2350,"y":140,"wires":[["f7f2844eac7ba06d"]]},{"id":"f7f2844eac7ba06d","type":"debug","z":"c1ebfd3083f3904f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2330,"y":200,"wires":[]}]

Many thanks for this.

Do I need to do anything special to establish a TCP connection to the device?

Again, as you have not told me the device I have no idea. RTM.

Some devices you need to initiate the comms with a request packet (TCP Request node)
Others need to initiate the connection (TCP In node) and simply stream its data.

I am still reading through the protocols and all up we want to integrate around 5 devices. How would I go with both methods?

TCP Request node...

  1. drop an inject node onto editor & set payload to the string command required by the protocol
  2. drop a TCP Request node on your editor & fill in the details
  3. drop a debug node onto the editor

inject → TCP Request → debug

TCP In Node...

  1. drop a TCP In node on your editor & fill in the details
  2. Connect it to a debug node

TCP In → debug

Many thanks for this.

Once I start having success with this, I would like to make payment or a donation. Is this allowed, and how can I do so?

Thank you but all we ask is that you to feedback into the node-red community with support and contributions.
And dont forget to tell everyone how great it is :slight_smile:

PS: You could contribute to the OpenJS Foundation as a way of saying thanks. It has some benefits too: JavaScriptLandia

I will, absolutely for both suggestions.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.