TRB246 has proven to be a very useful gateway for those applications with a number of Modbus slaves connected via RS485. I’m finding specially interesting the Data to Server function combined with the Modbus Serial Client. I like the gateway polling the Modbus slaves and sending the readings via MQTT. However, I’ve detected some possible improvements:
All requests to a Modbus slave (server) use the same period. IMO, every request should have its own period, allowing some registers to be polled more or less often than others.
There is no way to create multiple MQTT (Data to Server) configurations, taking data from subsets of Modbus requests. Instead, a single MQTT packet is being sent containing the whole Modbus readings. Having the ability to send smaller MQTT packets with different intervals and to different topics is preferible.
Transmission periods for MQTT and Modbus requests can’t be lower than one second.
Data to Server via MQTT doesn’t allow the other way around. IMO, there should be a “Server to Data“ function as well, subscribing to a set of topics and handling incoming packets.
Thank you for your suggestions. Before forwarding them to our Research and Development department, I would like to clarify a few points.
You can create multiple Data to Server collections. Within each configuration, you can use the Data Filtering option. By filtering based on a specific Modbus Request Name or Server ID, it is possible to split registers into smaller JSON payloads and send them to different MQTT topics at varying intervals.
Which firmware version is currently running on your device? (Status → System)
For this use case, I would recommend using the MQTT Modbus Gateway feature. This service acts as a bridge, it subscribes to an MQTT topic, sends commands via Modbus RTU/TCP to Modbus servers, and then publishes the response back to MQTT.
You can find a configuration example here: Modbus RTU Master MQTT Serial Gateway - Teltonika Networks Wiki
More information about the service is available here: TRB246 Modbus - Teltonika Networks Wiki
Points 1 and 3 seem reasonable. I would appreciate your feedback on the other two before I proceed with forwarding the suggestions to R&D.
Creating multiple Data to Server collections would make the modem run multiple MQTT clients, one for each different topic or transmission interval. I understand this is a workaround but I wanted to avoid this.
The MQTT Modbus Gateway service is then my next stop.