ITADN

v5.45.1: Intermittent failure in 2/3 RTU slaves after minutes (reverted to 5.44.1 fixes)

#551ClosedGesinne 创建于 2025-10-31
bugsolved
G
Gesinnecommented
### Which node-red-contrib-modbus version are you using? - **Failing**: `5.45.1` - **Working**: `5.44.1` ### What happened? After upgrading from `node-red-contrib-modbus@5.44.1` to `5.45.1`, my Modbus RTU setup on Raspberry Pi experiences **intermittent failures**: - All 3 slaves (unit IDs 1, 2, 3) read correctly for **~2–5 minutes** after Node-RED startup. - Then **2 of the 3 slaves stop responding** (timeouts/errors). The third continues working. - **Restarting Node-RED service** restores all 3 temporarily, but the issue repeats after ~5 minutes. **Downgrading back to `5.44.1` immediately resolves the issue** — stable readings for hours/days. No hardware changes. Reproducible on **2 out of 3 identical RPis** (the third never upgraded and never failed). This appears to be a **regression in queue handling, reconnection FSM, or timeout logic** in v5.45.1, possibly triggered by multi-unit ID polling over serial. ### Environment - **Node-RED**: `v4.1.1` - **Node.js**: `v20.19.5` - **OS**: `Linux 6.12.47+rpt-rpi-v8 arm64 LE` (Raspberry Pi OS) - **Serial config**: `/dev/ttyAMA0 @ 115200 baud, 8N1, no parity` - **Bus**: 3 slaves, ~1–5m cable, 120Ω termination at both ends, common GND - **No other changes** between versions ### How can this be reproduced? 1. `npm install node-red-contrib-modbus@5.45.1` 2. Configure **one** `modbus-client` (serial RTU): - Connection delay: `100ms` - Queue delay: `200ms` - Timeout: `200ms` - Reconnect: `100ms` 3. Add **3 `modbus-flex-getter` nodes** polling: - Unit IDs: `1`, `2`, `3` - FC=3, addresses 0–110 - Triggered by inject every ~5–10s 4. Deploy 5. Monitor: `journalctl -u nodered -f | grep modbus` 6. **Wait 2–5 min** → warnings + 2 slaves fail ### What did you expect to happen? Stable polling of **all 3 slaves indefinitely**, as in `5.44.1`. No repeated reconnections or queue saturation. ### Actual Behavior (Logs) After ~5 minutes: ```log 31 Oct 12:44:52 raspberrypi node-red-pi[733]: 31 Oct 12:44:52 - [warn] [modbus-flex-getter:Tarjeta2] Flex-Getter -> Inject while node is not ready for input. 31 Oct 12:44:52 raspberrypi node-red-pi[733]: 31 Oct 12:44:52 - [warn] [modbus-client:rpi] Client -> fsm init state after reconnecting Serial@/dev/ttyAMA0:115200bit/s default Unit-Id: 1 31 Oct 12:44:52 raspberrypi node-red-pi[733]: 31 Oct 12:44:52 - [warn] [modbus-client:rpi] Client -> fsm init in 500 ms Serial@/dev/ttyAMA0:115200bit/s default Unit-Id: 1
关闭于 2025-11-05 4 条评论