Problems with Modbus mqtt gateway-TRB 255


I’m trying to read parameters from a solar inverter via mqtt/modbus TCP.
I’ve setup and activated the mqtt modbus gateway function.

If i try to read some registers of the inverter directly from the TRB255 (in the “request configuration testing” under "modbus TCP master) it works, so the modbus connectione between the inverter and the TRB255 should be OK.

But if i try to read parameters via mqtt, i get the response " ERROR: read register failure - operation timed out.
I don’t understand why, the connection between the Teltonika device and the mqtt broker also works, for example, if i read the internal registers of the TRB255 i get a correct response.

Any suggestions?

Thanks in advance


Perhaps you could post a screenshot on how the Modbus TCP Master configuration looks like in the WebUI and how the MQTT string looks like when you’re receiving this error?
The error itself suggests that the Slave device did not respond to a request from the router, which could indicate that incorrect ID, IP address, or port was used.

Best regards,

This is the modbus configuration:

If i try to read the slave directly from the TRB255 with the configuration test function, it works.
Also if i setup a data sender, i can get the parametrs i want.

The problem happens when i try to reach the slave from a mqtt client.
In this case the response is the read register error.

I attach the other screenshots in a separate reply as the system won’t let me embed more than an image.

Thank you

Response of a read request directly from the TRB255

String sent via mqtt client:

Could you also upload a screenshot of the prova request?

Here it is:

Could be a problem within the mqtt gateway? It seems the TRB can’t forward the mqtt commands to the inverter.


The error you received is coming from the Modbus Master, so I doubt that the issue is with the gateway itself. Make sure you are using the latest firmware version, as there were some fixes in the previous MQTT Gateway functionality.

I’ll try an upgrade, currently i’m on release 07.04.3.
What i can’t understand is why the slave responds to automated request sent by the router and doesn’t respond to the requests made via an mqtt client.

No luck even after the firware upgrade.
Do you have other suggestions?

Please try configuring Modbus TCP Slave on the TRB255, and then using MQTT Gateway try to read register 2, with length of 2. This should return the uptime of the device. Please use as the IP address.
Full list of Modbus Get parameters from the router can be found here: TRB255 Modbus - Teltonika Networks Wiki
If this works, we’ll know that the issue is particularly with the slave device.

Best regards,

yes, this works.

Could be some network settings?


I’ve replicated your setup, but have not noticed any issues. How is your Modbus TCP Slave connected to the TRB255? Are you using a network switch?
Additionally, please post the MQTT Gateway parameters.

No, the TRB255 is directly connected to the inverter (Huawei) via LAN cable (there’s just a sort of RJ45-usb adapter) SDongleA-05 Smart Dongle Quick Guide (WLAN-FE)- Huawei

Mqtt gateway parameters:

Thanks for the help.

Today i updated also the firmware of the inverter, but the issue remains.


To troubleshoot the issue further, we’d need to join a remote session. However, as the Community forum currently does not have a private communications channel, it will not be possible to organize a remote session here. Please reach out to your designated sales manager, reseller, or fill out the Contact Us form here: Teltonika Networks - LTE Routers, Gateways & Modems for IoT and we will be able to help you out.

Best regards,

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