Timeout error

I written the code for modbus communication using RS 485.Here esp32 as a master and modbus poll as a software.while uploading the code the communication is establishing the timeout error is occuring .how to fix that one.
 
Modbus Poll is a Modbus master simulator. If your ESP32 is indeed a master, then this won't work, as a Modbus master cannot communicate to another Modbus master. You would need to use the Modbus slave simulator instead (https://www.modbustools.com/modbus_slave.html).

If you mistyped, and you instead have one Modbus master communicating to one Modbus slave and seeing timeouts, then check your wiring and communication settings.

For wiring, note that not all vendors use the same meaning for A and B labeling, so you may need to swap your + and - wires. Also, make sure to connect a third wire for 0V reference.

For communication settings, make sure that both devices are configured for the same baud rate, parity, stop bits, and number of data bits. Also make sure the Modbus address that the master is targeting matches the Modbus address configured in the slave.
 
Hi,
i wrote the code for modbus communication that is modbus RTU USING RS485.
Here i considered the esp32 as a master and and modbus poll software as a slave.
while to communicate with the modbus poll slave is not responding .
It is showing timeout error.
How to fix this problem i strucked here.
I set correct baud rate slave id ,parity and all .
please can you help me.
 

Attachments

Modbus Poll is a Modbus master simulator. If your ESP32 is indeed a master, then this won't work, as a Modbus master cannot communicate to another Modbus master. You would need to use the Modbus slave simulator instead (https://www.modbustools.com/modbus_slave.html).
If you're still having problems after downloading and using the Modbus Slave application instead of the Modbus Poll application, please post your complete code for your ESP32.
 
this is the complete code for the esp32
There was no code in your post.

Also, let's back up a little here. In order to communicate RS-485 between an ESP32 and a computer, you must be using a TTL to RS-485 converter with the ESP32 and a USB to RS-485 converter with the computer. Please confirm this is what you're doing.

If the above is true, please reply with a diagram or detailed description of the wiring connections you've made between the ESP32 and the TTL to RS-485 converter and a diagram or detailed description of the RS-485 wiring connections you've made between the ESP32's TTL to RS-485 converter and the computer's USB to RS-485 converter. It would also be helpful if you can include the vendor and model of the converters used and/or documentation for the converters.
 
This is the code i have while uploading this code to the ESP32 Module .The esp32 module may get damage .Please provide the the proper solution to this.
 
Again, there's no code in your post.

Let's forget about the code for now. Please answer all of the following questions:

  1. Which device is supposed to initiate read or write requests - the ESP32 or your computer?
  2. Are you now using Modbus Slave on your computer instead of Modbus Poll?
  3. Are you using a TTL to RS-485 converter/module connected to the ESP32? If yes, provide a diagram or detailed description of the connections made between the ESP32 and TTL to RS-485 converter/module.
  4. Are you using a USB to RS-485 converter connected to your computer?
  5. How do you have the RS-485 connection wired? Please provide a diagram or detailed description of the wiring connections between the RS-485 converters/modules.
  6. Are you using a Modbus library or did you write all of the Modbus code on the ESP32 yourself?
  7. Are you always seeing a timeout error, or is communications successful except when you upload code to the ESP32 you see a timeout error?
 
Top