FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

12086 questions

14384 answers

22686 comments

36289 members

0 votes
123 views 0 comments
by
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

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.