Serial ports in docker node red

Hi,

Trying to access serial ports on a Raspberry Pi from node red in a docker container.
But the only thing that happens is that the docker container exits. Being a newbie when
it comes to docker, maybe I'm making some stupid mistakes. It works fine running node red directly
on the host RPi

This is what happens:

pi@raspberrypi:~ $ sudo docker run -it --rm --name NodeRed --device=/dev/ttyUSB0 -p 1881:1880 -v /home/pi/node-red-docker-storage/node-red:/data nodered/node-red

> node-red-docker@2.2.2 start /usr/src/node-red
> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"

24 Oct 11:56:30 - [info]

Welcome to Node-RED
===================

24 Oct 11:56:30 - [info] Node-RED version: v2.2.2
24 Oct 11:56:30 - [info] Node.js  version: v14.18.2
24 Oct 11:56:30 - [info] Linux 5.10.103-v7l+ arm LE
24 Oct 11:56:31 - [info] Loading palette nodes
24 Oct 11:56:32 - [info] Settings file  : /data/settings.js
24 Oct 11:56:32 - [info] Context store  : 'default' [module=memory]
24 Oct 11:56:32 - [info] User directory : /data
24 Oct 11:56:32 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Oct 11:56:32 - [info] Flows file     : /data/flows.json
24 Oct 11:56:32 - [info] Server now running at http://127.0.0.1:1880/
24 Oct 11:56:32 - [info] Starting flows
24 Oct 11:56:32 - [info] Started flows
<- Added serial port node, configured for /dev/ttyUSB0 and deploy.
24 Oct 11:56:54 - [info] Stopping flows
24 Oct 11:56:54 - [info] Stopped flows
24 Oct 11:56:54 - [info] Starting flows
24 Oct 11:56:54 - [info] Started flows
pi@raspberrypi:~ $                           <- Docker containter exits.

The only way to get into the container again is to start without --device.

Is this a node red or a docker question?
What I'm I doing wrong?

Very likely the same issue as this...

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.