Rpi-gpio input node "stopped"

Nope. It only shows the server start messages and start/stop flow messages, but nothing happens when I press the button.

By the way, I should say that node-js was already installed in my raspbian version, I havent installed it myself.

I include the node-red console messages:

pi@raspberrypi:~ $ node-red
26 Nov 02:20:32 - [info] 

Welcome to Node-RED
===================

26 Nov 02:20:32 - [info] Node-RED version: v0.19.4
26 Nov 02:20:32 - [info] Node.js  version: v8.11.1
26 Nov 02:20:32 - [info] Linux 4.9.41-v7+ arm LE
26 Nov 02:20:38 - [info] Loading palette nodes
26 Nov 02:20:47 - [info] Settings file  : /home/pi/.node-red/settings.js
26 Nov 02:20:47 - [info] Context store  : 'default' [module=memory]
26 Nov 02:20:47 - [info] User directory : /home/pi/.node-red
26 Nov 02:20:47 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
26 Nov 02:20:47 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
26 Nov 02:20:47 - [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.
---------------------------------------------------------------------

26 Nov 02:20:47 - [info] Starting flows
26 Nov 02:20:48 - [info] Started flows
26 Nov 02:20:48 - [info] Server now running at http://127.0.0.1:1880/
26 Nov 02:23:11 - [info] Stopping flows
26 Nov 02:23:11 - [info] Stopped flows
26 Nov 02:23:11 - [info] Starting flows
26 Nov 02:23:11 - [info] Started flows

Does changing the pin to 40-GPIO21 make any difference?

1 Like

From the documentation, have you tried:

sudo apt-get update && sudo apt-get install python-rpi.gpio

Also, the user must be a member of the gpio group. To add the current user to the group

sudo adduser $USER gpio

Yes! it works with BCM21
Why is that?

It could be that something else is controlling access to pin7 (gpio4)

I'm working with pi user, which belongs to gpio group already.
I've installed node-red from scratch in another RasPi using the script:

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

But the button remained also "stopped". Trying with pin gpio21 instead of gpio04 worked, though.

Thanks! it works actually with any other GPIO pin except with GPIO04.(GPCLK0). Even the other two GPCLK pins (BCM5 & 6) work, but not GPIO04.
How could I check if there's something interfering with that pin? I have no other circuits connected to the RPi.

That pin is used for a clock output or something I think. If you have not disabled that use then it was still being acquired by that so you could not use it.

1 Like

Run raspi-config and check that 1-wire is disabled.

1 Like

Sorry guys! I've tried all the post above, but nothing... I'm stucked on "stopped" on every PIN I try to use.
Any help... please!

@naamah75

  1. what version of Raspbian?
  2. what version of NR and node.js?
  3. what is your flow?
  4. What gpio node are you ruing?
  5. have you added a catch node attached to a debug node to see if something shows up?
  6. is anything showing in the log?

Raspbian 4.19.42
Node-Red 0.20.7
node.js 10.16.0

I'm tring to test a very simple flow:

[{"id":"d4e89534.91d728","type":"debug","z":"a0828933.d7acb8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":160,"wires":[]},{"id":"8e6c472d.8a8608","type":"catch","z":"a0828933.d7acb8","name":"","scope":null,"uncaught":false,"x":240,"y":100,"wires":[["fd9db602.965038"]]},{"id":"fd9db602.965038","type":"debug","z":"a0828933.d7acb8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":100,"wires":[]},{"id":"864afcd8.23514","type":"rpi-gpio in","z":"a0828933.d7acb8","name":"","pin":"11","intype":"tri","debounce":"25","read":false,"x":230,"y":160,"wires":[["d4e89534.91d728"]]}]

image

I've no error or warn in the log.

Using command gpio read 0 I'm able to read the status of a wired pushbutton; so I'm sure that the hardware is working.

Is this running on a pi?
how do you have the button connected i.e. what pins are you using?

My hardware is a Pi 3B+
I've tried a lot of pins, and all of those I've tried it works with the command line gpio command but none with Node-Red.
The GPIO node is "stopped" and cannot acquire or write any pins.

Can you copy and paste the Node-RED startup log?

Do you mean the log that is shown on the terminal window during startup? or there's a log file? in this case where to find the file?

the console log shown in the terminal window

Welcome to Node-RED
===================
11 Jul 07:14:49 - [info] Node-RED version: v0.20.7
11 Jul 07:14:49 - [info] Node.js  version: v10.16.0
11 Jul 07:14:49 - [info] Linux 4.19.42-v7+ arm LE
11 Jul 07:14:53 - [info] Loading palette nodes
11 Jul 07:15:04 - [info] Settings file  : /home/pi/.node-red/settings.js
11 Jul 07:15:04 - [info] Context store  : 'default' [module=memory]
11 Jul 07:15:04 - [info] User directory : /home/pi/.node-red
11 Jul 07:15:04 - [warn] Projects disabled : editorTheme.projects.enabled=false
11 Jul 07:15:04 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
11 Jul 07:15:04 - [info] Failed to get version from Pi
11 Jul 07:15:04 - [info] Server now running at http://127.0.0.1:1880/
11 Jul 07:15:04 - [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.
---------------------------------------------------------------------
11 Jul 07:15:04 - [info] Starting flows
11 Jul 07:15:05 - [info] Started flows
11 Jul 11:34:04 - [info] Stopping modified flows
11 Jul 11:34:04 - [info] Stopped modified flows
11 Jul 11:34:04 - [info] Starting modified flows
11 Jul 11:34:04 - [info] Started modified flows

is the failure line... so can you at a command line do

cd /usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/hardware
./nrgpio info

@dceejay I guess you got the problem... this is the output of the command:

raceback (most recent call last):
  File "./nrgpio.py", line 17, in <module>
    import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'

In addition I've tried to use the node-red-contrib-camerapi node, and also in this case the node doesn't work.
So... I decided to install a new Rasbian on an a new SD card and then tried to use the GPIO and the camera and now all works.
Well, what I've broke on the original Rasbpian?