Hi, all friends, I’m Roberto from Italy.
I’ve some trouble with the 4ch relay board on Venus OS 3.52 rpi4: it’s doesn’t work except relay #2 that goes on when I switch on relay#4 !!!
“# KEYESTUDIO 4 Channel DC 5V Modulo Relay Expansion Board Power Relay Board Module per Raspberry Pi 4 3 2 A+ B+ 2B 3B”
Hi Roberto, I’ve been experimenting with a single relay of that type, using it on RPi 5 with Node Red to control a fan and it’s working fine. The three connectors on each relay - normally open, common and normally closed - caused me some confusion. There’s a Pico-based guide here, which might be helpful. I haven’t used the 4-relay board.
Note that the GPIO assignments for this module are most likely different from what RpiGpioSetup uses by default. It looks like the module uses GPIO 7, 3, 22 and 25 while the default for RpiGpioSetup is 21, 17, 27, 22, 23 and 24 for relay outputs (6 relays).
With the default gpio_list relay 4 in Venus will control relay 3 on the module but that was not what you observed. The documentation does not specifically define which GPIO controls which relay so maybe the doc is not correct.
You can change the assignments by specifying a custom gpio_list file to the setup script. Make sure to remove any conflicts with the digital input definitions.
Hi, I’ve solved thas issue writing a new assignement table about Gpio pins and relay using the Toby’s guide.
Thanks Toby.
Now there are a conflict on pins used on realy board and digital inputs pins: someone hava some ideas ?
I can’t use the digital inputs.
I modified this file “/etc/venus/gpio_list” to my needs and there you can find also inputs.
it looks like this:
#### LEGACY assignments for Relay 1, 5 and 6 and Dig In 4
#### WILL CONFLICT with second channel on WaveShare dual channel CANbus hats, a >
#### interrupts, chip selects and second SPI bus
#### single channel CANbus hats should be OK with these assignments
#### this includes using only the first channel of the WaveShare dual channe >
#### note that WaveShare sells two different dual channel CANbus hats: the non >
### for use by the RpiGpio package on Raspberry PI platforms ONLY
# This is a list of GPIO pins, set by the script /etc/rcS.d/S90gpio_pins.sh
# They are documented at: https://github.com/victronenergy/venus/wiki/bbb-gpio
# Format: <pin_number> <direction: in/out> <name>
#
# The <name> part is used to create an symlink in /dev/gpio.
# relays are active HIGH
# Relay 1 GPIO 21 / header pin 40
21 out relay_1
# Relay 2 GPIO 17 / header pin 11
17 out relay_2
# Relay 3 GPIO 27 / header pin 13
27 out relay_3
# Relay 4 GPIO 22 / header pin 15
22 out relay_4
# Relay 5 GPIO 23 / header pin 16
23 out relay_5
# Relay 6 GPIO 24 / header pin 18
24 out relay_6
# these have pull UPs
# Digital input 1 GPIO 5 / header pin 29
5 in digital_input_1
# Digital input 2 GPIO 6 / header pin 31
6 in digital_input_2
# in stock code these have pull DOWNs
#### modified to pull UPs by the GPIO overlay that is installed as part of this >
# Digital input 3 GPIO 13 / header pin 33
13 in digital_input_3
# Digital input 4 GPIO 19 / header pin 35
19 in digital_input_4
# Digital input 5 GPIO 26 / header pin 37