A simple internet radio for your Raspberry Pi. The entire radio assembly is of course made up of the RPi microcomputer (the program is not demanding, the recording version should be enough for it to run). You also need a 2x20 line LCD display (HD44780) with an I2C converter. Finally, you need 4 buttons.
The following radios are currently added to the configuration: Kiss rádio, Evropa 2, Rock rádio, Rádio Beat, Dance rádio, Fajn Rádio, Hitrádio Černá Hora, Hitrádio Osmdesátka, ČRo Radiožurnál, Frekvence 1 and as a bonus there is also a stream from radio traffic at BRNO airport.
The above radios are of course fully configurable and can be changed to your own internet streams. The full configuration guide is in the Config section.
cd /opt
sudo apt update && sudo apt upgrade -y
sudo apt install git vlc python3-pip python3-smbus -y
sudo apt install i2c-tools libvlc-dev libvlccore-dev -y
sudo git clone https://github.com/ondrahladik/Internet-Radio.git
cd Internet-Radio
sudo pip3 install -r requirements.txtAfter installation, you will need to enable I²C.
sudo raspi-configInterface Options -> I2C -> YES
You can check whether your I²C LCD is connected and installed correctly using:
sudo i2cdetect -y 1The output should contain the address of your device.
sudo nano config.pyThe program is configured using the config.py file where you can customize some settings, but this is not necessary for functionality after installation.
A complete description of the configuration is on the Wiki page.
Before you start configuring the service, you can check if you have all the packages and dependencies installed by running the program manually.
sudo python3 main.pyCreating a service file:
sudo nano /etc/systemd/system/Internet-Radio.servicePut these lines in the file:
[Unit]
Description=Internet-Radio
After=network.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/python3 /opt/Internet-Radio/main.py
WorkingDirectory=/opt/Internet-Radio
StandardOutput=append:/var/log/Internet-Radio.log
StandardError=append:/var/log/Internet-Radio_error.log
Restart=always
[Install]
WantedBy=multi-user.targetStarting the service:
sudo systemctl daemon-reload
sudo systemctl enable Internet-Radio
sudo systemctl start Internet-RadioAdding permissions for log files:
sudo chmod 666 /var/log/Internet-Radio.log
sudo chmod 666 /var/log/Internet-Radio_error.logService management:
sudo systemctl start Internet-Radio # Starting the service
sudo systemctl restart Internet-Radio # Restart the service
sudo systemctl stop Internet-Radio # Stop the service
sudo systemctl status Internet-Radio # Service status
tail -f /var/log/Internet-Radio.log # Tracking logsI also included my 3D printed files among the files. But since I used quite atypical buttons, I also included .step files. And you can customize the box if necessary.


