Raspberry Pi Venus with RpiGPIOSetup

Hello all.

I have a Raspberry Pi 4B with the latest Venus (v3.42) and the package manager RpiGpioSetup (v4.10). I have hooked up my 2 relay module using jumpers.
VCC → pin2
In2 → pin 40
In1 → pin 11
GND → pin 20

Jumper set to JDVcc - Vcc

Everything works, the opposite of what it should. When I toggle the relay to ‘on’, the resistance between Relay NO and Relay Comm, goes to infinite. When I toggle the relay ‘off’ the resistance between Relay NO and Relay Comm, goes to 0.

Please help


LEGACY assignments for Relay 1, 5 and 6 and Dig In 4

WILL CONFLICT with second channel on WaveShare dual channel CANbus hats, and possiblly others

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 channel hats

note that WaveShare sells two different dual channel CANbus hats: the non FD and FD (flexible data rate)

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: bbb gpio · victronenergy/venus Wiki · GitHub

Format: <pin_number> <direction: in/out>

The 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 package

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

26 in digital_input_5

Gracefull shutdown input

Note this input is NOT added to the available I/O used by Venus OS !!!

GPIO 16 / header pin 36

16 in digital_input_6

1 Like

The problem stems from some relay boards operating on an active low input. The GPIO outputs can be inverted BUT the PI will still boot up with all relays going active until the code that inverts the state executes. The earliest is when the OS reads the DT overlay specified in config.txt.

These boards are driven with a LOW signal.

So, when the rpi goes HIGH on the gpio, the relays NO opens and vice versa.

If the state without power is not relevant, you can simple use the inverted contactors. If you need to ensure a proper state during boot / powerloss that will not work ofc.

Thanks, I thought it was me! I really need it to work correctly. It is to start my generator, and I need to use one to supply power and the other to engage the starter motor. So it is important that the NO is NO! I could put the whole thing on a battery backup, so that it does not restart, but the battery backup HATE the generator and will not take input power from it. I live completely off the gird and have an automatic generator start that works great, I just wanted a way to add a remote start. Is there another Relay board I can buy?

Hallo die nette Runde,
ich weis nicht mehr was ich machen soll?
Ich habe einen Raspberry, Venus, Node Red und möchte gerne den GPIO ansteuern.
Leider funktioniert es auch nicht mit RpiGpioSetup.
Bitte euch um hilfe, was ich ändern muss?
Danke