node-red: Node-RED (Docker) crashes when /dev/ttyACM0 is configured in flow - Raspberry Pi 4
Current Behavior
Node-RED crashes during startup and/or deployment with no details or log (log level trace)
27 Feb 22:50:49 - [info]
Welcome to Node-RED
===================
27 Feb 22:50:49 - [info] Node-RED version: v2.2.2
27 Feb 22:50:49 - [info] Node.js version: v14.18.2
27 Feb 22:50:49 - [info] Linux 5.10.92-v8+ arm64 LE
27 Feb 22:50:50 - [info] Loading palette nodes
27 Feb 22:50:50 - [debug] Module: node-red-dashboard 3.1.6 /data/node_modules/node-red-dashboard
27 Feb 22:50:50 - [debug] Module: node-red-node-serialport 1.0.1 /data/node_modules/node-red-node-serialport
27 Feb 22:50:51 - [info] Dashboard version 3.1.6 started at /ui
27 Feb 22:50:52 - [info] Settings file : /data/settings.js
27 Feb 22:50:52 - [info] Context store : 'default' [module=memory]
27 Feb 22:50:52 - [info] User directory : /data
27 Feb 22:50:52 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Feb 22:50:52 - [info] Flows file : /data/flows.json
27 Feb 22:50:52 - [info] Server now running at http://127.0.0.1:1880/
27 Feb 22:50:52 - [debug] loaded flow revision: 333da4663a7709aaa4ac6deaf3733db4
27 Feb 22:50:52 - [debug] red/runtime/nodes/credentials.load : no user key present
27 Feb 22:50:52 - [debug] red/runtime/nodes/credentials.load : using default key
27 Feb 22:50:52 - [debug] red/runtime/nodes/credentials.load : keyType=system
27 Feb 22:50:52 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
27 Feb 22:50:52 - [trace] runtime event: {"id":"runtime-state","retain":true}
27 Feb 22:50:52 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"333da4663a7709aaa4ac6deaf3733db4"},"retain":true}
27 Feb 22:50:52 - [info] Starting flows
27 Feb 22:50:52 - [debug] red/nodes/flows.start : starting flow : global
27 Feb 22:50:52 - [debug] red/nodes/flows.start : starting flow : f6f2187d.f17ca8
27 Feb 22:50:52 - [trace] [flow:global] start flow [global]
27 Feb 22:50:52 - [trace] [flow:global] ------------------|--------------|-----------------
27 Feb 22:50:52 - [trace] [flow:global] id | type | alias
27 Feb 22:50:52 - [trace] [flow:global] ------------------|--------------|-----------------
27 Feb 22:50:52 - [trace] [flow:global] c2b029082d2f328a | ui_base |
27 Feb 22:50:52 - [trace] [flow:global] daf5fb664ded84a4 | ui_tab |
27 Feb 22:50:52 - [trace] [flow:global] dca3bea54c493eb4 | ui_group |
27 Feb 22:50:52 - [trace] [flow:global] 5df552a8698cbe93 | ui_group |
27 Feb 22:50:52 - [trace] [flow:global] c2ab819cc6fb5f96 | ui_group |
27 Feb 22:50:52 - [trace] [flow:global] 28ef3f98b07f5827 | serial-port |
27 Feb 22:50:52 - [trace] [flow:global] ------------------|--------------|-----------------
27 Feb 22:50:52 - [trace] [flow:f6f2187d.f17ca8] start flow [f6f2187d.f17ca8]
27 Feb 22:50:52 - [debug] [inject:timestamp] repeat = 900000
27 Feb 22:50:52 - [trace] [flow:f6f2187d.f17ca8] ------------------|--------------|-----------------
27 Feb 22:50:52 - [trace] [flow:f6f2187d.f17ca8] id | type | alias
27 Feb 22:50:52 - [trace] [flow:f6f2187d.f17ca8] ------------------|--------------|-----------------
27 Feb 22:50:52 - [trace] [flow:f6f2187d.f17ca8] 4ed85eebb0a06cd1 | inject |
27 Feb 22:50:52 - [trace] [flow:f6f2187d.f17ca8] 33884147330d3569 | debug |
Here it just stops. It starts normally when I disconnect my device which is plugged in at /dev/ttyACM0 (Adruino)
This also happens when I disconnect my device, delete the flow, connect the device again and create and deploy the flow.
Expected Behavior
Node-RED not crashing and receiving data from /dev/ttyACM0
Steps To Reproduce
Raspberry Pi 4
Docker.io installed via apt and using nodered/node-red image.
Mounted the device either with -v /dev:/dev or --device /dev/ttyACM0:/dev/ttyACM0
Added /etc/udev/rules.d/99-serial.rules on host machine
KERNEL=="ttyACM[0-9]*",MODE="0666"
so the node-red user can read
Example flow
No response
Environment
- Node-RED version: latest nodered/node-red docker image
- Node.js version: latest nodered/node-red docker image
- npm version: latest nodered/node-red docker image
- Platform/OS: Linux raspberrypi 5.10.92-v8+ # 1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
- Browser: -
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (9 by maintainers)
OK, better fix that works with v1.0.1
Follow the same process as earlier but swap step 4 for
This looks to be a problem with the pre-complied binaries from the upstream serialport node.
thanks so much for this thread and the fix @hardillb - I’ve spent too long trying to figure this out and was just posting a long boring thread hoping to get help with this but I’ve not got it working!