question

godnesshimself avatar image

relay overview Venus OS

hey,
how can I control the relays via Venus OS?bildschirmfoto-2022-01-19-um-215004.png

Relay
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

If you are asking where this overview page comes from, it's part of my GuiMods package:

https://github.com/kwindrem/GuiMods


8 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

no. I ask how I can control these switches?

What do you need for that?

That menu provides on/off control of the relays only, or in some cases control of the function assigned to the relay (e.g., generator start/stop). Because you are showing 6 relays, you must be on a Raspberry PI. The relay outputs appear on the 40-pin header as 0/3.3 volt logic and each will need to feed a driver and a relay to control other devices. There are also relay "hat" boards that may work. Rob Duthie is working on "Stetson", an expansion board for Venus OS on Raspberry PI that among other things provides the 6 relay outputs.


Besides manual control, Relay 1 can be set to be controlled by conditions within Venus such as generator start/stop, tank pump or alarms. As of Venus v2.80~36 the relays can also be controlled by temperature sensors. All these setups are from the standard Venus menus, starting with the Relay menu to select the function for each relay. Then, additional setup may be needed in the menu for that functionality (e.g., the Tank Pump menu allows selection of which tank and the start/stop levels, or the Temperature Sensor menu inside the Relay menu).

I'm not sure which ones will work with Venus OS. If they require a driver written for Raspberry PI OS may be not.

I know some relay hats use active low which creates issues with Venus OS since there is no way to change the polarity.

Search around on the forum for more help or relays for Venus. Sorry, it's just an area I've never looked into.

Hi, can you tell me whether it is possible to show the switches of one or two relais on the main Dashboard?
Space on the flow overview is all reserved for something. No room for anything else.

With QML coding experience you could customize the overview exactly how you want it.

rock2ya avatar image rock2ya Kevin Windrem ·
thank you
itsme avatar image
itsme answered ·

I use this one with my Pi 3+: https://www.amazon.com/gp/product/B072XGF4Z3 and it works well. The only thing I had to do is modifying the "etc/venus/gpio_list"


#### modified 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   Pin 40 / GPIO 21 CHANGES FOR RELAY HAT: -> GPIO 4
4  out relay_1

# Relay 2 Pin 11 / GPIO 17 CHANGES FOR RELAY HAT: -> GPIO 22
22  out relay_2

# Relay 3 Pin 13 / GPIO 27 CHANGES FOR RELAY HAT: -> GPIO 6
6  out relay_3

# Relay 4 Pin 15 / GPIO 22 CHANGES FOR RELAY HAT: -> GPIO 26
26  out relay_4


# Relay 5 Pin 16 / GPIO 23
23  out relay_5

# Relay 6 Pin 18 / GPIO 24
24  out relay_6



# these have pull UPs
# Digital input 1   Pin 29 / GPIO 05
5   in digital_input_1
# Digital input 2   Pin 31 / GPIO 06 CHANGES FOR RELAY HAT: -> GPIO 17
17   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   Pin 33 / GPIO 13
13  in digital_input_3
# Digital input 4   Pin 35 / GPIO 19
19  in digital_input_4
# Digital input 5   Pin 37 / GPIO 26 CHANGES FOR RELAY HAT: -> GPIO 27
27  in digital_input_5

#### Gracefull shutdown input
#### Note this input is NOT added to the available I/O used by Venus OS !!!!
# Pin 36 / GPIO 16
16  in digital_input_6
3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Sounds great. I will try it. thanks it advance :)

Hello,

that works. thanks for that.

can it be that from time to time it adjust again or when something is updated?
can you save the setting permanently?

Do you have a case for the PI + HAT?

Kevin Windrem avatar image
Kevin Windrem answered ·

A venus firmware update will overwrite the changes to the gpio_list file. Consider using my RpiGpioSetup package along with SetupHelper to keep the changes. RpiGpioSetup now supports a custom gpio_list file.

4 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

great, Kevin! Thank you...

After the update to 2.80 the relay overview area is empty.
Under settings I can't find the item relay anymore

what happened? :(

Is RpiGpioSetup shown as installed in PackageManager?


Are you running the large version of Venus OS. If so, there's an update to SetupHelper that fixes an install bug for all packages.

Otherwise, hard to say without logs.

Hi Kevin,

can you please give me a little information how the gpio_list file in the RPIGGpioSetup should look like or how it can be setup? There is a section in "/data/setupOptions/RpiGpioSetup" called "optionSet". I'm a little bit confused how to handle it to keep the settings.

Thanks!

Kevin Windrem avatar image
Kevin Windrem answered ·

The RpiGpioSetup package contains a default gpio_list file. That file should work when using the GPIOs on the 40-pin header, but if you are using a relay HAT, etc, they may not be correct.

You can copy that gpio_list file to /data/setupOptions/RpiGpioSetup then edit it to change the assignments. The package will look for /data/setupOptions/RpiGpioSetup/gpio_list first before installing the default one.

The assignments you make in this file will depend on the harware you are trying to use for Venus digital inputs or relay outputs.

The custom gpio_list file is independent of the optionsSet flag file.


"optionsSet" is a file that tells the setup script that the options have been set by the user. Once they have been set, they persist in the setupOptions directory and survive a Venus firmware update. If the options have been set, the setup script will be run on the first boot following a Venus firmware update. If the package requires options to run the setup script without user interaction, as happens during during a reboot following a Venus firmware update, the setup script will not reinstall the packages. if the optionsSet flag file is not present. Most of my packages don't require any setup options, so the setup script will skip the optionsSet check. At this point I think only package that requires command line options is VeCanSetup.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Thanks for the detailed description. Now it's clear for me!