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
278 views 0 comments
by anonymous
I am reading a ModbusRTU device via the RUT955 and sends this data to a MQTT broker. This works fine. Now I want to add the GPS location, so that this is send via MQTT. I can read the GPS location over ModbusTCP, but that is not what I want. There has been another thread in 2018 but no clear answer.

Thank you, Maurits

1 Answer

0 votes
by anonymous

Hello,

 

You can read GPS data from the RUT955 via Modbus by configuring the router to be both a Modbus slave and master simultaneously. This way, the RUT955 will query GPS information from itself via Modbus requests. Then, you can send this data via Data to Server using MQTT. In this case, GPS data is sent via MQTT.

 

Please let me know if this method is not suitable for your needs and what exactly you are looking for.

 

There are also options for sending GPS data here. However, since you are interested in using MQTT and if the above methods are not viable, you can create a custom script to send GPS data. You can obtain GPS information using the 'gpsctl' command. Type 'gpsctl --help' to see all available options.

 

Next, take the GPS data obtained from the 'gpsctl' command and send it directly via mosquitto. We have some information on this here, but you can also find more resources online. The message would include the GPS data obtained from the 'gpsctl' commands.

 

Additionally, you can explore 'crontab' to configure your device to execute custom scripts periodically at defined intervals. More information on crontab can be found here.

 

Kind Regards, 

Andzej