Howard Weng/ 6 十二月, 2016/ IoT, TRRAK/ 0 comments

Connect tracker to Node RED

This will be the final step to have our GPRS tracker running in our system

We already have this path clear, next, we will have node-red to catch the data, then do some data processing.

Let me explain this in more detail.

 

Processing data at Node RED

%e6%8a%95%e5%bd%b1%e7%89%8757

 

If you carefully look at the code, our code only design to provide 3 data, that will be device ID, GPS location data in HEX (this is a data format), and battery level. Before I send It to server, I reformat the data into JSON file, as you can see title, data, also curly bracket, that is why the data is so small, and good for MQTT low latency transmission.

But the problem is Owntracks needs different format about GPS, it needs Latitude and Longitude in coordinate format, so we need shift the data back. Real time data is not provided by low level device like our board, so it must be added from Node-Red, and _Type, and Location is the necessary identifier for Owntracks too. That is why node-red fit in and do this job.

Therefore, I decided to let the device data to be delivered on this temporary channel -- owntracks/frrut/gps1 , the data is not well formatted, so it would not interfere our location points on the map, then I would deliver to actual howard channel, as user howard, and device name gprs_gps.

Then I also have a node to receive all data from Owntracks topic, for debug purpose.

Let me move to Node-Red for setup.

 

setup Processes

MQTT Input to receive data from Owntracks Mosquitto broker.

Configure Input MQTT credentials.
Receive data from topic :    owntracks/frrut/gps1

Function to convert payload to owntracks data format by node-red, then push to MQTT broker

Explain Function

MQTT Output to send data to Owntracks Mosquitto broker.

Change Topic Owntracks/(User Name)/(Device Name)
Mosquitto credentials

 

 

 

 

 

 

分享到:
Share this Post

About Howard Weng

More than 15 years of experience in electronics companies as Sales marketer and Product Manager. Currently I invest resources on open source and industry IoT system research, and provide data analytics service mainly for factory and retain business.

Leave a Comment

你的電子郵件位址並不會被公開。 必要欄位標記為 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*