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!!!
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.
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
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.
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.
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.
cd /home/pi/radio
wget http://www.bobrathbone.com/raspberrypi/source/pi_radio.tar.gz
tar -xvf pi_radio.tar.gz
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.
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.
apt-get update
apt-get upgrade
nano /etc/modprobe.d/raspi-blacklist.conf
After making necessary changes press 'ctrl+o' to save the file. Reboot to let the changes take effect.
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.
apt-get install i2c-tools adduser pi i2c reboot i2cdetect -y 0 per RaspberryPi rev. 1
apt-get install git cd /home/pi mkdir LCD cd /home/pi/LCD git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git cd Adafruit-Raspberry-Pi-Python-Code cd Adafruit_CharLCDPlate apt-get install python-smbus
sudo apt-get install mpd mpc
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".
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
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 cd /home/pi/radio wget http://www.bobrathbone.com/ raspberrypi/source/pi_radio_web.tar.gz tar -xvf /home/pi/radio/pi_radio_web.tar.gz service mpd start /home/pi/radio/ada_radio.py 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!