Closed MichaelUray closed 1 year ago
I could not reproduce your problem. I compiled your code, tested it with Modbus Simulator and it worked fine. And also I can't see anything about Modbus code in the error log. It seems like our system restarts when it is supposed to start the CPUs, long before the Modbus code. I also suggest that you reload the component just in case, since I've recently updated it.
It looks it was somehow a hardware related issue, when I connect the JTAG debugger the bevaiour changes. Not sure what it was exectly, but I guess it has something to do that I changed the USB/serial adapter to another type as I used before without problems. Maybe because the ESP32 gets supplied by an USB hub with an external supply and the serial converter directly from my mainboard.
Sorry for bothering you here with issues which actually have nothing to do with your library.
I am experiencing a watchdog issue, when I am reading more registers (e.g. 80) at once.
On my PC is the Modbus Simulator running and it is connected via an USB serial/TTL converter to my ESP32. To read 40 registers at once (
uint16_t holdingRegisters[40]
) works fine, but as soon as I change it to 80 registers (uint16_t holdingRegisters[80]
), the watchdog triggers and the ESP reboots.This is my testing code:
The serial log:
At this point the watchdog happens as soon as I start the Modbus slave simulator on my PC and it returns some data to the ESP:
The
defaultBufferSize
in the library is set 260 bytes, which should be enough to read 80 registers (160 bytes + a bit overhead).Any idea what could cause this issue? Maybe any other buffers which are defined too small?