# Nrgpio python command not running

**URL:** <https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006>\
**Category:** General\
**Tags:** gpio\
**Created:** [5 August 2024 14:51 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006 "2024-08-05T14:51:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mima232](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mima232](https://discourse.nodered.org/u/mima232)\
**Post date:** [5 August 2024 14:51 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/1 "2024-08-05T14:51:06Z")

</div>

Hello,  
I wanted to update my systems from the legacy Bullseye distro to the new Bookworm, however I've got this issue, which has some strange behaviour - when I use the gpio node, i get the error:  
**"nrgpio python command not running"**.  
The actual gpio sometimes changes its state, sometimes not. Tried both the 32 bit and 64 bit versions of system, but same result. When I use legacy Bullseye, it works. Probably it has something to do with the gpio changes in Bookworm, but I'm surprised, that I did not find anyone else with this issue yet.

tested on fresh updated installation:  
NR: 4.0.2  
node.js: 20.16.0  
npm: 10.8.2  
latest Raspbian Bookworm

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 August 2024 15:04 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/2 "2024-08-05T15:04:12Z")

</div>

There have been quite a few posts over gpio issues.

I've not tried it but

> **[@iiot2k/node-red-gpiox](https://flows.nodered.org/node/@iiot2k/node-red-gpiox)**
>
> Node-RED nodes for Raspberry Pi gpio

says it works with Bookworm

---

<div class="post-metadata">

**Author:** ![mima232](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mima232](https://discourse.nodered.org/u/mima232)\
**Post date:** [7 August 2024 07:28 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/3 "2024-08-07T07:28:23Z")

</div>

Thank you, I will definitely consider using this nodes.  
But it would be much easier to stay with the current nodes ... so I am interested if this problem is only on my side, or if it is a bug in node, which happens to other users.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [7 August 2024 07:34 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/4 "2024-08-07T07:34:00Z")

</div>

Everybody has the same problems.  
It's due to changes by Raspberry Pi

---

<div class="post-metadata">

**Author:** ![mima232](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mima232](https://discourse.nodered.org/u/mima232)\
**Post date:** [7 August 2024 07:50 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/5 "2024-08-07T07:50:08Z")

</div>

So should I raise an issue? I've not found an issue about it, but it is already half year since Bookworm release ... or does it mean that the official nodes are now deprecated and are not gonna be updated anymore?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [7 August 2024 08:27 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/6 "2024-08-07T08:27:36Z")

</div>

I suggest trying the alternative node I linked to and see how that works for you.

Not many people are using Pi5 with Bookworm and wanting to access GPIO

The core nodes work fine on all previous versions of Pi using Bullseye so that is what the vast majority are continuing to use

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 August 2024 08:43 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/7 "2024-08-07T08:43:03Z")

</div>

I thought that the bookworm issue had been addressed a little while ago by @dceejay.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [7 August 2024 08:44 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/8 "2024-08-07T08:44:56Z")

</div>

I don't have any recollection of that happening  
but I'm getting old now 🙂

---

<div class="post-metadata">

**Author:** ![mima232](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mima232](https://discourse.nodered.org/u/mima232)\
**Post date:** [7 August 2024 08:46 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/9 "2024-08-07T08:46:00Z")

</div>

I forgot to mention, that Im using RPi 4 ... should it work there?  
I will try the suggested nodes, but it will be harder to deploy to all machines that Im using.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 August 2024 09:34 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/10 "2024-08-07T09:34:28Z")

</div>

RPI4 should be ok. Have you run  
`sudo apt update`  
`sudo apt full-upgrade`  
to make sure all installed s/w is up to date.

Did you run  
`sudo rpi-update`?  
Don't do that!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 August 2024 10:52 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/11 "2024-08-07T10:52:52Z")

</div>

> [@cymplecy](#):
>
> I don't have any recollection of that happening  
> but I'm getting old now 🙂

Same here. In fact you are right, it is the problems with the Pi5 that I was thinking of. There should not be issues with a 4 with Bookworm.

@mima232 also check in Manage Palette that all your nodes are at the latest version, and update any that are not up to date.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [7 August 2024 10:58 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/12 "2024-08-07T10:58:49Z")

</div>

I believe that it's Bookworm that is the problem as it was the OS that introduced the fundamental changes to the way the gpio pins work

AFAIK, you have to run Bookworm on the Pi5 but if you run any other Pi under Bullseye (or older) then that will work

This is what I think - not fully tested

> [@mima232](#):
>
> I forgot to mention, that Im using RPi 4 ... should it work there?

If you downgrade the OS to Bullseye, then the standard gpio nodes should work

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 August 2024 11:09 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/13 "2024-08-07T11:09:42Z")

</div>

> [@cymplecy](#):
>
> I believe that it's Bookworm that is the problem as it was the OS that introduced the fundamental changes to the way the gpio pins work

I am sure I saw a thread that said that it was ok on a pi4, but I can't find that now, so you are very likely correct. I haven't got a spare pi to play with at the moment, so can't easily test it.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 August 2024 11:21 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/14 "2024-08-07T11:21:19Z")

</div>

Indeed I’m old enough that I can’t remember what conclusion I came to ! ISTR that it can be made to work as there was an lgpio library that made it backwards compatible but that wasn’t available (or needed) on earlier versions so trying to fix it for one would break all the others etc unless you started doing ugly “if this hardware then” hacks.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 August 2024 12:50 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/15 "2024-08-07T12:50:42Z")

</div>

Do you believe that bookworm on a pi4 should be ok?

---

<div class="post-metadata">

**Author:** ![mima232](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mima232](https://discourse.nodered.org/u/mima232)\
**Post date:** [7 August 2024 14:03 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/16 "2024-08-07T14:03:08Z")

</div>

Yes, the system I've tested on is freshly installed, nevertheless I just did the update and full-upgrade, but nothing changed. I did NOT the rpi-update.  
Due to fresh install, the node should be at latest version, I've checked the Manage Palette and it is at the latest 2.0.6 version.  
Strange thing is, that the node sometimes work, sometimes not, and it still prints that error message.

Yes, I could use the Bullseye distro ... I am using it at all my stations now, but there was a requirement for update ... do you know how long will be Bullseye supported?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 August 2024 14:38 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/17 "2024-08-07T14:38:47Z")

</div>

> [@mima232](#):
>
> do you know how long will be Bullseye supported

I don't think legacy versions are supported at all, though I may be wrong.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [7 August 2024 14:49 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/18 "2024-08-07T14:49:12Z")

</div>

> [@mima232](#):
>
> i get the error:  
> **"nrgpio python command not running"**.

This may be a foolish question but what exactly is the nrgpio python command?

Is it part of the OS or installed with the Node-red Pi nodes?

---

<div class="post-metadata">

**Author:** ![mima232](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mima232](https://discourse.nodered.org/u/mima232)\
**Post date:** [7 August 2024 14:56 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/19 "2024-08-07T14:56:25Z")

</div>

Node page says:  
A set of Node-RED nodes to interact with Pi GPIO using the RPi.GPIO python library that is part of Raspbian.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [7 August 2024 15:22 UTC](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006/20 "2024-08-07T15:22:24Z")

</div>

OK I found nrgpio.py at https://github.com/node-red/node-red-nodes/blob/master/hardware/PiGpio/nrgpio.py  
It has

```auto
# Import library functions we need
import RPi.GPIO as GPIO

```

According to  
[https://forums.raspberrypi.com/viewtopic.php?p=2160578](https://forums.raspberrypi.com/viewtopic.php?p=2160578), the rpi-lgpio library is a drop-in replacement for rpi.gpio and allows code that imports RPi.GPIO to work.

They say to install it thus

```auto
sudo apt remove python3-rpi.gpio
pip3 install rpi-lgpio

```

but I found (on a Pi 4 running Bookworm) that python3-rpi.gpio is not installed and I had to  
`sudo apt install python3-rpi-lgpio`

Unfortunately I have nothing to plug in to the GPIO pins so I can't test if this works for Node-red. I expect other people have already tested this?

Does the Node-red install script go ahead and install the RPi nodes even if this library is not available? Should it check?

[Next page](https://discourse.nodered.org/t/nrgpio-python-command-not-running/90006.md?page=2)
