Broadcasting systems has come a long way since radio stations started airing news and music. Both the technology and the services offered to people have changed a lot over the years. What have not changed are people listening to radio broadcasts. Not everyone has a transistor radio because they no longer need one to listen to radio broadcast. They can use their PC or other computers with internet connectivity to listen to broadcasts or rather streams from internet radio stations.Here is the new Raspberry pi internet radio!!!
Raspberry pi internet radio - Internet Radio:
Internet radio is a tool for broad casting audio services over the internet. The broadcast called as web cast is much like the traditional radio broad casts but transmitted over the internet. All the services offered over conventional radio broad casting are being web casted too. Web casting is different from file sharing because the audio is not downloaded but streamed. In this project we are talking about Raspberry pi internet radio.
Wi-Fi is a Wireless Local Area Network (WLAN) based on the IEEE 802.11 standard that allows devices to connect to a broadband network wirelessly. The network consists of one or more access points also called as hotspots. Multiple access points help in extending the coverage of Wi-Fi. They provide internet access to computers equipped with wireless network interface controller called stations.
Raspberry Pi is a very small single board computer. Equipped with standard input and output devices it can be made to function like a desktop computer. It can also be made to interact with the environment when electronic sensors are interfaced with the Raspberry Pi. This has made Raspberry Pi extremely popular among hobbyists and hackers.
Requirements for the Raspberry pi internet radio:
- Raspberry Pi
- LCD Shield
- WiFi USB Dongle
- Loud speaker or Headphones.
Steps to set up the Wi-Fi Raspberry pi internet radio:
Step 1 :- Setting up Raspberry Pi
The Raspberry Pi has to be set up before it is used for any application. This includes loading an operating system and updating software. The recommended operating system is Raspbian but the computer supports a long list of Gnu\Linux distributions, operating systems based on BSD and Microsoft Windows. Our application requires access to Wi-Fi and remote access to the Raspberry Pi which needs further tweaks. This initial set up is very similar to that discussed in another tutorial accessible from this link- Raspberry Pi as low-cost HD surveillance camera
Step 2:- Expanding rootfs
The next thing to do is to expand the rootfs filesystem so that the root partition does not run out of space. This is different from regular partitioning because we are dealing with a partition that will not be unmounted.
Step 3 :- Creating a new folder
Once the rootfs filesystem is expanded, login to the Raspberry Pi as root from your laptop. A tool that will come handy this time is WinSCP or Windows Secure Copy that lets secure file transfer to a remote computer. We need to create a folder inside the /home/pi folder where we can put some software. Let us name the folder radio. Gnu\Linux users can do the same by first logging in as regular user over ssh and then switching to root account using the sudo command.
Step 4 :- Downloading software
At this point Windows users may make use of another software for logging into the Raspberry Pi from their laptop called PUTTY. Gnu\Linux users shall continue using their terminal. In order to download the software to the newly created folder we have to first change the directory and enter the folder. One can use a download manager like wget to download the software. The downloaded file is a tarball which needs to be decompressed.
tar -xvf pi_radio.tar.gz
Step 5 :- Connecting the LCD Shield
The LCD shield provides us an interface to the internet radio for viewing the details about the station and switching between stations. We have to shut down the Raspberry Pi using the shutdown –h now command and turn the power supply off so that we can connect the LCD shield to our Raspberry Pi.
Step 6 :- Activating I2C management module
We need to configure the I/O lines of MCP2307 chip on the LCD shield over the i2C bus. The I2C management module has to be activated before proceeding to configure MCP2307 pins. This can be done by accessing the list of blacklisted modules and removing or commenting I2C module.
After making necessary changes press 'ctrl+o' to save the file. Reboot to let the changes take effect.
Step 7 : Loading modules in the Kernel at boot phase
Use nano as in the previous step but this time to access /etc/modules. Add i2c-dev into the configuration file. Check if the module has been loaded using lsmod command and double check by looking for links to the devices in the /dev directory.
Step 8 : Checking if I2C module is visible to ADC
apt-get install i2c-tools
adduser pi i2c
i2cdetect -y 0 per RaspberryPi rev. 1
Step 9 : Installing the LCD support library
apt-get install git
git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
apt-get install python-smbus
Step 10 : Installing Music Player Daemon
sudo apt-get install mpd mpc
Step 11 : Modifying parameters in the MPD configuration file
Open the mpd.conf file in the /etc directory using nano and change "bind_to_address" from "localhost" "any" and "zeroconf_enabled" from "yes" to "no".
Step 12 : Checking MPD
Connect a loud speaker or a headphone to the audio output jack of your Pi adn type the following commands.
sudo service mpd start
sudo mpc load ukblues.pls
sudo mpc play 1
Step 13 : Starting MPD using Web
This requires installing a web server and and a web front end.
sudo apt-get update
sudo apt-get install apache2 php5 libapache2-mod-php5
tar -xvf /home/pi/radio/pi_radio_web.tar.gz
service mpd start
Now enter the IP address of your Pi on a web browser. From the displayed web page choose Web Interface and you are ready to go!