Hello I am running home assistant on a container on jetson nano.
I am trying to run a serial node as I have a device that is using simple serial commandes I am trying to use node-red-node-serialport 1.0.1 (node-red-node-serialport)
When I try to run the node red I get a error log like this
Welcome to Node-RED
31 May 16:52:39 - [info] Node-RED version: v2.2.2
31 May 16:52:39 - [info] Node.js version: v16.14.2
31 May 16:52:39 - [info] Linux 4.9.253-tegra arm64 LE
31 May 16:52:41 - [info] Loading palette nodes
31 May 16:52:49 - [info] Dashboard version 3.1.6 started at /endpoint/ui
Traceback (most recent call last):
File "/opt/node_modules/node-red-node-pi-gpio/testgpio.py", line 3, in
import RPi.GPIO as GPIO
File "/usr/lib/python3.9/site-packages/RPi/GPIO/init.py", line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
31 May 16:52:50 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
31 May 16:52:51 - [info] Settings file : /etc/node-red/config.js
31 May 16:52:51 - [info] Context store : 'default' [module=memory]
31 May 16:52:51 - [info] User directory : /config/node-red/
31 May 16:52:51 - [warn] Projects disabled : editorTheme.projects.enabled=false
31 May 16:52:51 - [info] Flows file : /config/node-red/flows.json
31 May 16:52:51 - [info] Server now running at http://127.0.0.1:46836/
31 May 16:52:51 - [info] Starting flows
[16:52:52] INFO: Starting Node-RED...
node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
31 May 16:52:56 - [info]
Welcome to Node-RED
OK, so firstly try removing the node-red-node-pi-gpio node to make sure that isn't causing problems. Also make sure that the user id that is running node-red has access to the serial ports. On most versions of Linux, I think if you add the user to the dialout group, that should work but do double check.
Also, since you are running node-red in a docker container, you might have to do some jiggery-pokery to permit the container to use the physical serial port (not sure if HA already sets this up - you will have to ask on the HA forums)
Here is how someone using docker would setup a container to access the physical serial port...
If that all seems too much, then ditch the HA Node-RED Addon version red and install node-red to the OS instead.
Well, as you can see, Node-RED is not reporting any errors. I would increase the logging level in settings.js to see if you can spot what is causing the restart.
If that doesn't show anything then I'm afraid that I think it is either a Docker or more likely, a home-assistant issue and you may need to ask on the HA forum unless someone else here knows. Personally I use neither HA nor Docker for Node-RED.