# Raspberry Pi GPIO pull up or down

**URL:** <https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262>\
**Category:** General\
**Created:** [17 January 2021 12:34 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262 "2021-01-17T12:34:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brendonhatcher](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@brendonhatcher](https://discourse.nodered.org/u/brendonhatcher)\
**Post date:** [17 January 2021 12:34 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/1 "2021-01-17T12:34:14Z")

</div>

Hi

I have attached a momentary button to GPIO 10.  
The rpi-gpio in node has an option to set it as pull up or down.

I had a flow open in which the pin was set as pull up.  
I deployed it.  
Then I closed that flow, opened a new one as set it as pull down.  
A popup appeared telling me that the pin was already set as down.

I'm guessing the first flow set the Pi to use pull up for that pin.  
However, I don't really understand the full stack, and the relationship between flows and deployment.

If someone could nudge my understanding in the right direction, I would appreciate it.

Thanks  
Brendon

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [17 January 2021 13:01 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/2 "2021-01-17T13:01:49Z")

</div>

Understand it? No, but I have had the problem a couple of times and though it's been a while I seem to remember a full reboot resolved the issue. Have you tried that?

---

<div class="post-metadata">

**Author:** ![brendonhatcher](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@brendonhatcher](https://discourse.nodered.org/u/brendonhatcher)\
**Post date:** [17 January 2021 13:39 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/3 "2021-01-17T13:39:46Z")

</div>

Hi Gerry

I haven't, but that is what I suspected was happening. The first flow to run "initialises" the PIN state, and node-red then warns me when I try to change the already active state.

So, I just tried it, and the answer is no, rebooting made no difference.

Regards  
Brendon

---

<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:** [17 January 2021 14:01 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/4 "2021-01-17T14:01:45Z")

</div>

> [@brendonhatcher](#):
>
> Then I closed that flow, opened a new one

What _exactly_ do you mean by that? You can only have one GPIO node referencing a particular pin in the whole system.

**[Edit]** Actually I may be wrong there, perhaps you can have multiple referencing the same pin as input, I am not certain and not able to test at the moment. Perhaps the original one is still present in your flows file and is configured as pullup and now with a second one you are trying to change that config.

---

<div class="post-metadata">

**Author:** ![brendonhatcher](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@brendonhatcher](https://discourse.nodered.org/u/brendonhatcher)\
**Post date:** [17 January 2021 16:44 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/5 "2021-01-17T16:44:25Z")

</div>

So, I had a tab open on the screen, with a node that referenced GPIO 10 as pull x (up or down).  
Deployed  
I then opened a new tab and created a new flow, with the same node type, and GPIO 10 as x (same as in tab 1)  
I then went back to the first tab.  
Menu button / Flows / Delete to close the tab  
This took me back to tab 2  
Change the parameter to the opposite of what it was  
Got the warning popup  
Deployed without error  
Flow doesn't work - debug shows no output values

Hope that clarifies.

Thanks  
Brendon

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [17 January 2021 17:21 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/6 "2021-01-17T17:21:46Z")

</div>

So you are sure there are no other instances of calling that pin? Ive made that mistake. And after your last change and deploy you did a complete power down? If so I'm tapped out. In my meager knowledge fixed mine.

---

<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:** [17 January 2021 20:23 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/7 "2021-01-17T20:23:54Z")

</div>

> [@brendonhatcher](#):
>
> debug shows no output values

Did the debug output on that pin ever worked?

Does it now let you change the pullup/down or do you still get an error if you try to change it?

---

<div class="post-metadata">

**Author:** ![brendonhatcher](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@brendonhatcher](https://discourse.nodered.org/u/brendonhatcher)\
**Post date:** [20 January 2021 17:23 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/8 "2021-01-20T17:23:04Z")

</div>

I started a new flow  
I deleted all other flows  
Deployed

Added a GPIO in node  
Set it to GPIO10 with resistor set to none  
Deployed  
Watched the value bounce (below the node)

Tried to change the node to pullup  
Popup says that the node is already set to tri  
Clicked done  
Node shows the up arrow  
Value is still bouncing  
Edited the node  
Popup says that the node is already set to tri

Deploy  
Value no longer bounces, set at 1

Set to pulldown, popup says already pullup.

So, the pin is set to tri, up or down by deploying it, and remains that way (giving the popup warning) until you deploy again.

Solved! (I think)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 March 2021 17:23 UTC](https://discourse.nodered.org/t/raspberry-pi-gpio-pull-up-or-down/39262/9 "2021-03-21T17:23:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
