Node-RED Addon not detecting is a Raspberry system

Hello guys.

I have read on this forum about some issue when trying start Node-RED Addon with RPi.GPIO library.
But not have success.

The NodeRed Addon Log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 10.2.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.12.3
 Home Assistant Supervisor: 2021.12.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing... 
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
up to date, audited 1 package in 2s
found 0 vulnerabilities
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[06:51:48] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
18 Dec 06:51:52 - [info] 
Welcome to Node-RED
===================
18 Dec 06:51:52 - [info] Node-RED version: v2.1.4
18 Dec 06:51:52 - [info] Node.js  version: v16.13.1
18 Dec 06:51:52 - [info] Linux 5.10.0-9-arm64 arm64 LE
18 Dec 06:51:54 - [info] Loading palette nodes
18 Dec 06:52:01 - [info] Dashboard version 3.1.2 started at /endpoint/ui
Traceback (most recent call last):
  File "/opt/node_modules/node-red-node-pi-gpio/testgpio.py", line 3, in <module>
    import RPi.GPIO as GPIO
  File "/usr/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
18 Dec 06:52:03 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
18 Dec 06:52:03 - [info] Settings file  : /etc/node-red/config.js
18 Dec 06:52:03 - [info] Context store  : 'default' [module=memory]
18 Dec 06:52:03 - [info] User directory : /config/node-red/
18 Dec 06:52:03 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Dec 06:52:03 - [info] Flows file     : /config/node-red/flows.json
18 Dec 06:52:03 - [info] Server now running at http://127.0.0.1:46836/
18 Dec 06:52:03 - [info] Starting flows
18 Dec 06:52:03 - [info] Started flows
[06:52:03] INFO: Starting NGinx...
18 Dec 06:52:08 - [info] [server:Home Assistant] Connecting to undefined
18 Dec 06:52:08 - [info] [server:Home Assistant] Connected to undefined

My Rpi4 System:

~# uname -a
Linux FIFUrpi 5.10.0-9-arm64 #1 SMP Debian 5.10.70-1 (2021-09-30) aarch64 GNU/Linux

~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

I have rpi-gpio packets installed… :\

should be an Addon/Core issue, or a RPi.GPIO library issue?

I am having this same problem on a system that is not a raspberry-pi, and I didn’t added such library. Seems it is there by default. Is a bug?

Can I say. If I disable gpio pallet nodes (node-red-node-pi-gpio 2.0.1) from Pallet. Of corse will not return any error

 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 10.2.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.12.3
 Home Assistant Supervisor: 2021.12.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing... 
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
up to date, audited 1 package in 1s
found 0 vulnerabilities
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[13:58:09] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
18 Dec 13:58:12 - [info] 
Welcome to Node-RED
===================
18 Dec 13:58:12 - [info] Node-RED version: v2.1.4
18 Dec 13:58:12 - [info] Node.js  version: v16.13.1
18 Dec 13:58:12 - [info] Linux 5.10.0-9-arm64 arm64 LE
18 Dec 13:58:13 - [info] Loading palette nodes
18 Dec 13:58:18 - [info] Dashboard version 3.1.2 started at /endpoint/ui
BAIL ON node-red-node-pi-gpio/rpi-gpio
18 Dec 13:58:19 - [info] Settings file  : /etc/node-red/config.js
18 Dec 13:58:19 - [info] Context store  : 'default' [module=memory]
18 Dec 13:58:19 - [info] User directory : /config/node-red/
18 Dec 13:58:19 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Dec 13:58:19 - [info] Flows file     : /config/node-red/flows.json
18 Dec 13:58:19 - [info] Server now running at http://127.0.0.1:46836/
18 Dec 13:58:19 - [info] Starting flows
18 Dec 13:58:19 - [info] Started flows
[13:58:19] INFO: Starting NGinx...
18 Dec 13:58:24 - [info] [server:Home Assistant] Connecting to undefined
18 Dec 13:58:24 - [info] [server:Home Assistant] Connected to undefined

Try adding it to your config on the addon page

npm_packages:
  - node-red-node-pi-gpio

Thank you for your answer.

That returns

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 10.2.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.12.3
 Home Assistant Supervisor: 2021.12.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing... 
[09:10:02] INFO: Starting installation of custom NPM/Node-RED packages...
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=10 <15' },
npm WARN EBADENGINE   current: { node: 'v16.13.1', npm: '8.1.3' }
npm WARN EBADENGINE }
up to date, audited 690 packages in 9s
88 packages are looking for funding
  run `npm fund` for details
9 vulnerabilities (4 moderate, 5 high)
To address issues that do not require attention, run:
  npm audit fix
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
up to date, audited 1 package in 1s
found 0 vulnerabilities
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[09:10:16] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
19 Dec 09:10:19 - [info] 
Welcome to Node-RED
===================
19 Dec 09:10:19 - [info] Node-RED version: v2.1.4
19 Dec 09:10:19 - [info] Node.js  version: v16.13.1
19 Dec 09:10:19 - [info] Linux 5.10.0-9-arm64 arm64 LE
19 Dec 09:10:20 - [info] Loading palette nodes
19 Dec 09:10:25 - [info] Dashboard version 3.1.2 started at /endpoint/ui
Traceback (most recent call last):
  File "/opt/node_modules/node-red-node-pi-gpio/testgpio.py", line 3, in <module>
    import RPi.GPIO as GPIO
  File "/usr/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
19 Dec 09:10:26 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
19 Dec 09:10:26 - [info] Settings file  : /etc/node-red/config.js
19 Dec 09:10:26 - [info] Context store  : 'default' [module=memory]
19 Dec 09:10:26 - [info] User directory : /config/node-red/
19 Dec 09:10:26 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Dec 09:10:26 - [info] Flows file     : /config/node-red/flows.json
19 Dec 09:10:26 - [info] Server now running at http://127.0.0.1:46836/
19 Dec 09:10:26 - [info] Starting flows
[09:10:26] INFO: Starting NGinx...
19 Dec 09:10:26 - [info] Started flows
19 Dec 09:10:31 - [info] [server:Home Assistant] Connecting to undefined
19 Dec 09:10:31 - [info] [server:Home Assistant] Connected to undefined

Where I should run the suggested commands? :expressionless:

After some searching, gpio does not work with the addon. Gpio’s have to be set up through home assistant, then you can use service calls from nodered to control them.

Thank you for answer, but i am a newbie on this, how can i do that? some tips?

Dependent on which device you would look for it by name either in integrations or the forum.

Like one wire sensors or i2c sensors. It’s kinda limited.

If you dont find a match, esphome is the do it yourself platform in HA. It runs on cheap esp micro controllers ~$5 and supports a wide range of sensors.

Understand. enabling I2C. I have enabled before.

~# i2cdetect -l
i2c-3   i2c             bcm2835 (i2c@7e804000)                  I2C adapter
i2c-1   i2c             Broadcom STB :                          I2C adapter
i2c-2   i2c             bcm2835 (i2c@7e205000)                  I2C adapter
i2c-0   i2c             Broadcom STB :                          I2C adapter