TRB145 or TRB245 : SUB (write register) from server (Broker MQTTS) to Slave Modbus RTU


Here my configuration :

I’m working on 2 Teltonika gates, the TRB145 and TRB245.

My aim is to read registers from one or more Modbus RTU slaves and transmit them to our MQTT broker on our server via 4G.
To do this, I’ve used the Modbus Serial Master function, in which I’ve defined all my Modbus requests, and then used the Data to Server function in MQTT. It’s all working, no problem.

Now I’d like to write through my server in MQTT to the registers of my slaves (SUB function). But I can’t do it. I don’t know how to program this function on the TRB145 and TRB245 side. Should I use MQTT Modbus Gateway or install the MQTT package and use the broker and publisher?

Can you send me a configuration example for my use case?

I’d like to ask you another question: if I’m reading Modbus (IP or RTU), what’s the limit on the number of registers I can read and transmit via Data to Server (in MQTT)? Would 1000 variables every 10 minutes work?

Thank you in advance for your reply.

Best regards


Data to Server feature is used to send collected Modbus data. This feature is not used to write to Modbus RTU slave devices. However, it is possible to write to Modbus RTU slaves over MQTT. For this, you can use MQTT Serial gateway feature.We have a configuration example available on our wiki page here. You can also take a look at this post here.

Kind Regards,

Thanks for your reply. Another question, how much tags could I read and send over MQTT (Data To Server) with a TRB245?
Is there a limit ? I would like to read every tags every 10 minutes?

This topic was automatically closed after 15 days. New replies are no longer allowed.