Hi ,
I have just started learning OpenPLC . Here I am trying to run a simple LED program on ESP32 dev board(ESP32-WROOM-32) from OpenPLC runtime. My OpenPLC runtime is running on windows (same thing I tried on Ubuntu as well). For this I have added a slave device on OpenPLC runtime.
The added slave device details as below:. The IP, I have assigned to ESP32 board using OpenPLC editor and Its in the same network as windows machine.
I can monitor the program and its using correct address for LED %QX100.0.
But it keeps on disconnecting and there are errors on Modbus register . I have run the Blank_project before on the ESP32 using the link.
![[203128%2F9216433%2Fmceclip0]](https://d28lcup14p4e72.cloudfront.net/203128%2F9216433%2Fmceclip0.png)
Runtime logs as below:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device ESP32_Slave is disconnected. Attempting to reconnect...
Persistent Storage is empty
Connected to MB device ESP32_Slave
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued stop_dnp3() command
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command
Modbus Write Holding Registers failed on MB device ESP32_Slave: Connection timed out
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Modbus Read Input Registers failed on MB device ESP32_Slave: Connection timed out
Modbus Write Holding Registers failed on MB device ESP32_Slave: Bad file descriptor
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Server: Client accepted! Creating thread for the new client ID: 5...
Server: waiting for new client...
Server: Thread created for client ID: 5
Modbus Server: client ID: 5 has closed the connection
Terminating Modbus connections thread
Server: Client accepted! Creating thread for the new client ID: 8...
Server: waiting for new client...
Server: Thread created for client ID: 8
Modbus Server: client ID: 8 has closed the connection
Terminating Modbus connections thread
Server: Client accepted! Creating thread for the new client ID: 8...
Server: waiting for new client...
Server: Thread created for client ID: 8
Server: Client accepted! Creating thread for the new client ID: 5...
Server: waiting for new client...
Server: Thread created for client ID: 5
Modbus Server: client ID: 5 has closed the connection
Terminating Modbus connections thread
Server: Client accepted! Creating thread for the new client ID: 5...
Server: waiting for new client...
Server: Thread created for client ID: 5
Modbus Read Discrete Input Registers failed on MB device ESP32_Slave: Connection timed out
Modbus Write Coils failed on MB device ESP32_Slave: Bad file descriptor
Modbus Read Input Registers failed on MB device ESP32_Slave: Bad file descriptor
Modbus Write Holding Registers failed on MB device ESP32_Slave: Bad file descriptor
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Modbus Read Discrete Input Registers failed on MB device ESP32_Slave: Connection timed out
Modbus Write Coils failed on MB device ESP32_Slave: Bad file descriptor
Modbus Read Input Registers failed on MB device ESP32_Slave: Bad file descriptor
Modbus Write Holding Registers failed on MB device ESP32_Slave: Bad file descriptor
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Modbus Write Holding Registers failed on MB device ESP32_Slave: Connection timed out
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Modbus Read Input Registers failed on MB device ESP32_Slave: Connection timed out
Modbus Write Holding Registers failed on MB device ESP32_Slave: Bad file descriptor
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Modbus Write Holding Registers failed on MB device ESP32_Slave: Connection timed out
Device ESP32_Slave is disconnected. Attempting to reconnect...
Connected to MB device ESP32_Slave
Modbus Server: client ID: 8 has closed the connection
Terminating Modbus connections thread
##############################
I am not sure if I am doing something wrong. Can you please help here or point me to right links if there are any for such issues?
Thanks
Sajida