Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

rtborg
Posts: 67
Joined: Wed Oct 23, 2019 6:15 am

Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

Postby rtborg » Wed Mar 30, 2022 1:02 pm

I am using the Modbus master example with the following hardware:
- ESP32 DevKitC V4
- RTU mode, baud rate 115200
- Slave respond timeout: 2000 ms
- SparkFun RS485 breakout board
- RS485-to-USB adapter
- pyModSlave simulator

I've compiled the example code and it runs on the board. Using pyModSerial, I can see the traffic, example below:

[RTU]>Rx > 15:52:24:847 - 05 04 00 00 00 02 70 4F /* ESP32 query */
[RTU]>Tx > 15:52:24:851 - 05 04 04 21 C0 8F 3B 91 A7 /* pyModSlave response */

However, despite the response being sent on time, I always get err = 0x107 (ESP_ERR_TIMEOUT).

What would be the reason for that?

ESP_alisitsyn
Posts: 210
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

Postby ESP_alisitsyn » Thu Mar 31, 2022 2:41 pm

Hi @rtborg,

The error means that the master can not get the data from the slave during response time.
This usually happens if your RTS line does not control the direction of the line driver correctly or RXD pin of ESP32 can not receive the data from RO pin of line driver.
Please check the RS485 interface using the test example first https://github.com/espressif/esp-idf/tr ... echo_rs485. Also please let me know your revision of esp-idf (the output of the command: `git describe` in the esp-idf repo).
Thanks.

rtborg
Posts: 67
Joined: Wed Oct 23, 2019 6:15 am

Re: Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

Postby rtborg » Fri Apr 01, 2022 11:26 am

Hello,

The problem was rectified when I changed the RS485 adapter board.

Thank you for the input.

Who is online

Users browsing this forum: Bing [Bot], EarthAndy, MicroController and 130 guests