Skip to content

LLIILLEEDD/Skript-MPD-radio-on-RPi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

radio-on-RPi

This Bash script automates the setup of a Raspberry Pi to play a specific radio stream automatically on system startup. Just run this script on Raspberry Pi and you will have endlessly playing phonk, or any other music that is hosted on the Internet. Such a device can be useful for placement with speakers in various locations of the building, for example in the hall, elevator, toilet, etc.

Included software

  • Music Player Daemon (MPD)

What is he doing

1. Updating and Installing Necessary Packages: Updates the system and installs MPD (Music Player Daemon) and MPC (Music Player Client), essential for playing the radio stream.

2. Configuring MPD: Customizes the MPD configuration to use ALSA as the audio output, ensuring the audio is routed correctly through your device.

3. Creating an Autostart Script: Generates a script that clears the current playlist, adds the desired radio stream, sets the volume to 100%, and starts playback.

4. Setting Up a systemd Service: Creates and enables a systemd service to ensure the radio starts automatically whenever the Raspberry Pi boots up.

5. Automating Reboots and Service Restarts: Configures crontab to schedule daily reboots at midnight and to restart the radio service every 20 minutes, ensuring continuous playback without interruption. After running this script, your Raspberry Pi will be fully configured to automatically start the specified radio stream on boot and maintain it with regular restarts.

Change music stream

To change the hosting, just change the line mpc add https://radio.real-drift.com/stream url address in /usr/local/bin/start-radio.sh

To change the playback volume, change the numerical value in the line mpc volume 100 in /usr/local/bin/start-radio.sh

Checking service status

watch systemctl enable start-radio.service image

About

Script for creating radio stream playback with Raspbery Pi

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages