Control Peppy and MPD_OLED by Remote control or GPIO on a rPi5

People asked me in a different topic to write down instructions to accomplish what is mentioned in the title. So here we go.
All code is based on the following hardware. If you use different hardware, you need to make the changes yourself. I will not support it.
If you have absolutely no clue what is being described her, don’t start with it :wink:

What will it bring you:

  • Control Peppy_Meter as if it is an extra screen layout
  • Scroll through all you Peppy Templates by a press of a button
  • Turn you LCD on/off by press of a button
  • Use the arrow keys on your remote as a mouse
  • Select what MPD_OLED shows (Full spectrum, default layout, Clock, off) by press of a button


Spectrum Only:




Connect it all:

The power button is connected to the seeded pins on the board.
If there is unstable response on the buttons, you might need to add resistors to the switches (know as pull-up or pull-down resistors).

Configure Volumio first.

Software installation:
nano /boot/userconfig.txt

hdmi_timings=400 0 100 10 140 1280 10 20 20 2 0 0 0 60 0 43000000 3


sudo apt-get update
sudo apt-get install -yf xdotool git build-essential unclutter autoconf make libtool libfftw3-dev gpiod libiniparser-dev libmpdclient-dev libi2c-dev lm-sensors libasound2-dev autoconf-archive i2c-tools python3 python3-libgpiod python3-pip python3-pil python3-gpiozero

sudo reboot


  • IR Remote Controller
  • Touch display, enable mouse pointer, as we’re using the remote to control the mouse.
  • Now Playing, with this configuration file, needed for the mouse locations. If not you need to determine the locations yourself. Unpack it to /data/INTERNAL (2.2 KB)
  • Peppy_meter
    After installation of peppy_meter (volumio plugin install), copy the following files to /data/plugins/user_interface/peppy_screensaver (11.3 KB)
    Set the time out in peppy_meter to 0, so Peppy won’t autostart, as we are going to use buttons or RC.
  • Randomizer

Configure all plugins.

Set the screen rotation correct. rotate depends on your setup.
Unclutter is added to hide the mouse cursor after 1 second.
mkdir /home/volumio/.config/openbox

cat >> /home/volumio/.config/openbox/autostart <<EOL
xrandr --output HDMI-1 --rotate left
@unclutter -idle 1

sudo reboot

Install the DEV branch of MDP_oled (so no configuration via the plugin page). Unless you don’t want to have a selectable layout, you can install the plugin.

sudo apt install build-essential autoconf make libtool libfftw3-dev libiniparser-dev libmpdclient-dev libi2c-dev lm-sensors libasound2-dev

git clone
cd cava
./configure --disable-input-portaudio --disable-input-sndio --disable-output-ncurses --disable-input-pulse --program-prefix=mpd_oled_
make && sudo make install-strip
cd ..    

This one s time consuming!!

git clone
cd libu8g2arm
mkdir build && cd build
CPPFLAGS="-W -Wall -Wno-psabi" ../configure --prefix=/usr/local
cd ../..

git clone
cd mpd_oled_dev

Unzip and copy the following 2 files to: /home/volumio/mpd_oled_dev/src/ (9.4 KB)

LIBU8G2_DIR=../libu8g2arm CPPFLAGS="-W -Wall -Wno-psabi" ./configure --prefix=/usr/local
make && sudo make install-strip
cd ..
sudo mpd_oled_volumio_mpd_conf_install
sudo mpd_oled_service_install
sudo mpd_oled_service_edit

and replace /usr/local/bin/mpd_oled -o 0 -b 21 -g 1 -f 15 with:
/usr/local/bin/mpd_oled -b 32 -g 1 -P s -L t -o SSD1306,128X64,I2C,rotation=0,bus_number=1

sudo systemctl start mpd_oled.service
sudo reboot

Now get the scripts in:
The rotary switch is being used to swap between different screens of the “Now Playing plugin”
it switch between:

  • Coverview
  • Info view
  • Go to artist
  • Go to album
    Since volumio has no intercation with the GUI, besides the mouse, I am using xdotool to mimic a mouse.
    This is also the reason I haven’t chossen for the Manifest UI, as controlling it via xdotool is problematic.
This script is responsible to turn peppy on/off
I use this script to load a radio playlist, on release it will play the first track of this playlist.
It’s programmed for a playlist with the name Radio. If you want a different list, you need to modify the code.

Thsi is just a file to hold the setting for MPD_OLED, so the modified script knows how to toggle.
0 - Spectrum
1 - Default playing
2 - Clock only
3 - Off
This script is responsible for scrolling through all templates from the folder you’ve selected in the plugin setup. It reads the selected folder from config.txt and available templates from the corresponding meters.txt. Don’t hit the button as a lunatic, but wait until Peppy is fully loaded. If not it might crash.
This scripts gives you the opportunity to start peppy via RC or remote.

mkdir /home/volumio/scripts
unzip the scripts to above folder. (2.8 KB)

cd /home/volumio/scripts

chmod 755 *.sh
chmod 755 *.py
chmod 755 *.txt


sudo nano /lib/systemd/system/monitor_gpio.service


Description=GPIO monitor_gpio Plugin
ExecStart=/usr/bin/python3 /home/volumio/scripts/


sudo chmod 644 /lib/systemd/system/monitor_gpio.service && sudo systemctl daemon-reload && sudo systemctl enable monitor_gpio.service && sudo systemctl start monitor_gpio.service

sudo nano /lib/systemd/system/radio_button.service


Description=Radio_button Plugin
ExecStart=/bin/bash /home/volumio/scripts/


sudo chmod 644 /lib/systemd/system/radio_button.service && sudo systemctl daemon-reload && sudo systemctl enable radio_button.service && sudo systemctl start radio_button.service

The remote or GPIO:
All the used commands are in this zip file (licrc). If you choose to operate via GPIO then you can add buttons and commands to (Yes I could have used more in functions but I am lazy :wink: ) (1.9 KB)

For those who want to use it with other screens, you need to get the mouse location if you want to control anything on the screen. The command for that is:
XAUTHORITY=~volumio/.Xauthority DISPLAY=:0 xdotool getmouselocation --shell

Guess this is it.


Extra! Ir receiver 36, 38… kHz?
Push button - Bi? Uni?

what do you mean :joy:

I found IR receivers for 36kHz, 38kHz

and buttons: monostable and bistable

As far as I am aware both should work. I removed the link to amazon and just mention you need a 38kHz receiver. Got mine ripped from a argon one.

OK, I have everything at home, I don’t need to buy anything :grin:

I did my own instructions on a clean install, to be sure nothing was missing and it did the job. So have a go I am curious.

a 36kHz receiver wont work or at least work not good if your RF is modulating on 38kHz - most IR remotes work on 38kHz

yeah After @Gelo5 question, I removed the link to Amazon, to avoid any pitfall.