Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hardware:
- Raspberry Pi: http://www.amazon.com/Raspberry-Pi-Model-Revision-512MB/dp/B009SQQF9C/ref=sr_1_1?ie=UTF8&qid=1377009198&sr=8-1&keywords=raspberry+pi
- WiFi Dongle: https://www.modmypi.com/wireless-usb-1n-nano-adaptor-802.11N-wifi-dongle (Ralink 5370 Chipset)
- MicroSD Card Adapter: https://www.modmypi.com/sd-cards-and-adaptors/raspberry-pi-micro-sd-card-adaptor-mmp
- MicroSD Card: http://www.amazon.com/SanDisk-microSDHC-Memory-Adapter-SDSDQUA-016G-U46A/dp/B007XZL7PC/ref=sr_1_6?s=electronics&ie=UTF8&qid=1377009618&sr=1-6&keywords=sandisk+ultra+micro+sd
- Case: http://www.amazon.com/Raspberry-Pi-Case-Enclosure-Black/dp/B00AZL16S4/ref=sr_1_sc_2?s=electronics&ie=UTF8&qid=1377009744&sr=1-2-spell&keywords=raspberypi+case
- Power supply (5v 2 a): http://www.amazon.com/EasyAcc-Universal-Travel-Charger-Adapter/dp/B00A9PO5AM/ref=sr_1_3?ie=UTF8&qid=1377010161&sr=8-3&keywords=raspberry+pi+power+supply
- Ethernet cable
- HDMI cable
- HDMI/DVI Converter (if necessary)
- USB Keyboard
- Suggested Software:
- SD Card formatting tools
- Mac: https://www.sdcard.org/downloads/formatter_4/eula_mac/
- PC: https://www.sdcard.org/downloads/formatter_4/eula_windows/
- SSH Client (PuTTY for PC, Terminal for Mac or etc)
- Raspbian “Wheezy” - Debian-based Linux OS
- http://www.raspberrypi.org/downloads
- Creating an OS image on your SD card:
- Download the latest version of Raspbian ‘Wheezy’ here: http://www.raspberrypi.org/downloads
- Unzip and drop the file in your ‘downloads’ folder
- Place your micro SD card in the adapter
- Place the adapter in a card reader attached to your computer
- Open the Mac or PC SD card formatting tool
- MAC: Select “Overwrite Format” PC: Set "FORMAT SIZE ADJUSTMENT" to "ON" in the "Options" menu
- Select your SD card, not any other internal or external HD.
- Click format
- Creating a bootable disk for Raspbian Wheezy is easy to do from the command line.
- Open Terminal (or use Disc Utility on Mac)
- Get the disk name:
- $ df –h
- Unmount the disk.
- $ umount /dev/sdb1 # sdb1 is the example disk name
- Write the ‘Wheezy’ image to the SD card
- $ dd bs=1M if=~/Downloads/2012-08-16-wheezy-raspbian.img of=/dev/sdb # make sure to change the path and file name
- Clear the write cache
- $ sudo sync
- 5. Safely eject the SD card
- The easiest set-up process at this point is to plug the Pi into an Ethernet connection, an external monitor and a USB keyboard. To try this headless (no monitor/keyboard) try this:http://n00blab.com/how-to-set-up-raspberry-pi-without-monitor/
- Place the SD card in the Pi (or the micro-SD adapter, then the Pi as appropriate)
- Connect the Ethernet, keyboard and external monitor
- If you are local or SSH the set-up is the basically the same.
- When prompted the defaults are:
- Username: pi
- Password: raspberry
- Launch the config program (if it is not already)
- $ sudo raspi-config
- Expand the file system
- Set Hostname to RadioBDCPi (or etc)
- Change the password
- Go to Advanced options
- Enable SSH
- Update Tool
- Exit
- Update the RaspberryPi OS
- $ sudo apt-get -y update
- $ sudo apt-get -y upgrade
- Install rpi-update (Firmware)
- $ sudo apt-get install -y git-core
- $ sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
- $ sudo chmod +x /usr/bin/rpi-update
- Backup current firmware:
- $ sudo cp /boot/start.elf /boot/start.elf.works
- Install the new firmware and restart
- $ sudo rpi-update
- $ sudo shutdown -r now
- Install the MP3 encoder
- $ sudo apt-get -y install alsa-utils mpg321 lame
- $ sudo modprobe snd-bcm2835
- # Set the audio output to analog (the last number in the below line would be: 0=auto, 1=analog, 2=HDMI)
- $ sudo amixer cset numid=3 1
- # Connect speakers and test the audio
- $ aplay /usr/share/sounds/alsa/Front_Center.wav #Plays an audio clip
- $ speaker-test -t sine -f 440 -c 2 -s 1 #plays a sine wave
- Install MPD and MPC
- $ sudo apt-get install -y mpd mpc
- $ sudo service mpd stop
- $ sudo chmod -R g+w /var/lib/mpd
- $ sudo chmod -R g+w /var/run/mpd
- Remove bind to address
- $ sudo nano /etc/mpd.conf
- Comment out the line: bind_to_address “localhost” or remove the entire line
- ctrl-o #to save
- ctrl-x #to exit
- Y
- Enter
- Reboot:
- $ sudo shutdown -r now
- Set up the RadioBDC playlist
- $ sudo nano ./bdcplaylist
- Copy and paste this text:
- !/bin/bash
- rm RADIO_BDC.pls*
- wget http://playerservices.streamtheworld.com/pls/RADIO_BDC.pls
- grep "File1=" RADIO_BDC.pls > streamaddr
- mpc clear
- mpc add $(sed "s/File1=//g" streamaddr)
- mpc play
- rm RADIO_BDC.pls*
- ctrl-o #to save
- ctrl-x #to exit
- Y
- Enter
- Set the playlist to be executable
- $ sudo chmod +x ./bdclist
- Set the Pi to check the playlist and play when it boots up:
- $ sudo nano /etc/rc.local
- At the bottom enter:
- ./bdcplaylist
- ctrl-o #to save
- ctrl-x #to exit
- Y
- Enter
- Set up a cron job to refresh the playlist
- Check for a current crontab:
- $ crontab -l
- Most likely this will be returned:
- no crontab for pi
- Create a new crontab
- $ crontab –e
- Add this line:
- * */3 * * * ./bdclist # every three hours
- ctrl-o #to save
- ctrl-x #to exit
- Y
- Enter
- Set up Bonjour
- $ sudo apt-get update
- $ sudo apt-get install libnss-mdns
- On a PC – install Bonjour if necessary:
- http://support.apple.com/kb/DL999
- Make sure UDP port 5353 is not blocked
- Check to see that the hostname is set correctly – or edit it (bottom line alongside 127.0.1.1)
- $ sudo nano /etc/hosts
- Check to see the Pi is broadcasting on Bonjour
- dns-sd -B _workstation._tcp.
- Test if MPD is running:
- $ sudo netstat -apn|grep mpd
- Reference Links:
- Raspberry Pi quick start:
- http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf
- Formatting an SD card:
- http://elinux.org/RPi_Easy_SD_Card_Setup#Using_the_Win32DiskImager_program
- Installing the OS image via command line:
- http://n00blab.com/how-to-create-raspberry-pi-sd-card/
- Using cron on Raspberry Pi
- http://blog.davidsingleton.org/raspberry-pi-webcam-a-gentle-intro-to-crontab/
- Setting up Bonjour
- http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=18207
- http://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/
- Changing hostnames
- http://www.howtogeek.com/167195/how-to-change-your-raspberry-pi-or-other-linux-devices-hostname/
- How to troubleshoot MPD
- http://mpd.wikia.com/wiki/Music_Player_Daemon_HOWTO_Troubleshoot
- Setting up Node.js
- http://blog.rueedlinger.ch/2013/03/raspberry-pi-and-nodejs-basic-setup/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement