Nrpgio Python command not running

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

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

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.

so yes, this is expected behaviour...

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.

hi afelix,

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

image

No you did not pick a bad screenshot as example :slight_smile: 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
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
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

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

Here is my flow:

[{"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.

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

After having a trawl through some other threads I found this command suggested by @dceejay on this post Rpi-gpio input node "stopped"

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!

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

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 :stuck_out_tongue: But that's a "me" kind of problem. I'm glad this solved it for you.

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

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:

[{"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}]

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)

1 Like

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

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

2 Likes

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... :slight_smile:

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

1 Like

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 and afterwards adjusted nrgpio.py, but still no success.

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

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 (56.2 KB)

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.

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)?

What did you update?

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.

1 Like