Closed pakerfeldt closed 7 years ago
The connection
options object should now be specified in the master's options and not the transport's:
var port = new SerialPort(serialPath, { baudrate: baudrate, parity: parity }, false);
this.modbus = library.createMaster({
transport: {
type: 'rtu',
eofTimeout: 500
},
connection: {
type: 'serial',
serialPort: port
},
suppressTransactionErrors: false,
retryOnException: true,
maxConcurrentRequests: 1,
defaultUnit: 0,
defaultMaxRetries: 1,
defaultTimeout: 1000,
});
👍
I have been using 0.1.0 for a while but tried to bump to 1.0.0. However, now it seems to try to open a TCP connection even though I have specified a serial port.
This is how I create the master:
And the log prints:
Am I missing something?