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
485 views 2 comments
by anonymous

Dear All,

Hello, I would really appreciate your help with this problem i am facing.

I want to send GPS data (latitude, longitude, altitude, speed, angle) via MQTT using RUT955 modbus. But from this documentation https://wiki.teltonika-networks.com/view/RUT955_Modbus, I can only access GPS longitude, latitude, and speed. 

How can I access altitude and speed data using modbus? So I can send all GPS data via MQTT using modbus.

Thank you,

Best Regards,

1 Answer

0 votes
by anonymous

Hello,

Since altitude and angle values are not included in MODBUS registers by default, you would need to create custom registers, with these values.

For instructions, please refer to the following wiki article: https://wiki.teltonika-networks.com/view/RUT240_modbus_custom_register_block.

To query for GPS values, please use gpsctl command with options -a for angle and -g for angle. 

Best regards,

by anonymous

Thank you for your help.

I want to ask again. I created custom registers with this query:

while true
do
gpsctl -a > /tmp/regfile
gpsctl -g >> /tmp/regfile
sleep 5
done

Then I checked from collected data in hex:



0000000 302e 3030 3030 3030 0a30 2e30 3030 3030 

0000010 300a 

0000012

Then I read the data from modbus TCP master:

*I didn't connect gps antenna to my teltonika yet. So the values of GPS still zero.

The problem is when I read GPS heading (1029-1032 register address) from RUT955 modbus TCP master, there is "\x0A" in the first of heading data, because there is delimiter between altitude and heading data. The question is, what should I change from that query? Because when I use that query before, it will make "\x0A" delimiter between each data in modbus register.

Thank you,

Best regards,

by anonymous
Hello,

sorry for the delayed response.

Would starting the reading from register 1030 cause some data loss? Because if the delimiter is one register long, then that would be the easiest solution.

Let me know if this solution does not help and if another solution is needed.

Best regards,

DaumantasG