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

Some of your suggestions have been implemented in the beta version!

The plugin is promoted to the stable channel

1 Like

Thank you @mervinio :sunglasses: :+1:

Hi @supercrab Thanks for this nice plugin.

Just I have some questions suggestions

  1. Questions
    A. when I set the delay (with second), it didn’t work in Volumio 3.251. However no delay option works. Is that a issue with new Volumio version?
    B. when a music starts to play, does this plugin trigger gpio afterward or reversely ? can it have an option such as
    press ā€œplayā€ button → gpio is triggered → delay(until device fully activated) → actual music is play? Not sure it won’t be implemented if Volumio providing such hooking api.

  2. Suggestions
    A. it would be really nice if it allows to select multiple gpio to trigger one more devices as I am using mono block(2amp with 12v trigger) so, both amp need to be turned on at (mostly) same time

Thank you.

  1. A. Not sure, I will have a look when I am able - I don’t have a device to test at the moment. Do you mean it comes on straight away?
    B. the GPIO is triggered as soon as the music starts playing. I’m noot sure if it’s possible to do what your suggest.
  2. You could hook up 2 transistors that are connected to the same GPIO to control 2 things. It would not be practical to implement anything more complicated in the UI for controlling multiple GPIOs for the same event.

Thanks

Do you mean it comes on straight away? → when I set any value in delay to turn off gpio. The gpio wasn’t going to be turned off. However if I set ā€˜no delay’ to turn off gpio, it immediate turned off.

Hi @supercrab, great plugin!

Installed today and testing it. Seems to be working mainly ok.

I just found one issue, for the ā€œMusic Stop Eventā€ section, there is no ā€œDelay Unitsā€ settings, so this delay time unit seems to be stick to hours.

1 Like

Thanks! I’ll see it i can get it sorted!

Don’t worry by me.
After leaving the comment here i managed to tweak a little bit the plugin and got everything worked as is needed.

For this setting I sent a custom message via WebSocket using Chrome console.

Also moved both clearTimeout from lines 348 and 349, up to line 345 (before the if) in order to get the GPIO control for powering my amp.

With this change i have no more problems with the delays for powering off that other users where asking.

I’ve updated the plugin! It always take a while to work out what I’m meant to be doing with these volumio plugins :rofl:
You should find a beta version available 1.0.5. I believe I’ve fixed the bug you mentioned and some other issues that others found. Let me know if the plugin works for you.

I’ve also added more events that I discovered so I thought I’d included those too. There’s new events for muting, shuffling and repeating, which might be of use to people.

  • system startup
  • system shutdown
  • music start
  • music stop
  • music pause
  • mute on &off
  • random mode on & off
  • repeat on & off
  • repeat all on & off
  • repeat single & off
1 Like

See if my latest version fixes the powering off issue. :grimacing:

I think I’ve fixed your issue now too

Sorry i didn’t had time before to test this beta.
Actually i don’t know how to install a plugin beta release, just the conventional plugin manager form the user UI.

How should i do to install it?

The plugin has now been included to the latest version. I’m not sure how to install a beta plugin sorry :frowning:

My plugin now supports pulses

Hi,
Thanks for creating this plugin, it looks great.

Is there any reason why it wouldn’t work with GPIO7 ?
I get this error in the logs:

error: Failed callmethod call: Error: EBUSY: resource busy or locked, write

I guess GPIO7 is used by something else, but what would that be?

I tried using GPIO12 and it works.
The problem is that my raspberry case uses GPIO7 for external relay control so I don’t have the choice to use another GPIO…

1 Like

Hi! I have no idea sorry :frowning: Must be some other process using GPIO7 :disappointed_relieved:

It looks like GPIO7 is used by SPI CS1.
I don’t really know why Volumio enables SPI by default and I didn’t figure out how to disable it.

Nevertheless, you can reclaim GPIO7 by redirecting CS1 to another pin.
You just need to add this line is userconfig.txt:

dtoverlay=spi0-cs,cs1_pin=16

Yourt plugin works great now :+1:

Oh, if you don’t need SPI then you can add this line to userconfig.txt to disable it.

dtparam=spi=off

Glad you enjoy the plugin :sunglasses:

I already tried that but it doesn’t seem to work for me :face_with_raised_eyebrow: