# Nrpgio Python command not running

**URL:** https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943
**Category:** General
**Created:** [26 September 2019 10:41 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943 "2019-09-26T10:41:28Z")
**Posts on this page:** 19
**Page:** 2

<div class="post-metadata">

### Author: ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)
#### Post date: [26 September 2019 13:25 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/21 "2019-09-26T13:25:48Z")

</div>

Not sure if this is relevant, but I have noticed that the error displayed in node red shows "nrpgio" and the python script is "nrgpio.py".

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0a25831d65c761d4f9f438e4f08da9038989bf5a.png)

I assume that this is just a spelling mistake in the error message, but I thought I should point it out.

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [26 September 2019 13:30 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/22 "2019-09-26T13:30:07Z")

</div>

No, the output you got is exactly what it should give you following the node-red code. This command is used internally by the node to do whatever it should do.

> [@GregorR1](#):
>
> Edit: Is this because I'm running it without providing the parameters that node-red would?

so yes, this is expected behaviour...

> [@GregorR1](#):
>
> Not sure if this is relevant, but I have noticed that the error displayed in node red shows "nrpgio" and the python script is "nrgpio.py".

unrelated. Not a spelling mistake either. `rpi-gpio out` simply means that the rpi-gpio output node was running while sending htat message, `nrgpio python command not running` is referencing the error message that is given, where `nrgpio` is the name of the script you ran in the previous post.

---

<div class="post-metadata">

### Author: ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)
#### Post date: [26 September 2019 13:32 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/23 "2019-09-26T13:32:36Z")

</div>

hi afelix,

The output is reading nrpgio - as in pgio rather than gpio. I think I picked a bad screenshot as an example.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b4fe04cfb7bcf9b060a72d155f7e01ab580db4f0.png)

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [26 September 2019 13:37 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/24 "2019-09-26T13:37:41Z")

</div>

No you did not pick a bad screenshot as example 🙂 It's a typo bug in the node itself: [https://github.com/node-red/node-red-nodes/blob/8d5ec9b3f6a456fe8bf189dbada9a0a30eb20384/hardware/PiGpio/locales/en-US/36-rpi-gpio.json#L71](https://github.com/node-red/node-red-nodes/blob/8d5ec9b3f6a456fe8bf189dbada9a0a30eb20384/hardware/PiGpio/locales/en-US/36-rpi-gpio.json#L71)  
That line defines the error message to be displayed in the log output.  
Here's the code that throws the error: [https://github.com/node-red/node-red-nodes/blob/8d5ec9b3f6a456fe8bf189dbada9a0a30eb20384/hardware/PiGpio/36-rpi-gpio.js#L145](https://github.com/node-red/node-red-nodes/blob/8d5ec9b3f6a456fe8bf189dbada9a0a30eb20384/hardware/PiGpio/36-rpi-gpio.js#L145)  
If you look carefully you see it first does `node.error`, which outputs that message to the error log/debug window. Next it calls `node.status`, which is setting the message to the status (node), which corresponds to a message without a typo. Again, super minor issue as it is text-only in an error message, but still is one.

* * *
I can't believe I haven't asked this yet, but can you post your flow that causes this error? I wonder if the GPIO node is configured correctly. Please follow the instructions here on how to post your code: https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506

---

<div class="post-metadata">

### Author: ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)
#### Post date: [26 September 2019 13:40 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/25 "2019-09-26T13:40:10Z")

</div>

Ahh right okay - as long as it was just a typo.

Here is my flow:

```auto
[{"id":"2968f5ec.06947a","type":"inject","z":"a332f9fb.e84ee8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":230,"y":160,"wires":[["41c9cc96.ab98f4"]]},{"id":"41c9cc96.ab98f4","type":"trigger","z":"a332f9fb.e84ee8","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"1","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":400,"y":160,"wires":[["21310221.7b3afe"]]},{"id":"21310221.7b3afe","type":"rpi-gpio out","z":"a332f9fb.e84ee8","name":"","pin":"40","set":"","level":"0","freq":"","out":"out","x":600,"y":160,"wires":[]}]

```

As you can see it is just a super simple flow to try and test that my GitHub to Balena was pushing correctly.

---

<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: [26 September 2019 19:24 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/26 "2019-09-26T19:24:25Z")

</div>

(good spot - I will fix the spelling in the error message)

---

<div class="post-metadata">

### Author: ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)
#### Post date: [27 September 2019 08:39 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/27 "2019-09-27T08:39:15Z")

</div>

After having a trawl through some other threads I found this command suggested by @dceejay on this post [Rpi-gpio input node "stopped"](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/25)

```auto
sudo apt-get install rpi.gpio

```

This appears to have solved the issue and the pin is now working as it should. Thank you to everyone for your help. Would have been lost on my own!

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [27 September 2019 09:53 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/28 "2019-09-27T09:53:44Z")

</div>

Personally, I would be a lot more satisfied in knowing _why_ this caused it to work again. Because

> [@afelix](#):
>
> `python /usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/hardware/nrgpio.py`

that command should have given an error if there were problems with the `rpi.gpio` package. This is going to keep my mind occupied at night randomly every few months I bet 😛 But that's a "me" kind of problem. I'm glad this solved it for you.

---

<div class="post-metadata">

### Author: ![GregorR1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorr1/32/12263_2.png) [@GregorR1](https://discourse.nodered.org/u/GregorR1)
#### Post date: [27 September 2019 10:05 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/29 "2019-09-27T10:05:30Z")

</div>

Yeah it's a weird one - not sure why it stopped working in the first place. Thanks again for your help!

---

<div class="post-metadata">

### Author: ![Jamos1988](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jamos1988/32/34562_2.png) [@Jamos1988](https://discourse.nodered.org/u/Jamos1988)
#### Post date: [21 January 2021 12:16 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/30 "2021-01-21T12:16:39Z")

</div>

> [@afelix](#):
>
> /usr/lib/node\_modules/node-red/node\_modules/@node-red/nodes/core/hardware/nrgpio.py

Sorry! Realize this post is older. But this didn't fix it for me. I am running on a Raspberry compute module (CM3). I've followed all instructions here, but my pins are still in stopped status. I hope you can still support.

Here is my flow:

```auto
[{"id":"c802d97a.995758","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8da05ed4.9f81f","type":"rpi-gpio out","z":"c802d97a.995758","name":"","pin":"11","set":true,"level":"0","freq":"","out":"out","x":440,"y":80,"wires":[]},{"id":"81c1cd7c.62e9d","type":"rpi-gpio out","z":"c802d97a.995758","name":"","pin":"12","set":true,"level":"0","freq":"","out":"out","x":440,"y":132,"wires":[]},{"id":"e93b7190.f6715","type":"rpi-gpio out","z":"c802d97a.995758","name":"","pin":"13","set":true,"level":"0","freq":"","out":"out","x":440,"y":182,"wires":[]},{"id":"7a2b0e26.28e2","type":"rpi-gpio out","z":"c802d97a.995758","name":"","pin":"15","set":true,"level":"0","freq":"","out":"out","x":440,"y":234,"wires":[]},{"id":"1fcb30e2.36d20f","type":"ui_switch","z":"c802d97a.995758","name":"","label":"switch","tooltip":"","group":"ccbcb301.5f66f","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":150,"y":80,"wires":[["8da05ed4.9f81f"]]},{"id":"4b728ee9.6ee97","type":"ui_switch","z":"c802d97a.995758","name":"","label":"switch","tooltip":"","group":"ccbcb301.5f66f","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":150,"y":120,"wires":[["81c1cd7c.62e9d"]]},{"id":"4fa3548e.82336c","type":"ui_switch","z":"c802d97a.995758","name":"","label":"switch","tooltip":"","group":"ccbcb301.5f66f","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":150,"y":160,"wires":[["e93b7190.f6715"]]},{"id":"4ce80f4.859d6f","type":"ui_switch","z":"c802d97a.995758","name":"","label":"switch","tooltip":"","group":"ccbcb301.5f66f","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"str","onicon":"","oncolor":"","offvalue":"false","offvalueType":"str","officon":"","offcolor":"","x":150,"y":200,"wires":[["7a2b0e26.28e2"]]},{"id":"ccbcb301.5f66f","type":"ui_group","name":"Dashboard","tab":"8715a7c2.f768b8","order":1,"disp":true,"width":"6","collapse":false},{"id":"8715a7c2.f768b8","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![alexsp](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@alexsp](https://discourse.nodered.org/u/alexsp)
#### Post date: [21 January 2021 17:11 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/31 "2021-01-21T17:11:58Z")

</div>

Try to change the board numbering to BCM

In /home/pi/.node-red/node\_modules/node-red-node-pi-gpio/nrgpio.py file change line 34 to GPIO.setmode(GPIO.BCM)

---

<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: [9 February 2021 12:21 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/32 "2021-02-09T12:21:40Z")

</div>

Hi All - I have changed the basic GPIO nodes t now use BCM rather than Pins - I haven't yet pushed it to the library as I think it needs testing first... you can install in manually by changing to your user directory eg

```auto
cd ~/.node-red
npm i node-red-node-pi-gpio@beta

```

You can now either use the usual pin selector picture - but the pin field beneath is now the BCM GPIO number - and you can enter than manually if desired and it should now work ok with cm3 modules etc...

But as I said - I don't have one to test so please try it and give me feedback...

Many thanks

---

<div class="post-metadata">

### Author: ![awasen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/awasen/32/596_2.png) [@awasen](https://discourse.nodered.org/u/awasen)
#### Post date: [18 October 2022 14:37 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/33 "2022-10-18T14:37:21Z")

</div>

Old thread, but figured to try anyway...

With the shortage of Raspberry PI units I figured to try a BananaPI (which feels like a mistake this far)...

I've gotten everything running except for the GPIO where I meet this exact error, `nrgpio python command not running`.

Python version is 2.7 and all the packages/modules referenced/linked seems to be installed.

BananaPI is supposed to be fully compatible over GPIO with all the RPi accessories...

Just figured if anyone has a clue... 🙂

---

<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: [18 October 2022 14:47 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/34 "2022-10-18T14:47:23Z")

</div>

The NR GPIO code uses a python library called RPi.GPIO to do the heavy lifting

When trying to use non-Pi hardware you normally need to hack your installation and replace references to RPi.GPIO with the replacement python GPIO library that comes with the OS for your device

On a standard pi install the file that need modifying is  
/home/pi/.node-red\node\_modules\node-red-node-pi-gpio\nrgpio.py

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/88f63a7c0fcc626a13f2680cc86b4bcefd7971dc.png)

---

<div class="post-metadata">

### Author: ![nico25](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@nico25](https://discourse.nodered.org/u/nico25)
#### Post date: [2 February 2023 11:52 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/35 "2023-02-02T11:52:33Z")

</div>

I am stuck with the same problem right now. Did you find a solution for that?  
I tried to install a modified library [http://wiki.lemaker.org/BananaPro/Pi:GPIO\_library](http://wiki.lemaker.org/BananaPro/Pi:GPIO_library) and afterwards adjusted nrgpio.py, but still no success.

---

<div class="post-metadata">

### Author: ![VVorttexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vvorttexx/32/62463_2.png) [@VVorttexx](https://discourse.nodered.org/u/VVorttexx)
#### Post date: [27 October 2024 04:38 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/36 "2024-10-27T04:38:52Z")

</div>

hello, I'm desperate...  
i also have a "nrgpio python command not running"  
following an update and I can't find where it comes from,  
i tried what this post says, but no resolution.  
pi@raspberrypi:~/node\_modules $ python --version  
Python 3.9.2

```auto
Welcome to Node-RED
===================
27 Oct 05:36:59 - [info] Node-RED version: v4.0.5
27 Oct 05:36:59 - [info] Node.js version: v20.18.0
27 Oct 05:36:59 - [info] Linux 6.6.58-v8+ arm64 LE
27 Oct 05:37:00 - [info] Loading palette nodes
27 Oct 05:37:02 - [info] Dashboard version 3.6.5 started at /ui
27 Oct 05:37:03 - [info] Settings file : /home/pi/.node-red/settings.js
27 Oct 05:37:03 - [info] Context store : 'default' [module=memory]
27 Oct 05:37:03 - [info] User directory : /home/pi/.node-red
27 Oct 05:37:03 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Oct 05:37:03 - [info] Flows file : /home/pi/.node-red/flows.json
27 Oct 05:37:03 - [info] Server now running at http://127.0.0.1:1880/
27 Oct 05:37:03 - [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.
---------------------------------------------------------------------
27 Oct 05:37:03 - [info] Starting flows
27 Oct 05:37:05 - [info] Started flows
27 Oct 05:37:05 - [info] [tcp in:404bf9f680a32e7c] listening on port 1885
27 Oct 05:37:05 - [info] [mqtt-broker:Mostiquitto] Connected to broker: 16@mqtt://localhost:1883
27 Oct 05:38:29 - [error] [rpi-gpio out:RLY1] nrgpio python command not running

```

[IOcontrol.json](https://discourse.nodered.org/uploads/short-url/alRouCUJyLw7KAVotBTeGyBe1HE.json) (56.2 KB)

---

<div class="post-metadata">

### Author: ![VVorttexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vvorttexx/32/62463_2.png) [@VVorttexx](https://discourse.nodered.org/u/VVorttexx)
#### Post date: [28 October 2024 19:23 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/37 "2024-10-28T19:23:27Z")

</div>

really disappointed, no logs, no info, nothing that changes even after reinstalling....the nodes remain stopped or not running. The other flows are running. I don't know if python or RPi.gpio is the culprit.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a80bd50a1408783261c5b63164114867b16e8ae0.png)

---

<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: [29 October 2024 14:25 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/38 "2024-10-29T14:25:43Z")

</div>

I don't know much about the subject, but will try to help.

Start by running  
`sudo apt update && sudo apt full-upgrade`  
to make sure your system is all up to date.

What OS version are you using (bookworm, for example)?

> [@VVorttexx](#):
>
> i also have a "nrgpio python command not running"  
> following an update

What did you update?

---

<div class="post-metadata">

### Author: ![VVorttexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vvorttexx/32/62463_2.png) [@VVorttexx](https://discourse.nodered.org/u/VVorttexx)
#### Post date: [29 October 2024 15:17 UTC](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943/39 "2024-10-29T15:17:12Z")

</div>

hello Collin, thanks, I changed my approach I deleted  
node-red-node-pi-gpio to install node-red-node-pi-gpiod  
I think I had a problem with nrgpio.py, which I can't find anywhere.  
It's him who puts the unusable nodes.  
but I gave up the idea of ​​putting RPi-GPIO back.  
in any case thanks.

[Previous page](https://discourse.nodered.org/t/nrpgio-python-command-not-running/15943.md?page=1)
