No response from rpi-gpio

I am creating my first flow and ran into a wall.
I have a raspberry pi 3 connected to a 4 relay board.
my attempt is to create a nice flow that allows me to switch those 4 relays via dashboard.
I created 4 dashboard switches and 4 rpi gpio out's
changed settings to string with 0 for off and 1 for on.
None of the relays respond. the debuggers does nog give me any errors to work with.
I can controle the GPIO's using a script so I know the communication between the pi and board is okey and the relays can be controlled.
I dont know what I am doing wrong.

This happened to me if I had forgot about having one wire protocol enabled on the gpio's

I dont understand, what do you mean?


As you don't know about this its probably not the issue

Just to make sure there aren't any issues with your dashboard buttons setup: have you already tried to control your gpio-out nodes via simple Inject-nodes (i.e. inject a simple on or off...)? If that works, then it will be dashboard related instead og gpio related...
Bart

Ill give that a try.

1 Like

okey, ive created a "inject node" msg payload = string 1and named it "ON"

I linked it to the rpi-gpio out node 18 GPIO pin, digital output, initialise pin stat, initial level of pin -low (0) Name doorbell OFF.

basically if the relay is on, my doorbell goes off. sorry for any confusion.

I also added two debugs on the injects. running them they result in:

12/12/2020, 12:17:57 PMnode: 99770159.4385f8msg.payload : string[1]

"1"

12/12/2020, 12:18:01 PMnode: aba72409.c408amsg.payload : string[1]

"0"

but the relay is not responding to any of them.

I tested with my py scripts again. they still work.

looks like node red is not able to get to the pins for some reason.

They should ideally be number 0 and 1 not string, though I suspect it will work with string also. Assuming that changing the inject nodes to number type does not help then show us how you have configured the gpio node.

Also stop node red and start it again in a terminal an post the startup log here, including when you click the inject nodes, if anything appears in the log when you do that. When pasting it in use the </> button at the top of the forum entry window.

1 Like
node-red-pi
12 Dec 13:28:20 - [info] 

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

12 Dec 13:28:20 - [info] Node-RED version: v1.2.6
12 Dec 13:28:20 - [info] Node.js  version: v14.15.1
12 Dec 13:28:20 - [info] Linux 5.4.79-v7+ arm LE
12 Dec 13:28:22 - [info] Loading palette nodes
12 Dec 13:28:27 - [info] Dashboard version 2.25.0 started at /ui
12 Dec 13:28:28 - [info] Settings file  : /home/pi/.node-red/settings.js
12 Dec 13:28:28 - [info] Context store  : 'default' [module=memory]
12 Dec 13:28:28 - [info] User directory : /home/pi/.node-red
12 Dec 13:28:28 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Dec 13:28:28 - [info] Flows file     : /home/pi/.node-red/flows_Doorbell.json
12 Dec 13:28:28 - [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.
---------------------------------------------------------------------

12 Dec 13:28:28 - [info] Starting flows
12 Dec 13:28:28 - [info] Started flows
12 Dec 13:28:28 - [info] Server now running at http://127.0.0.1:1880/


I've tried with string and number. Makes no difference.
I did notice

Started Node-RED graphical event wiring tool.
/usr/bin/env: ‘node-red-pi’: No such file or directory
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 275.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.

over and over and over again.

You should use node-red-stop and node-red-start to stop and start node-red. Assuming that correctly starts node-red without apparent error then don't forget to show us the config of the gpio node.

pi@Doorbell:/ $ node-red-stop

Stop Node-RED
 
Use   node-red-start   to start Node-RED again
 
pi@Doorbell:/ $ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.178.90:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 1.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
/usr/bin/env: ‘node-red-pi’: No such file or directory
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
/usr/bin/env: ‘node-red-pi’: No such file or directory
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 3.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
/usr/bin/env: ‘node-red-pi’: No such file or directory
nodered.service: Main process exited, code=exited, status=127/n/a
nodered.service: Failed with result 'exit-code'.

I am going to search how i can get the config go the gpio node. Unless you have the command to request that, it would save me the search.

is this it?

 $ raspi-gpio get
BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=0 func=INPUT
GPIO 1: level=1 fsel=0 func=INPUT
GPIO 2: level=1 fsel=0 func=INPUT
GPIO 3: level=1 fsel=0 func=INPUT
GPIO 4: level=1 fsel=0 func=INPUT
GPIO 5: level=1 fsel=0 func=INPUT
GPIO 6: level=1 fsel=0 func=INPUT
GPIO 7: level=1 fsel=0 func=INPUT
GPIO 8: level=1 fsel=0 func=INPUT
GPIO 9: level=0 fsel=0 func=INPUT
GPIO 10: level=0 fsel=0 func=INPUT
GPIO 11: level=0 fsel=0 func=INPUT
GPIO 12: level=0 fsel=0 func=INPUT
GPIO 13: level=0 fsel=0 func=INPUT
GPIO 14: level=1 fsel=2 alt=5 func=TXD1
GPIO 15: level=1 fsel=2 alt=5 func=RXD1
GPIO 16: level=0 fsel=0 func=INPUT
GPIO 17: level=1 fsel=0 func=INPUT
GPIO 18: level=1 fsel=1 func=OUTPUT
GPIO 19: level=0 fsel=0 func=INPUT
GPIO 20: level=0 fsel=0 func=INPUT
GPIO 21: level=0 fsel=0 func=INPUT
GPIO 22: level=1 fsel=1 func=OUTPUT
GPIO 23: level=1 fsel=1 func=OUTPUT
GPIO 24: level=1 fsel=1 func=OUTPUT
GPIO 25: level=1 fsel=1 func=OUTPUT
GPIO 26: level=0 fsel=0 func=INPUT
GPIO 27: level=0 fsel=0 func=INPUT
BANK1 (GPIO 28 to 45):
GPIO 28: level=0 fsel=0 func=INPUT
GPIO 29: level=0 fsel=1 func=OUTPUT
GPIO 30: level=0 fsel=7 alt=3 func=CTS0
GPIO 31: level=0 fsel=7 alt=3 func=RTS0
GPIO 32: level=1 fsel=7 alt=3 func=TXD0
GPIO 33: level=1 fsel=7 alt=3 func=RXD0
GPIO 34: level=1 fsel=7 alt=3 func=SD1_CLK
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0
GPIO 37: level=1 fsel=7 alt=3 func=SD1_DAT1
GPIO 38: level=1 fsel=7 alt=3 func=SD1_DAT2
GPIO 39: level=1 fsel=7 alt=3 func=SD1_DAT3
GPIO 40: level=0 fsel=4 alt=0 func=PWM0
GPIO 41: level=0 fsel=4 alt=0 func=PWM1
GPIO 42: level=1 fsel=4 alt=0 func=GPCLK1
GPIO 43: level=1 fsel=4 alt=0 func=GPCLK2
GPIO 44: level=1 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3

For the gpio node I just meant a screenshot of how you have set it up.

As for the problem with startup, did you install node-red using the recommended script?

How I wired up the gpio.

And I installed using the install script. That proces was also problamatic.

You still haven't shown us how you have configured the gpio node. Double click it to open it and post a screenshot here. You can paste the image in here.

When you say the installation was problematic, what was problematic about it?

I have just realised you have two threads running at once, let us keep installation issues to the other thread.

Hi,
this relay boards are protected with optocouple parts.
Each input needs 15mA even when it switch to ground.
How stupid is that, protecting inputs, but has common ground ?
I recommend using a ULN2803 between Raspi and Relayboard. Long live the Raspi :slight_smile:

1 Like

The install script kept failing. It finally finished but with commments I could not resolve.

trying to test it like this.