[plugin] GPIO control: control GPIO with Volumio 3 events (now RPi5 compatible!)

Hi, thats not possible since there is no such event raised by the volumio system to detect. :cry:

A post was merged into an existing topic: WIFI/Network status LED

I’ve added the following features to the gpio_control plugin:

  • Detect whether Host 1 (IP address) is online or offline
  • Detect whether Host 2 (IP address) is online or offline
  • Monitor Ethernet connection status (connected/disconnected)
  • Monitor WiFi connection status (connected/disconnected)
  • You can now set the initial state of a GPIO pin

You can find the beta version in the Plugins Store! :rocket:

4 Likes

keep on rolling Marcus!!!

@Wheaten I think it’s time to stop now! :rofl::rofl: Take a break :grimacing:

Hi @supercrab! Mind me if I’m doing right with my pi3b and lcd. Those lcd and pi3 are separated power. So i use this with control plugin to control the lcd on/off same as with the status of my pi3.
I used low trigger relay to control the lcd over gpio pin using also control plug eg.
Relay rpi3 pin

  • vcc - 5v
  • in - gpio 16
  • Gnd - gnd

Contol plugin
Turnon event
Set gpio 16
State off

It works well, but my concerns is, is it safe for the pi?

@Edrian_Lois_Villanue did you say you are using a relay?

@@Edrian_Lois_Villanue It all depends but it sounds like it could be risky depending on how the LCD is wired.

Potential Risks & Fixes

LCD Power Draw Could Exceed GPIO Limits

  • The Raspberry Pi GPIOs can only supply up to 16mA per pin (but it’s safer to stay below 10mA).
  • Most LCDs require way more current than a GPIO can provide.

:rotating_light: Risk: If the you are powering the LCD directly from GPIO 16, it could overload and damage the Pi.

:white_check_mark: Fix: Ensure both power supplies share the same GND connection.

Using GPIO to Control LCD Backlight vs. Power

  • If the user is controlling the LCD backlight (not the full power), some LCDs allow this via a logic pin.
  • If it’s the main power being switched via GPIO, a transistor or MOSFET is required.

:white_check_mark: Fix: If the LCD supports backlight control via a low-current logic pin, it’s safe to toggle it with GPIO. Otherwise, use a transistor or MOSFET to switch power safely.


Final Verdict: Is It Safe?

:small_blue_diamond: If you’re controlling the LCD’s power directly via GPIO 16 → Unsafe! (Risk of overloading GPIO).
:small_blue_diamond: If you’re just toggling a control pin for backlight → Likely fine.
:small_blue_diamond: Best practice: Use a transistor or MOSFET to switch LCD power safely.

1 Like

Thanks @supercrab

1 Like

Hi @Edrian_Lois_Villanue i use a relay similiar to this to control the LCD backlight: Relay Board

Probably complete overkill, but i was planning to also control an OLED panel…

Hi @SimonF! I used this kind of relay 5v trigger.

Supercrab says also that i use mosfet or transistor tip120 with 1k resistor.
To make it safe with board.

@SimonF @Edrian_Lois_Villanue You could use a TIP120 or some other mosfet OR an optocoupler like this:

c7cc4a723ceaad6febe63c25c7fca8e37d858b0d_2_325x500

2 Likes

Ok noted,
thank you I’ll try this tomorrow after i get my order.

@Edrian_Lois_Villanue no problem :slight_smile:

Hi @supercrab

Struggling with the WLAN and ETH0 events.
I want a single LED to turn on, on either WLAN and/or ETH0.
If one of them is active => “ON”, if both are inactive => “Off”.
But for some reason I can’t get it to work. If I set this on both events the LED will stay off.

Any suggestion?

Currently bypassing restriction with a bash script.

#!/bin/bash

GPIO=16
while true;
do
	ping -c 2 www.google.com > /dev/null
	if [ $? != 0 ]
	then
		echo "Your site seems to be down"
		gpioset gpiochip0 ${GPIO}=0
	else 
		echo "Your Site is up"
		gpioset gpiochip0 ${GPIO}=1
	fi
	sleep 5
done

image

@Wheaten Currently, the plugin doesn’t support using two events to control a single pin with an OR operation. However, you could achieve this by using an external OR gate to combine the outputs of two pins. Ideally, I’d like to allow users to configure and combine events for GPIO control, but with the limited UI options, I haven’t found an elegant solution yet. I’ll keep thinking about it.

@Wheaten I’ve given it some thought and figured out a way to make it work. I’ll test it later. I’m planning to add a new control for system events that defines how they should be combined.

4 Likes

Raspberry PI 4B - 1 GB.

Two LEDs connected to GPIO 17 and GPIO 23 - LAN / WIFI working ok.
They shine when there is internet
They don’t shine when there is no internet.

They also work the other way around.
When there is internet WIFI / LAN , the LEDs do not light up
When there is no WIFI / LAN internet, both LEDs light up.

Two LEDs connected to GPIO 22 ( power On / Off - Volumio ) and GPIO 27 ( play - pause - stop ) working ok.