Page 1 of 1

Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

Posted: Wed Mar 30, 2022 1:02 pm
by rtborg
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?

Re: Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

Posted: Thu Mar 31, 2022 2:41 pm
by ESP_alisitsyn
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.

Re: Modbus master err = 0x107 (ESP_ERR_TIMEOUT)

Posted: Fri Apr 01, 2022 11:26 am
by rtborg
Hello,

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

Thank you for the input.