raspberry pi internet radio

Internet radio using the raspberry pi
This is an internet radio, made with the raspberry pi. It uses a 2.8 inch touchscreen to control the radio and display useful information.
The user interface is made in python using pygame. The code is quite easy to understand and can be adapted to your taste.
To listen to the radio station you want, you need to have a streaming link of the station. A website I used is somafm.com. On here you can find various stations of different genres which provide a streaming link.
The user interface is made in python using pygame. The code is quite easy to understand and can be adapted to your taste.
To listen to the radio station you want, you need to have a streaming link of the station. A website I used is somafm.com. On here you can find various stations of different genres which provide a streaming link.
Updates van de auteur
raarts 8 jaar geleden
First you need to install Raspbian. Download Raspbian Jessie and use Win32DiskImager to burn it on an empty SD card of at least 4GB. When this is done you can insert the SD card in the raspberry pi, attach a monitor, mouse, keyboard and a USB Wi-Fi dongle and power it up. When the raspberry is powered up, you can set the network in the top right corner. After connecting to the network, you should remember the IP address of the raspberry pi. This is useful for configuring the raspberry later. To get the IP address, you have to hover the mouse over the icon used to connect to the network.
Then you have to install the touchscreen libraries. If you haven’t already attached the touchscreen, you have to shut the raspberry down by going to the top left corner and selecting shutdown. Attach the touchscreen and power the raspberry back on. The installation can be done via the computer. Download Putty, start the program and enter the IP address of the raspberry pi in the bar which says ‘Host address (or IP address)’. If a notification pops up, click ‘Yes’. Now a terminal window should open, asking to log in. Log in with username ‘pi’ and password ‘raspberry’. Now type ‘sudo wget -N https://github.com/watterott/RPi-Display/raw/master/rpi-display.sh’ and press enter. Then type ‘sudo /bin/bash rpi-display.sh 270’.
After some time, some questions appear:
Activate the console on the TFT display? y/n Y
Install fbcp (Framebuffer Copy)? y/n N
Install xinput-calibrator? y/n Y
Install tslib (touchscreen library)? y/n Y
Calibrate touchscreen now? y/n N
Reboot the system now? y/n Y
The raspberry pi reboots and the connection with the computer will be lost. If everything goes right, you should see the user interface on the touchscreen when the raspberry pi boots up.
To configure the touchscreen, reconnect to the raspberry using Putty. Log in and type ‘sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate’. On the touchscreen you’ll see the calibration program. After this, the touchscreen is calibrated.
Now you can install the music player client and daemon. To do this, type the following commands:
‘sudo apt-get update’
‘sudo apt-get install mpd mpc’
Now you have to install the User interface. For this you can use winSCP to copy the files to the raspberry pi. Close Putty and start winSCP. Log in with the same credentials used in putty. If a notification pops up, click ‘Yes’. Copy the map ‘pi-radio’ to the raspberry pi. Then copy the files launcher.sh and shutdown.sh to the Desktop folder. These two files are to launch the radio and to shut down the raspberry pi. Now you can close winSCP and start putty again.
The two files on the desktop don’t work as icons yet. To do this, type in putty: ‘sudo chmod +x /home/pi/Desktop/launcher.sh’ and ‘sudo chmod +x /home/pi/Desktop/shutDown.sh’.
The radio is now installed but there are no radio stations added. To add a radio station, you need to have the streaming link from this radio. This is the address on which de audio is streamed. A site on which these links are available is SomaFM. On this site are many stations of different genres available which provide a streaming link to use. To get a link on somaFM, you click on the station you want, click on ‘Direct stream links’. The link you need is next to ‘Direct server:’.
To add the stations, open putty and enter ‘mpc add ’ followed by the station url, for example ‘mpc add http://ice1.somafm.com/bagel-128-mp3’. Links ending with for example .m3u won’t work. There are many other stations available from other websites or radio stations which can be added, so you’re not limited to somafm. The url can be tested by entering them in the browser. If it’s a valid link, a music player will open, playing the radio station.
To list the added radio stations, you can use the command ‘mpc playlist’. This lists all added radio stations. To remove a radio station, type ‘mpc del ’ followed by the number in the playlist, for example: ‘mpc del 2’ removes the station on the second position.
Using the radio
The radio player can be started by double tapping the icon on the touchscreen and press ‘Execute’. The interface has been kept simple so that it can be operated with your fingers rather than a stylus.
Play - starts mpc on the current playlist
Pause - stops mpc on the current playlist
Volume down - reduces volume
Volume up - increases volume
Mute - volume set to zero
Refresh - stops player, starts player again and refreshes the screen.
Exit - closes radio player interface but keeps mpc playing
To shut down the raspberry, double tap the shutDown icon and press ‘Execute’.
Jan-Peter Müller 8 jaar geleden
Wo kann ich das Touch-screen 2,8 '' kaufen und welche Bezeichnung hat es ?
Grüße JP
ThijsBeckers 8 jaar geleden
http://www.watterott.com/de/RPi-Display-B-Plus?x4aae2=310babb88330e3657943aba192ae84e0.
Cheeers, Thijs