We're running node-red in Docker, because we have an IoT scenario using K3S at hand (currently we're in the final stages of development) and need to be able to use K3S / Helm to update the node-red application running on our Raspi4B (64 bit, because we need a lot of supplemental services running as well, some of them not being available for 32 bit anymore) appliance, from devops / operations pov this is just another service.
However, when starting the docker image (we tried multiple versions) right when opening the serial port we get a segmentation fault. We do it correctly (--privileged, --group-add dialout, etc...) and made sure we also did the npm install serialport manually, with all kinds of versions (someone reported that using @7 before doing it again without version fixes it, we can't compile @7, though).
Is there any workaround for this problem? Any way we can get serial ports (which are crucial to hardware control in our case) working from inside a docker container?
Not using docker is not an acceptable solution for us because solution design and software management requires that everything that is running on the devices must be under K3S control.
24 Oct 11:54:26 - [info] Node-RED version: v3.0.2
24 Oct 11:54:26 - [info] Node.js version: v16.16.0
24 Oct 11:54:26 - [info] Linux 5.15.70-v7l+ arm LE
24 Oct 11:54:28 - [info] Loading palette nodes
24 Oct 11:54:29 - [info] Settings file : /data/settings.js
24 Oct 11:54:29 - [info] Context store : 'default' [module=memory]
24 Oct 11:54:29 - [info] User directory : /data
24 Oct 11:54:29 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Oct 11:54:29 - [info] Flows file : /data/flows.json
24 Oct 11:54:29 - [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.
24 Oct 11:54:29 - [warn] Encrypted credentials not found
24 Oct 11:54:29 - [info] Server now running at http://127.0.0.1:1880/
24 Oct 11:54:29 - [info] Starting flows
Segmentation fault (core dumped)
More info:
bash-5.1$ node --version
v16.16.0
bash-5.1$ npm --version
8.11.0
We're running a Raspi4 with 8 GB of RAM, 16 GB SD card and a USB-to-RS485 converter cable. Version of OS is the official 64 bit image from the RPi foundation.