Closed profi-max closed 10 months ago
I transferred the project to the VSCode+Platformio to be able to change the library files. Unfortunately, E4 error remains. With defines:
#define MODBUSIP_DEBUG
#define MODBUSRTU_DEBUG
#define MODBUSRTU_MAX_READMS 300
Terminal messages:
TCP IP in - 192.168.1.78 Fn: 03, len: 5
3 0 0 0 A
3 14 1 F4 0 C8 A AB 5 5F F 8 D 98 0 1 0 B 0 0 0 0 A6 A6
RTU Slave: 1, Fn: 03, len: 22, Response TCP IP: 192.168.1.78
0: Bytes available 12
TCP IP in - 192.168.1.78 Fn: 03, len: 5
3 0 0 0 A
3 14 1 F4 0 C8 A AB 5 5F F 8 D 98 0 1 0 B 0 0 0 0 A6 A6
RTU Slave: 1, Fn: 03, len: 22, Response TCP IP: 192.168.1.78
0: Bytes available 12
TCP IP in - 192.168.1.78 Fn: 03, len: 5
3 0 0 0 A
3 14 1 F4 0 C8 A D5 5 67 E AB D 98 0 1 0 B 0 0 0 0 F6 BB
RTU Slave: 1, Fn: 03, len: 22, Response TCP IP: 192.168.1.78
0: Bytes available 12
TCP IP in - 192.168.1.78 Fn: 03, len: 5
3 0 0 0 A
3 14 1 F4 0 C8 A D5 5 67 E AB D 98 0 1 0 B 0 0 0 7D F7
Modbus RTU result: E4, Mem: 47072
0: Bytes available 12
TCP IP in - 192.168.1.78 Fn: 03, len: 5
0: Bytes available 12
TCP IP in - 192.168.1.78 Fn: 03, len: 5
Unfortunately, the problem did not solve.
Thanks to the author for the library. But I had a problem when repeating the example. Periodically an E4 error occurs. Please help. I use ArduinoIDE + ESP8266 Modbus RTU as master at SoftwareSerial <-bridge-> TCP server The code below works, but very often an error occurs E4 (timeout raises function cbRtuTrans()) , after which the work completely stops.
Terminal messagese:
But if I change the code to be confident in equipment and RTU side, then the error never arises.
The trick like this didn't help me: