(date of creation: February 2024)
This is a project to implement our own internet radio for everyday use. We created a simple GUI with a status line for the currently played song and radio station, a title bar with date, time and the current signal strength and eight buttons with configurable radio stations.
The program was built and tested for following hardware and software components:
Software:
- Python version: 3.12.2
- Raspberry Pi OS (based on Debian 12 (Bookworm))
Hardware:
- Raspberry Pi 4 Model B
- Display: Waveshare 4.3inch DSI LCD Capacitive Touch Screen Display 800x480 Resolution IPS Wide Angle Monitor for Raspberry Pi 4B/3B+/3A+/3B/2B/B+/A+ (any touch-sensitive display for Raspberry Pi 4 should work, but some may need further configurations within Raspberry Pi OS)
- HiFiBerry DAC+ (any HiFiBerry should work, but configuration of the Raspberry Pi OS will vary, see
step-by-step guide/HiFiBerry)
If you need help setting up mira on your own Raspberry Pi please refer to the step-by-step guide below for detailed instructions.
-
Install Raspberry Pi OS with an imager on an SD-Card
- using the Raspberry Pi OS Lite image (no desktop environment)
- using
miraas username
-
sudo apt install mpd sudo apt install mpc sudo apt instal python3-guizero sudo apt install xinit -
sudo nano /etc/X11/Xwrapper.configedit the following line to allow any users
allowed_users=anybody -
aplay -lsearch for the correct card, e.g.:
card 3: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 [HiFiBerry DAC+ HiFi pcm512x-hifi-0] Subdevices: 0/1 Subdevice #0: subdevice #0 -
sudo nano /etc/mpd.confuncomment the following and edit the device according to
step 4audio_output { type "alsa" name "My ALSA Device" device "hw:CARD=sndrpihifiberry,DEV=0" }see also
man 5 mpd.conf -
sudo systemctl enable mpdcheck if mpd is enabled
sudo systemctl status mpd -
sudo systemctl start mpdsudo systemctl restart mpd -
mpc clearmpc add [Radio-URL]mpc play -
mpc stop
-
sudo systemctl enable /home/mira/Github/mira/mira.service -
sudo systemctl start mira
-
#!/usr/bin/sh sleep 5 /usr/bin/python ~/Github/mira/mira.py --fullscreen (the file path depends on where mira was copied to) -
sudo nano ~/.config/wayfire.iniadd a section at the end
[autostart] (name) = path of file to be run on startup
-
ls -l /boot/firmware/overlays/hifiberry* -
sudo nano /boot/firmware/config.txtand add to section
[all]:dtoverlay=hifiberry-dacplus(the module that matches your specific HAT model)
-
sudo nano /boot/firmware/config.txt -
# Additional overlays and parameters are documented # /boot/firmware/overlays/README -
dtoverlay=disable-wifi dtoverlay=disable-bt
sudo raspi-config
sudo alsamixer
To permanently save the settings run:
sudo alsactl store
create the file
sudo nano /etc/X11/xorg.conf.d/screensaver.conf
add the following content to the file to disable the screen off timeout
Section "ServerFlags"
Option "BlankTime" "0"
EndSection
see also man xorg.conf
