Node-RED Modbus RTU CRC Error: Troubleshooting Steps

Daniel Price3 min read
ModbusOther ManufacturerTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

A Modbus request visible on the RS-485 bus does not prove that Node-RED received a valid response. In this case, two independent faults were present: an fs-extra dependency problem in file logging and intermittent CRC errors after valid register data became available.

Separate the Node-RED Error from the CRC Error

The fs-extra error indicates a missing or damaged Node.js dependency, not a Modbus CRC failure. The exported flow enables file logging with useIOFile set to true, so disable that logging first and retest. If the error remains, reinstall the Modbus nodes or manually install fs-extra in the Node-RED user directory or Modbus-node directory, then restart Node-RED.

Symptom Supported cause or finding Action
fs-extra error Dependency is missing or damaged Disable file logging, reinstall the Modbus nodes, or install the dependency; restart Node-RED
No returned values The initial read requested three registers, while the cited device documentation described temperature as one 16-bit value at address 0 Read one input register at address 0
Intermittent CRC error Possible RS-485 noise or serial-setting mismatch Inspect cabling and confirm both endpoints use identical serial settings

Correct the Initial Register Read

The exported Modbus Read node used unit ID 1, input-register address 0, and quantity 3. Changing the quantity to 1 produced values after a reboot, which confirms that a single-register read is the correct starting point for the documented temperature value.

  1. Configure the Modbus Read node for unit ID 1, data type InputRegister, address 0, and quantity 1.
  2. Keep the tested serial configuration aligned at both ends: RTU, 19200 baud, 8 data bits, 1 stop bit, and even parity.
  3. Restart Node-RED after repairing the dependency, then verify that the top output of the Modbus Read node supplies the returned data.

A blinking communication LED confirms bus activity only. It does not verify register selection, response integrity, or successful parsing in Node-RED.

Diagnose Intermittent CRC Errors

Because valid values were received and CRC errors occurred only sometimes, inspect the physical RS-485 link for noise or poor cabling and compare the serial configuration with the sensor configuration. The evidence states that termination was enabled at the device, but it does not establish the complete bus topology, cable condition, or configuration at every endpoint.

Retest with file logging disabled so application-level logging failures do not obscure the serial result. Record whether CRC errors persist while reading only address 0 with quantity 1; persistence under that reduced request points away from the original multi-register request and toward the serial link or configuration.

Scale and Route the Returned Values

A suggested conversion divides each raw value by 10.0, but the evidence does not confirm the sensor's scaling specification or the addresses for humidity and dew point. Verify those items in the device documentation before applying this function. When three confirmed raw values are present in msg.payload, connect the Function node to the top output of the Modbus Read node:

msg.data = msg.payload;
msg.payload = {
  temperature: msg.data[0] / 10.0,
  humidity: msg.data[1] / 10.0,
  dewPoint: msg.data[2] / 10.0
};
return msg;

Configure the Debug node to display msg.payload. Do not select msg.payload.function, because that property is not created by this function. If the three measurements occupy separate documented addresses, read those addresses explicitly rather than assuming that one three-register request maps to temperature, humidity, and dew point.

FAQ

Why does Node-RED show an fs-extra error with Modbus?

File logging is enabled in the exported flow, and fs-extra is missing or damaged. Disable file logging and retest; if necessary, reinstall the Modbus nodes or install the dependency, then restart Node-RED.

What Modbus settings returned the TH-AP temperature value?

Use unit ID 1, input-register address 0, and quantity 1. The tested serial configuration was RTU at 19200 baud with 8 data bits, 1 stop bit, and even parity.

What causes intermittent Modbus RTU CRC errors?

The evidence identifies RS-485 noise, bad cabling, and mismatched serial settings as possible causes. Confirm identical serial settings at both endpoints and retest the reduced one-register request while monitoring whether CRC errors continue.

Back to blog