# Hello from Germany and thanks for this cool Musicbox solution, question about GPIO button and LED´s

**URL:** <https://discourse.mopidy.com/t/hello-from-germany-and-thanks-for-this-cool-musicbox-solution-question-about-gpio-button-and-led-s/4193>\
**Category:** Pi MusicBox (archive)\
**Created:** [July 24, 2020, 12:36pm UTC](https://discourse.mopidy.com/t/hello-from-germany-and-thanks-for-this-cool-musicbox-solution-question-about-gpio-button-and-led-s/4193 "2020-07-24T12:36:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omega24V](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/omega24v/32/1662_2.png) [@Omega24V](https://discourse.mopidy.com/u/Omega24V)\
**Post date:** [July 24, 2020, 12:36pm UTC](https://discourse.mopidy.com/t/hello-from-germany-and-thanks-for-this-cool-musicbox-solution-question-about-gpio-button-and-led-s/4193/1 "2020-07-24T12:36:55Z")

</div>

hello, i´m from germany and i´m in Hifi hobby since the late 1980´s, but i´m new in Raspberry and Python.  
i have found a defect Sonos 5 on ebay and i want to integrate a PiMusicbox into it to replace the Sonos electronics.  
So i opened it up and extract all the Sonos boards.  
then i ordered a 2.1 amp at amazon and put it together with my Pi 3. Everything works fine for me.  
Now the Sonos has 3 buttons on top for vol+, vol- and play/pause and also 4 LED´s in white, orange, red and green.  
Now i thought about using the buttons for controlling the PiMusicbox over the GPIO.  
i have a little expierience in Python, but because of my work in industrial automation and building control i have more in Microsoft .net.  
Is it possible to get the buttons work with PiMusicbox? Play/Pause , vol+ and vol- schould work as default, but vol.+ and vol- long pressed should work as next/previous. And even the red LED should work as play indication, mabe the green one if PiMusicbox is booted up completely and the white one if WLAN is not connected.

I think it would be nice to have these functions, did anyone even managed this on his PiMusicbox?

I have testet the GPIO with some scripts from the internet and they worked fine, but i can´t get them to work together with the PiMusicbox. I have tried to install “festival” like one has written here in the forum, but the package seems not been online anymore?

Thanks for your help in advance,  
Omega24V

---

<div class="post-metadata">

**Author:** ![Omega24V](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/omega24v/32/1662_2.png) [@Omega24V](https://discourse.mopidy.com/u/Omega24V)\
**Post date:** [July 26, 2020, 3:23pm UTC](https://discourse.mopidy.com/t/hello-from-germany-and-thanks-for-this-cool-musicbox-solution-question-about-gpio-button-and-led-s/4193/2 "2020-07-26T15:23:10Z")

</div>

Hi,  
i have found some help online and i get Play/Pause working also as next and previous, but there is a big time lag between pressing the button and the reaction in PiMusicbox.  
Also i can´t get Vol+ and Vol- to work.  
the python script command for “play/pause” is os.system(“mpc toggle”) , or for “Next” it is os.system(“mpc next”) so far o good.  
But how can i read a longpress and shortpress for example., and did one know about “Vol +5” oder “Vol-5”?  
Kregards, Omega24V

---

<div class="post-metadata">

**Author:** ![jodal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jodal/32/2564_2.png) [@jodal](https://discourse.mopidy.com/u/jodal)\
**Post date:** [February 19, 2026, 11:46am UTC](https://discourse.mopidy.com/t/hello-from-germany-and-thanks-for-this-cool-musicbox-solution-question-about-gpio-button-and-led-s/4193/3 "2026-02-19T11:46:52Z")

</div>


