Raspberry pi based player with three buttons, each for one stream

Hi! I would like to build a player where I can wire three simple buttons directly to the Pi so that each button causes a different stream to start playing. Every morning, while getting ready, I listen to a local NPR station on a Google Home Mini. I say, “ok google, play wbur”. I basically want to hit a button and have wbur start playing. A second button might be assigned to another stream, and so forth. I would need a way to increase and decrease volume and pause/stop the stream. Bonus would be to be able to assign a button to a playlist and then have prev/next buttons too.

Can Pi MusicBox accomplish this? Thanks!

I’m not sure about buttons - I use ir remote to achieve similar results, have a look at; http://stevespi.blogspot.co.uk/2016/02/setting-up-lirc-for-musicbox.html
I haven’t updated it for a while so if you take that route let me know if you have any problems getting it to work.

Using basic ir remote you can have up to 10 playlists and prev, next, volume and pause functions. If you have on old ir handset with more buttons you can expand the functions further.

That sounds like a great way to do it. I’ll look through this. I may have an IR receiver around, too!

Hi @Steve_Lambert, I have been trying to follow your guide, but ran up against an issue I thought you might be able to help with.

I am unable to find an /etc/modules file, so I created one with the two lines you said to add:

lirc_rpi gpio_in_pin=18

Then when I stop and start lirc I still see this:

[ ok ] No valid /etc/lirc/lircd.conf has been found..
[ ok ] Remote control support has been disabled..
[ ok ] Reconfigure LIRC or manually replace /etc/lirc/lircd.conf to enable.. 

Continuing, this happens:

root@MusicBox:/etc/lirc# sudo /etc/init.d/lirc stop
root@MusicBox:/etc/lirc#  mode2 -d /dev/lirc0
mode2: could not get file information for /dev/lirc0
mode2: default_init(): No such file or directory

I am not sure what I’m missing – any ideas would be appreciated!


I’ve just reinstalled it on a clean version of Pi Musicbox (musicbox_v0.7.0RC6.img) and it runs through fine.

Just checking you are using Pi Musicbox? as opposed to as Mopidy set up.
For now ignore the warning message about no config.
After changing /boot/config.txt and saving make sure to reboot.
Then run the 2 commands
sudo /etc/init.d/lirc stop
mode2 -d /dev/lirc0

I’m not sure why you have /etc/lirc # after the root@Musicbox, that may be causing the problem

I think I’m giving up for now. I can’t get the player to run without crashing the Pi. It works for a minute then freezes, and I haven’t been able to play any streams.

Thanks for the help! When I get my hands on a new Pi 3 I’ll consider trying this again.

But did the info above enable you to get lirc up and running - I don’t think the version of Pi should make any difference. What are you currently using?

A 2B, but it took ages to respond – if it didn’t freeze first. I built two SD cards, different types, one was a new 16GB one. It was really frustrating and I suspect there may be something wrong with the Pi, which was in use for a while. I’m interested in making it work but just don’t know what to do to make it reliable.