st-one-io / node-red-contrib-s7

A Node-RED node to interact with Siemens S7 PLCs
GNU General Public License v3.0
111 stars 58 forks source link

V3.0.0-beta.3 not working on IOT2040 #82

Closed bergmanu closed 3 years ago

bergmanu commented 3 years ago

Describe the bug

With version 3.0.0-beta.3 node-red crashes immediately when a PLC (S7-1500 / S7-1200) is connected. The message is:

9 Nov 22:18:06 - TypeError: stream.off is not a function
at ISOOnTCPClient.isoOnTcp.createConnection (/usr/lib/node_modules/node-red-                                                                                                             contrib-s7/node_modules/@st-one-io/nodes7/src/s7endpoint.js:207:24)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ISOOnTCPClient.emit (events.js:208:7)
at process.nextTick (/usr/lib/node_modules/node-red-contrib-s7/node_modules/                                                                                                             iso-on-tcp/src/client.js:193:45)
at _combinedTickCallback (internal/process/next_tick.js:132:7)

To Reproduce

Steps to reproduce the behavior:

  1. Install node-red-contrib-s7 via "Manage Palette"
  2. Version 3.0.0-beta.3 gets installed
  3. Configure S7 node
  4. Don't connect the PLC -> Status of the node is "offline"
  5. Connect PLC -> node-red crashes

Expected behavior

It is possible to establish a connection to a PLC with the version which is automatically installed

Logs

- TypeError: stream.off is not a function
at ISOOnTCPClient.isoOnTcp.createConnection (/usr/lib/node_modules/node-red-                                                                                                             contrib-s7/node_modules/@st-one-io/nodes7/src/s7endpoint.js:207:24)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ISOOnTCPClient.emit (events.js:208:7)
at process.nextTick (/usr/lib/node_modules/node-red-contrib-s7/node_modules/                                                                                                             iso-on-tcp/src/client.js:193:45)
at _combinedTickCallback (internal/process/next_tick.js:132:7)

Flow

Please attach your flow either as a file or properly formatted as JSON

flows_iot2000.zip

Environment

Additional context

With the IOT2050 (Debian 10 based) it doesn't result in an uncaught exception and everything works fine

gfcittolin commented 3 years ago

Thanks for the report. Unfortunately, for 3.0.0 onwards only versions of nodejs 10 or greater will be supported, due to big changes in the underlying codebase. I'll put a notice on the readme, so that this requirement is documented and explicit.