arduino-libraries/ArduinoModbus

Crash after 1.0.4 update

jeromegirard opened this issue · 2 comments

Hi,

I just update to 1.0.4 and my code crash (reboot by WDT) on the following line
... if (!ModbusRTUClient.begin(9600)) { ...

Arduino MKRZero + MKR RS485 shield + MKR Ethernet shield

Rollback to 1.0.3 and everything is OK :)

Hi,

I can confirm this - I'm also using the Arduino MKR ZERO with the Arduino MKR RS485 Shield.
ArduinoModbus library: v1.0.4
ArduinoRS485 library: v1.0.0
Arduino IDE: v1.8.15
SAMD core: v1.8.11

My code got stuck when calling int ModbusRTUClientClass::begin(unsigned long baudrate, uint16_t config).
It's working normal again after rollback to 1.0.3.

After some rough (Serial.print()) debugging, it looks like it stuck while calling int modbus_connect(modbus_t *ctx) in int ModbusClient::begin(modbus_t* mb, int defaultId) (ModbusClient.cpp:58).

Hi,
the issue was a missing default value (it was ok in ModbusRTUServer 😞 ), sorry for the inconvenience. I also pushed version 1.0.5 that should be available in the next few hours via the library manager