![]() |
gpiozero to control a remote Moode? - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: gpiozero to control a remote Moode? (/showthread.php?tid=451) |
gpiozero to control a remote Moode? - tristanc - 09-03-2018 For my Moode set-up I need to have a simple, physical user interface remote to the actual Moode device generating the audio. Specifically, an on and off button, volume control and one or two radio station selectors. I was thinking of having a two Pi set-up - one running Moode and another to do the control (ie, some buttons connected to GPIO). Both would need to run gpiozero (https://gpiozero.readthedocs.io/en/stable/ ) and the signals transferred over the LAN. Has anyone done this? Is there another, easier way? Doing it this way, seemingly, means I would only need to ensure the daemon starts on the moode Pi so would keep code customization to a minimum, but I haven't gone to far yet in testing. RE: gpiozero to control a remote Moode? - DRONE7 - 09-03-2018 "physical user interface remote" LIRC I/R ? Buttons...??? both quite simple and shown here... http://moodeaudio.org/forum/showthread.php?tid=187 http://moodeaudio.org/forum/showthread.php?tid=198 http://moodeaudio.org/forum/showthread.php?tid=190 RE: gpiozero to control a remote Moode? - tristanc - 09-03-2018 (09-03-2018, 07:08 PM)DRONE7 Wrote: "physical user interface remote" Yep, certainly an option, but the Pi running moode is going to be hidden along with the amplifier. So IR would be difficult and running cables to / from GPIO buttons isn't an option given the room layout. Using a 2nd Pi (say a Pi zero) I could have a faux-kitchen-radio-type set-up (wife friendly!) which would deal with 90% of the user interactions. It could even have a screen to show the time / date / station / song etc. All communicated over the LAN. That's the idea anyhow. RE: gpiozero to control a remote Moode? - DRONE7 - 09-03-2018 You're describing a Phone or Tablet...... Touchscreen, network control...... so another Pi seems superfluous...? RE: gpiozero to control a remote Moode? - FizzyTea - 09-03-2018 Wouldn't it be easier to have button presses on the pi zero trigger commands on moode via ssh or the web api? You wouldn't need to customize moode at all. I think. RE: gpiozero to control a remote Moode? - tristanc - 09-04-2018 (09-03-2018, 08:17 PM)DRONE7 Wrote: You're describing a Phone or Tablet...... Touchscreen, network control...... so another Pi seems superfluous...? Yeah, agreed - this is an unusual use case. "We" don't want "more gadgets" lying about the place... Or needing to have our phones on us to change volume etc. (09-03-2018, 11:42 PM)FizzyTea Wrote: Wouldn't it be easier to have button presses on the pi zero trigger commands on moode via ssh or the web api? Ah, that's an interesting idea. My first thought was that it would work fine for 'select playlist x' but might struggle with volume control - repeated ssh connections could be very laggy. Unless I altered the increments. Hmm, I'll need to think. That's why I thought going down a few levels and passing only the GPIO levels would be fast and, to the Moode, seamless. I'll need to do some customization of Moode: I build my amp with a relay to control the main power - intending to feed it the signal from the Pi. Someone has posted code to do this through Moode which is cool. I was intending to watch the mpd status file and use that to trigger. RE: gpiozero to control a remote Moode? - FizzyTea - 09-04-2018 (09-04-2018, 08:21 AM)tristanc Wrote:(09-03-2018, 11:42 PM)FizzyTea Wrote: Wouldn't it be easier to have button presses on the pi zero trigger commands on moode via ssh or the web api? /var/www/vol.sh handles moode's volume nicely Code: vol.sh with no arguments will print the current volume level Search the forum for lots of other nuggets like that. Also mpc is simple for play/pause, playlists etc. RE: gpiozero to control a remote Moode? - FizzyTea - 09-04-2018 (09-04-2018, 08:21 AM)tristanc Wrote:(09-03-2018, 11:42 PM)FizzyTea Wrote: Wouldn't it be easier to have button presses on the pi zero trigger commands on moode via ssh or the web api? http://moodeaudio.org/forum/showthread.php?tid=339&pid=2487#pid2487 RE: gpiozero to control a remote Moode? - tristanc - 09-04-2018 Even better - I hadn't realised commands could be passed by http. Thanks for the pointer! So a python script listening for GPIO events to issue http requests would be so much simpler. I'm remote from my Moode currently, but I guess there may be a similar API call to select / play a specific playlist? RE: gpiozero to control a remote Moode? - FizzyTea - 09-04-2018 (09-04-2018, 09:33 AM)tristanc Wrote: Even better - I hadn't realised commands could be passed by http. Thanks for the pointer! So a python script listening for GPIO events to issue http requests would be so much simpler. I use mpc (via lirc) for that. |