Help Needed: Modbus Communication Failing on TRB245 with RS-485 Half-Duplex Setup

Hello,

I’m working on integrating a Modbus RTU device with the Teltonika TRB245 using the RS-485 half-duplex interface. Despite setting everything up according to the manual, I keep encountering “failed request” errors when trying to query registers on the connected device.

Here’s an overview of my setup:

  1. Physical Wiring:
  • RS-485 D+ and D- lines from the device are connected to the TRB245’s A and B terminals, respectively.
  1. TRB245 Configuration:
  • Serial interface is set to RS-485 half-duplex.
  • Baud rate, parity, and stop bits are matched with the device’s settings.
  • Modbus Client is configured with the correct Slave ID, register address, and function code (03 - Read Holding Registers).
  1. The Issue:
  • Any query sent via the TRB245’s Modbus Client results in a “failed request” error.
  • Logs indicate no response from the device.

Steps I’ve already tried:

  • Verified wiring and swapped D+ and D- as a precaution.
  • Tested with increased timeout and multiple retries in the TRB245 Modbus settings.
  • Used an RS-485 to USB adapter with Modbus Poll software on a PC, which successfully communicated with the device using the same parameters.

It seems the issue might be specific to the TRB245 configuration or compatibility with this device. Has anyone else encountered a similar issue or successfully used the TRB245 for Modbus communication in a half-duplex RS-485 setup?

Any guidance or suggestions would be greatly appreciated!

Thanks in advance.



Hello,

Thank you for reaching out.

The first thing to check in your setup is the wiring. Ensure that the R+ and D+ terminals are connected (shortened) and the R- and D- terminals are also connected (shortened), as shown in the wiring example below:

If you need further assistance or have additional questions, feel free to reach out.

Best regards,

1 Like

Hi Martynas,
I appreciate the reply,

unfortunately I still am receiving the “failed request” error after wiring up as recommended. - This maybe a configuration problem but I cannot see one.

When setting up the Modbus Serial Client (as I need to be able to read certain holding registers of my sensor)
NOTE:
The client signals as up.
The device also signals as up.




A Question
RE: modbus → mqtt
is it possible to pass modbus communication to mqtt then to a third party with the trb245?

I am knew to networking and IoT so please forgive my not fully understanding!

Kind regards,
Joshua.

Hello Joshua,

For testing purposes, could you try the following:

  • Change Period and Timeout values to their default settings (e.g., Period: 60 seconds, Timeout: 1 second).
  • Ensure that the data type matches the requirements specified in your server device’s manual.
  • Try adjusting the baud rate to common values such as 9600 or 115200.

If the issue persists, performing a factory reset and setting up the configuration from scratch might help eliminate any misconfigurations.

Regarding your question about Modbus to MQTT:
Yes, it’s possible to send Modbus data to an MQTT broker using the Modbus serial client MQTT gateway functionality on the TRB245. A detailed configuration example can be found in this guide: Modbus RTU Client MQTT Serial Gateway

Feel free to reach out if you have further questions or need additional assistance.

Kind regards,

Hi Martynas,
Thank you again for your help,

I have made all the suggested changes, including a factory reset and unfortunately the problem still persists.

One thing of note is, (which may or may not be relevant) that the failed request counter is not always consistent in the time of when the first failed request is registered.
For example, with the settings I sent you yesterday I received the first failed request after 3 seconds.
After adjusting the period to the default 60 seconds and timeout to 1 second, I receive a failed request immediately - meaning not even 1 second.

Re MQTT set up you have sent me,
Is the same setup possible with just one trb245 gateway?

Thank you in advance,

Kind regards,
Joshua Moir

Hello,

Thank you for the update and additional details.

Could you let me know which firmware version is currently installed on your TRB245?

Regarding the inconsistent Failed requests counter, it is not directly tied to the issue. The counter updates only after the specified Period parameter. However, the error message “failed to test request, check your configuration” is often related to wiring issues, so I would not dismiss the possibility of incorrect wiring being the root cause.

Could you provide a picture of how your wiring looks? This would help confirm if there’s any potential misconnection or fault in the setup.

As for your question, yes, the same Modbus RTU client to MQTT serial gateway setup is possible using only the TRB245 as the Modbus Serial Client, with your sensor device acting as the server (slave).

Kind regards,