node-modbus-serial
node-modbus-serial copied to clipboard
Modbus Serial communication is very unreliably working on my device
It sometimes reads the data sometime, it hangs to read from the bus and write to the Bus.
I get a lot of CRC error while reading and writing to Register.
I am continuously reading from a coil, that also sometimes not read properly, and hangs.
I keep getting following error.
(node:4278) UnhandledPromiseRejectionWarning: Error: CRC error
at RTUBufferedPort.
Hi, thank you for the issue I added a need help label in case someone can help you
Can you add some information about the application? Boud rate? Line type? Other devices on the line? The code you use to connect and read? Timeouts you use? Any other information you think can help someone that will try to help?
I am using a velocio RTU Modbus Master, which has Registers and Coils mapped as required by Application. Application runs on a Toradex arm64 device, with electron. Node version on device is 6.5.0 So communication is like, Application from Toradex , reads and writes Holding and Coil registers. Application continuously keep reading one coil at the interval of 500 milli seconds. That read is not consistent. Sometimes it works and sometimes it does not. Baud Rate - 9600, connected on Serial port. console.log(config);
const client = new ModbusRTU();
// eslint-disable-next-line no-unused-vars function serial_connection() { client.connectRTUBuffered(config.port, { baudRate: 9600, dataBits: 8, parity: "none", stopBits: 1 }); client.open(); console.log('Connection Done'); client.setID(1); }
Timeouts not used.