Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help]: Node-RED crashes when selecting the USB port in the ZWave Controller node #269

Closed
normanth opened this issue Mar 27, 2023 · 3 comments
Assignees
Labels
help-wanted Extra attention is needed

Comments

@normanth
Copy link

normanth commented Mar 27, 2023

How can we help?

Raspberry Pi 4 (Raspberry Pi OS Lite (64-bit) Debian Bullseye)
Docker version: 23.0.1
Node-RED image from nodered/node-red:latest - version v3.0.2
Linux Alpine 3.16.1
Node.js version v16.16.0
ZWave-JS version 8.0.0

Docker run with USB device:
docker run -it --net=host --user root --device=/dev/ttyACM0 --restart=unless-stopped -v /node-red/data-1:/data -e TZ=Europe/Berlin --name node-red-3-0-2 ft/node-red:3-0-2

Installation protocol of ZWave-JS:

2023-03-27T12:33:05.395Z Installieren : node-red-contrib-zwave-js 8.0.0

2023-03-27T12:33:09.350Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-zwave-js@8.0.0
2023-03-27T12:33:10.573Z [err] npm
2023-03-27T12:33:10.574Z [err]  WARN 
2023-03-27T12:33:10.575Z [err] config production Use `--omit=dev` instead.
2023-03-27T12:33:35.012Z [out] 
2023-03-27T12:33:35.012Z [out] added 136 packages in 25s
2023-03-27T12:33:35.051Z rc=0

After selection of serial port "/dev/ttyACM0" in ZWave-JS "ZWave Controller" Node-RED crashes and doesn't start anymore.

Log-File:

14:39:27.640 DRIVER   ███████╗ ██╗    ██╗  █████╗  ██╗   ██╗ ███████╗             ██╗ ███████╗
                      ╚══███╔╝ ██║    ██║ ██╔══██╗ ██║   ██║ ██╔════╝             ██║ ██╔════╝
                        ███╔╝  ██║ █╗ ██║ ███████║ ██║   ██║ █████╗   █████╗      ██║ ███████╗
                       ███╔╝   ██║███╗██║ ██╔══██║ ╚██╗ ██╔╝ ██╔══╝   ╚════╝ ██   ██║ ╚════██║
                      ███████╗ ╚███╔███╔╝ ██║  ██║  ╚████╔╝  ███████╗        ╚█████╔╝ ███████║
                      ╚══════╝  ╚══╝╚══╝  ╚═╝  ╚═╝   ╚═══╝   ╚══════╝         ╚════╝  ╚══════╝
14:39:27.646 DRIVER   version 10.12.0
14:39:27.647 DRIVER
14:39:27.649 DRIVER   starting driver...
14:39:27.686 DRIVER   opening serial port /dev/ttyACM0
27 Mar 14:39:27 - [info] Started flows
./entrypoint.sh: line 14:     7 Segmentation fault      (core dumped) /usr/local/bin/node $NODEOPTIONS node_modules/node-red/red.js --userDir /data $FLOWS

I have found this: serialport/node-serialport#2438
mlooise commented on Aug 27, 2022

But installation of "npm install node-red-node-serialport@0.15.0" in the Docker Container doesn't work.

bash-5.1# npm install node-red-node-serialport@0.15.0

added 43 packages, and audited 338 packages in 30s

52 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (5 low, 1 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
bash-5.1# npm version node-red-node-serialport
npm ERR! Invalid version: node-red-node-serialport

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/.npm/_logs/2023-03-27T14_07_54_295Z-debug-0.log

Version

8.0.0

Node-RED Version

3.0.2

What hardware are you using?

Raspberry Pi

Any code to add?

@normanth normanth added the help-wanted Extra attention is needed label Mar 27, 2023
@normanth normanth changed the title [Help]: test [Help]: Node-RED crashes when selecting the USB port in the ZWave Controller node Mar 27, 2023
@marcus-j-davies
Copy link
Member

marcus-j-davies commented Mar 27, 2023

Hi @normanth.

This is certainly always a problem with the serial port package in Alpine Linux (Docker)

Please see this comment.
#246 (comment)

In essence, you need to ensure all build tools are installed in your Docker image and run
npm rebuild --build-from-source INSIDE the docker image environment and within your .node-red directory - not outside.

I cant tell you where your .node-red directory is when using docker.

Basically, the prebuilt serilaport package binary for Alpine just doesnt work, and you need to build it your self.

and again make sure npm rebuild --build-from-source is run inside your docker environment and from within the .node-red directory or what ever directory it is for docker

@fabnavigator
Copy link

Hi @normanth, my two cents are to run node-red outside of docker for this. I was all in using docker, and finally gave up trying to get it to work. I've been very happy with my decision.

@normanth
Copy link
Author

Hi,

unfortunately, the rebuild in .node-red in the docker container (folder with node_modules inside) did not solve the problem.

Now I've installed node-red on the Raspberry without docker and it works. It's a pity that it doesn't work with docker - that brings decisive advantages.

Now I can switch from node-red-contrib-openzwave to node-red-contrib-zwave-js.

Many thanks for the support!

Norman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants