stream icon indicating copy to clipboard operation
stream copied to clipboard

Node 12 compatibility

Open zamu87 opened this issue 7 years ago • 5 comments

The version of serialport included in package.json (<7) is not compatible with node 12 and generates a lot of errors during installation. Have you already planned the update of that package?

zamu87 avatar May 17 '19 08:05 zamu87

No, I use this module quite a lot on arm devices so I need a simpler serialport module. I'm not sure why I added the <7 but perhaps it was because of the errors.

Does version >=7 work with the module?

dresende avatar May 17 '19 09:05 dresende

I've not tested it with serialport 7.x because I haven't any serial modbus device but only tcp.

zamu87 avatar May 17 '19 13:05 zamu87

Then you should be fine without that dependency at all.

dresende avatar May 17 '19 13:05 dresende

No, I use this module quite a lot on arm devices so I need a simpler serialport module. I'm not sure why I added the <7 but perhaps it was because of the errors.

Does version >=7 work with the module?

I've just tested it with 8.0.5. It mostly works. writeSingleCoil() and writeSingleRegister() look ok, readHoldingRegisters() and readInputRegisters() too. But readCoils() and readDiscreteInputs() are not. They always return array of length Math.ceil(quantity/8)*8 and trails with zeros, so if { address: 1, quantity: 5 } even if all 8 coils are 1s it returns [1,1,1,1,1,0,0,0].

sarat12 avatar Dec 04 '19 18:12 sarat12

No, I use this module quite a lot on arm devices so I need a simpler serialport module. I'm not sure why I added the <7 but perhaps it was because of the errors. Does version >=7 work with the module?

I've just tested it with 8.0.5. It mostly works. writeSingleCoil() and writeSingleRegister() look ok, readHoldingRegisters() and readInputRegisters() too. But readCoils() and readDiscreteInputs() are not. They always return array of length Math.ceil(quantity/8)*8 and trails with zeros, so if { address: 1, quantity: 5 } even if all 8 coils are 1s it returns [1,1,1,1,1,0,0,0].

hmm.. I've switched back to 7 and i see the same. Is that expected?

sarat12 avatar Dec 08 '19 16:12 sarat12