# No response from rpi-gpio

**URL:** <https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393>\
**Category:** Hardware\
**Created:** [12 December 2020 10:24 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393 "2020-12-12T10:24:37Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 09:57 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/21 "2020-12-13T09:57:51Z")

</div>

Strange thing is that I can make the relay board work by using a python script. So its physically possible but nodered can't seem to get to the pins.

---

<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:** [13 December 2020 10:12 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/22 "2020-12-13T10:12:23Z")

</div>

When you attempt to set the output using the dashboard does the status value shown against the gpio node change between 0 and 1?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/e/fe58e3531a71e4a4548ca63cfea6af0350cb3cb3.png)

If not show use what the debug node displays.

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 11:19 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/23 "2020-12-13T11:19:04Z")

</div>

![Screen Shot 2020-12-13 at 12.16.42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a9ec11a6b879e0c58fea7c0d1c861d8797dd0cdb.png)  
seems to work on the debug screen, but nothing is happening in real world.

---

<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:** [13 December 2020 11:28 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/24 "2020-12-13T11:28:23Z")

</div>

You say it is ok on the debug, but you haven't said what you see as the status on the node as in the image I pasted. The 0 should change to a 1 and back again.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/28eb217c098abc7d56818e57c812b87e17ffe045.png)

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 12:56 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/25 "2020-12-13T12:56:45Z")

</div>

Yes it changes from 1 to 0 and back on command.

---

<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:** [13 December 2020 13:33 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/26 "2020-12-13T13:33:53Z")

</div>

OK, in that case I don't know what might be causing it not to work. However there is the outstanding problem of the install not going right so I suggest we sort that out first.

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [13 December 2020 16:05 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/27 "2020-12-13T16:05:43Z")

</div>

In the debug node I see string "1" or "0", must this not number 1 or 0 ?

---

<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:** [13 December 2020 16:41 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/28 "2020-12-13T16:41:22Z")

</div>

The gpio node should be able to handle both.

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 17:03 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/29 "2020-12-13T17:03:37Z")

</div>

Going to burn a new sd with clean install and installing a fresh node red install on that. If that doesn’t work I don’t know what will.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [13 December 2020 18:04 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/30 "2020-12-13T18:04:43Z")

</div>

Could it be that there is a locking issue on the gpio pins, because you other python script is running in background?  
When I started with Node-RED a few years ago, my gpio nodes also didn't work. At the end it appeared that the gpio library of the johnny-five nodes (which I had installed before) was locking the pins. After removing that library, everything was working fine.  
It is just an idea...

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 18:30 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/31 "2020-12-13T18:30:29Z")

</div>

Clean install PI done.  
Installed Node Red via script. No failures or comments. everything went smoothly.

Started node red. Built the same switch.  
No responce on the GPIO. Im stumped. Im going to try making a switch for the other 3 relays maybe they work now.

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [13 December 2020 18:36 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/32 "2020-12-13T18:36:23Z")

</div>

Again, I recomment an ULN2803.  
Its cheaper than Raspi.

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 18:41 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/33 "2020-12-13T18:41:11Z")

</div>

> [@iiot2k](#):
>
> ULN2803

I have no clue how to wire a chip yet, let alone controle it.

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 18:41 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/34 "2020-12-13T18:41:59Z")

</div>

No go on the other relays. I dont get why this does not work.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [13 December 2020 18:50 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/35 "2020-12-13T18:50:34Z")

</div>

Hey @dceejay,  
Do you think if is useful if he would uncomment the logging lines in the [nrgpio.py](https://github.com/node-red/node-red-nodes/blob/master/hardware/PiGpio/nrgpio.py#L83) file on his raspberry:

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

Or perhaps to add some extra `print` lines to get an idea whether the python script is doing what we expect?

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [13 December 2020 18:51 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/36 "2020-12-13T18:51:18Z")

</div>

![uln2803-](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6dd4c09a0eb5322b7e3bb9f123cd3e584ec17c23.jpeg)  
pin 1 -\> raspi pin  
pin 18 -\> relay input  
same for other pins  
gnd pin 9 to raspi gnd and relay gnd  
Relay boards need 5V on Vcc pin.  
ULN2803 need only 1mA for switch.  
An Raspi can drive max 50mA output current.  
More current damage the Raspi gpio !!!  
Relay modules needs 15mA per channel on 4 relay this is 60mA.  
On Raspi input and output more then 3.3v damage the gpio.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [13 December 2020 19:01 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/37 "2020-12-13T19:01:39Z")

</div>

> [@BartButenaers](#):
>
> Or perhaps to add some extra `print` lines to get an idea whether the python script is doing what we expect?

Don't have experience with python, so not clear to me whether exceptions will ever be reported in Node-RED (log)?

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

Could it be useful to add a `print` statement at that point?

---

<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:** [13 December 2020 19:02 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/38 "2020-12-13T19:02:23Z")

</div>

Hopefully the startup console log is clean this time ? How exactly are the relays wired up ? No other apps are trying to talk to them ?

---

<div class="post-metadata">

**Author:** ![spawnreaper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spawnreaper/32/33501_2.png) [@spawnreaper](https://discourse.nodered.org/u/spawnreaper)\
**Post date:** [13 December 2020 19:09 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/39 "2020-12-13T19:09:38Z")

</div>

just as a sanity check I downloaded a test python script to check if that would work.  
It in fact worked perfectly. this was the script.

```auto
# getting the main GPIO libraly
import RPi.GPIO as GPIO
# getting the time libraly
import time

# setting a current mode
GPIO.setmode(GPIO.BCM)
#removing the warings 
GPIO.setwarnings(False)
#creating a list (array) with the number of GPIO's that we use 
pins = [18,17,15,14] 

#setting the mode for all pins so all will be switched on 
GPIO.setup(pins, GPIO.OUT)

#for loop where pin = 18 next 17 ,15, 14 
for pin in pins :
        #setting the GPIO to HIGH or 1 or true
        GPIO.output(pin, GPIO.HIGH)
        #wait 0,5 second
        time.sleep(0.5)
        #setting the GPIO to LOW or 0 or false
        GPIO.output(pin, GPIO.LOW)
        #wait 0,5 second
        time.sleep(0.5)

        #Checking if the current relay is running and printing it 
        if not GPIO.input(pin) : 
                print("Pin "+str(pin)+" is working" )
                

#same but the difference is that we have 
#for loop where pin = 14 next 15,17,18
# backwards
for pin in reversed(pins) :
        GPIO.output(pin, GPIO.HIGH)
        time.sleep(0.5)

        GPIO.output(pin, GPIO.LOW)
        time.sleep(0.5)

#cleaning all GPIO's 
GPIO.cleanup()
print "Shutdown All relays"

```

I tried several more times with node red without succes.

---

<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:** [13 December 2020 19:25 UTC](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393/40 "2020-12-13T19:25:47Z")

</div>

Can you try modding that to use GPIO.BOARD mode for the pins and then use the physical pin numbers to match the ones the relays are attached to ?

[Previous page](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393.md?page=1)

[Next page](https://discourse.nodered.org/t/no-response-from-rpi-gpio/37393.md?page=3)
