# Rpi-gpio input node "stopped"

**URL:** <https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184>\
**Category:** General\
**Created:** [25 November 2018 18:22 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184 "2018-11-25T18:22:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![r0drunner](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@r0drunner](https://discourse.nodered.org/u/r0drunner)\
**Post date:** [25 November 2018 18:22 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/1 "2018-11-25T18:22:58Z")

</div>

I'm trying to follow the [Rapsberrypi.org](http://Rapsberrypi.org) guide "[getting started with Node-RED](https://projects.raspberrypi.org/en/projects/getting-started-with-node-red)"

I completed very easily the first flow for switching on/off a LED with a rpi-gpio out node and two inject nodes, but I got stuck adding a button with a rpi-gpio in node to control the LED. This is step 11 in the above-mentioned getting started guide.

The button shows as "stopped" and does not change its state after pressing it  
 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/548754e6ef6883f479cd97263e9926ceba9f3169.png)

I have a RPi2 Model B with the following raspbian and node-red versions:

```
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

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

25 Nov 17:24:58 - [info] Node-RED version: v0.19.4
25 Nov 17:24:58 - [info] Node.js version: v8.11.1
25 Nov 17:24:58 - [info] Linux 4.9.41-v7+ arm LE

```

For the rpio-gpio in node (that's the node for my press button) I have the same properties as in the tutorial, one pin connected to **GPI04-7** (with pullup resistor) and the other one to GND. That should mean that GPIO pin 4 will be set to HIGH, and pressing the button will cause it to go LOW.

I've also added a debug node to check if the payload changes from 1 to 0 but I only get this first message (this "1" is due to the pullup resistor and the checkbox "Read initial state of pin on deploy/restart" being marked in the settings):

```
11/25/2018, 10:30:52 AMnode: f5cc3952.9c7f58
pi/7 : msg.payload : number
1

```

But after that, the flow diagram shows the button as "stopped" and nothing happens when I press the button.I've double-checked the wiring and it's identical to the one in the tutorial.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [25 November 2018 21:16 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/2 "2018-11-25T21:16:42Z")

</div>

Are there any messages printed to the window where you copied the “welcome to node-red” message from?

---

<div class="post-metadata">

**Author:** ![r0drunner](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@r0drunner](https://discourse.nodered.org/u/r0drunner)\
**Post date:** [26 November 2018 01:28 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/3 "2018-11-26T01:28:32Z")

</div>

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
```

---

<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:** [26 November 2018 06:52 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/4 "2018-11-26T06:52:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [26 November 2018 09:28 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/5 "2018-11-26T09:28:37Z")

</div>

From the documentation, have you tried:

```auto
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

```auto
sudo adduser $USER gpio

```

---

<div class="post-metadata">

**Author:** ![r0drunner](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@r0drunner](https://discourse.nodered.org/u/r0drunner)\
**Post date:** [26 November 2018 17:23 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/6 "2018-11-26T17:23:08Z")

</div>

Yes! it works with BCM21  
Why is that?

---

<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:** [26 November 2018 17:25 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/7 "2018-11-26T17:25:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![r0drunner](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@r0drunner](https://discourse.nodered.org/u/r0drunner)\
**Post date:** [26 November 2018 17:28 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/8 "2018-11-26T17:28:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![r0drunner](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@r0drunner](https://discourse.nodered.org/u/r0drunner)\
**Post date:** [26 November 2018 17:38 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/9 "2018-11-26T17:38:23Z")

</div>

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.

---

<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:** [26 November 2018 17:39 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/10 "2018-11-26T17:39:04Z")

</div>

> [@r0drunner](#):
>
> Yes! it works with BCM21  
> Why is that?

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.

---

<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:** [26 November 2018 21:15 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/12 "2018-11-26T21:15:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [10 July 2019 15:28 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/13 "2019-07-10T15:28:09Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 July 2019 16:14 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/14 "2019-07-10T16:14:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [10 July 2019 16:47 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/15 "2019-07-10T16:47:56Z")

</div>

Raspbian 4.19.42  
Node-Red 0.20.7  
node.js 10.16.0

I'm tring to test a very simple flow:

```auto
[{"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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5043c780ddcbef451ef9156c857f781a9e606e0a.png)

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 July 2019 21:30 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/16 "2019-07-10T21:30:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [11 July 2019 04:43 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/17 "2019-07-11T04:43:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [11 July 2019 06:30 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/18 "2019-07-11T06:30:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [11 July 2019 08:19 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/19 "2019-07-11T08:19:44Z")

</div>

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?

---

<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:** [11 July 2019 08:22 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/20 "2019-07-11T08:22:58Z")

</div>

the console log shown in the terminal window

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [11 July 2019 09:35 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/21 "2019-07-11T09:35:01Z")

</div>

```auto
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

```

[Next page](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184.md?page=2)
