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
304 views 0 comments
by anonymous
I am using MODBUS serial master package to read data from MODBUS Slave devices. Then transmit this data using Data to Server feature via MQTT. This works as expected. I would like to know is there any way to include Teltonika device serial number in the MQTT publish message?

Also can someone explain what exactly is "request name %r" field in Data to Server?

1 Answer

0 votes
by anonymous

Hello,

You can get a Teltonika device serial number using the correct register number in Modbus request configuration. Here you can find a list with parameters, for example Router serial number register is 40:

https://wiki.teltonika-networks.com/view/Monitoring_via_Modbus

Configure request for serial number on your Modbus Serial Master:

https://wiki.teltonika-networks.com/view/TRB145_Modbus#Requests_Configuration

When configuring JSON format, make sure to include "Data":%a in the segment. This will include all data from requests in the message send by Data to Server, including serial number request.

https://wiki.teltonika-networks.com/view/TRB145_Data_to_Server

If you need serial number just from a single device, another option is to manually input it in JSON segment. Check screenshots below for more details.

"request name":%r field in Data to Server is the name of the request that you have added in Services -> Modbus -> Modbus Serial Master -> Request Configuration page.

Best Regards,

Tomas M.