Step 3: Installing Pianobar

Pianobar is an open-source, lightweight terminal program which runs Pandora Radio. Although the Pi is limited in resources, a lightweight application like Pianobar is right at home.  Setup is simple - run the following from a terminal:

sudo apt-get install pianobar

After entering "y" to all the prompts, Pianobar should be successfully installed. By entering pianobar in a terminal, the program begins. Log into your  Pandora account, and get a feel for the program. (Hint: typing "?" will give a list of keybindings for controlling Pianobar)

This installation has a directory for configuration files located in /home/pi/.config/pianobar. Our next step is setting up configurations for Pianobar, an example of which is given below. (Note that the login information needs to be replaced with your own Pandora account information).

Copy the following into a new file "config" in the /home/pi/.config/pianobar directory, changing the login information:

# This is an example configuration file for pianobar. You may remove the # from
# lines you need and copy/move this file to ~/.config/pianobar/config
# See manpage for a description of the config keys
# User
user = your@user.name
password = password
# or
#password_command = gpg --decrypt ~/password

# Proxy (for those who are not living in the USA)
#control_proxy =

# Keybindings
act_help = ?
act_songlove = +
act_songban = -
act_stationaddmusic = a
act_stationcreate = c
act_stationdelete = d
act_songexplain = e
act_stationaddbygenre = g
act_songinfo = i
act_addshared = j
act_songmove = m
act_songnext = n
act_songpause = p
act_quit = q
act_stationrename = r
act_stationchange = s
act_songtired = t
act_upcoming = u
act_stationselectquickmix = x
act_voldown = (
act_volup = )

# Misc
#audio_quality = low
autostart_station = 123456
event_command = /home/pi/.config/pianobar/scripts/eventcmd.sh
fifo = /home/pi/.config/pianobar/ctl
#sort = quickmix_10_name_az
#love_icon = [+]
#ban_icon = [-]
#volume = 0

# Format strings
#format_nowplaying_song = %t by %a on %l%r%@%s
#format_nowplaying_station = Station %n
#format_list_song = %i) %a - %t%r

# high-quality audio (192k mp3, for Pandora One subscribers only!)
#audio_quality = high
#rpc_host = internal-tuner.pandora.com
#partner_user = pandora one
#partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
#device = D01
#encrypt_password = 2%3WCL*JU$MP]4
#decrypt_password = U#IO$RZPAB%VX2
tls_fingerprint = B0A1EB460B1B6F33A1B6CB500C6523CB2E6EC946

After setting the configuration file, restart pianobar from a terminal. It now automatically logs us into Pandora, and ask what station to play. After selecting a station, an 18 letter number will appear in parenthesis. By copying this number into the config file under autostart_station, Pianobar will automatically start playing that channel once it is opened.

If you are a Pandora One subscriber, additional settings in this config file will let you access high-quality streaming.
<p>This doesn't seem to have been updated in a long time... As it will hopefully help anyone else attempting this build, here is a link to the Adafruit Tutorial for their Raspberry Pi Pandora Radio build. The old Pianobar install instructions here, and elsewhere, don't work! Follow the Adafruit Tutorial's section on installing Pianobar and you'll be all set! Here is the link: https://learn.adafruit.com/pi-wifi-radio/raspberry-pi-setup-1-of-3</p>
<p>Thanks for the updated link - I have not touched this instructable in nearly 2 years, so it's bound to be pretty outdated. Unfortunately I have not spent much time with the RPI lately.</p><p>I've stickied your comment for visibility. Hope the project went well for you!</p>
<p>Thanks! It did go very well. I made a PCB version of your breadboard setup and had all the parts on order but they took so long to get here that I went with the Adafruit kit as a part of my project.(Hint: It's not JUST a radio.) I'll still have to make another using your setup since I basically have all the wiring done... My project will be up on Instructables in a week or two. It's a bit of a different approach but I think you'll enjoy it! I've linked back here in it and gave you a bunch of credit for the inspiration!</p>
Can someone explain to me the point of using 5v and a regulator to get to 3.3v when there is a 3.3v supply from the pi. I am fairly new to this stuff and am just trying to learn. Thanks.
That's a really good question. The answer has to do with the current limit on the Raspberry Pi's 3.3V line. According to the link below, the 3.3V line can output up to 50 milliamps current. Meanwhile, the 3.3V LCD module I used can draw up to 60 mA.<br> <br> While LCD may never draw that full 60 mA, it has the potential to cause issues. Since the 5V supply can supply over 300 mA (when using a 1A power supply), I chose to add the 3.3V regulator. &nbsp;<br> <br> RPi electrical specs:&nbsp;<a href="http://elinux.org/RPi_Low-level_peripherals" rel="nofollow">http://elinux.org/RPi_Low-level_peripherals</a><br>
Could i get an estimate of the cost? i really would like to do this project, and i am a beginner..
This depends on what equipment you already have. For example, I already had soldering equipment, drill and tap set, standoffs, SD card, and resistors. I'll give some prices for the bigger items: <br> <br>Raspberry Pi: $35 + shipping <br>Power Supply: $8 + shipping <br>T-Cobbler: $8 + shipping <br>Serial LCD Monitor: $25 + shipping <br>Buttons: $7 <br>Acrylic Sheets: $8 <br>Epoxy: $5 <br>Capacitors: $2 <br>Velcro: $5 <br> <br>The small things tended to add up quickly - like the bits I had to get from Radioshack and Lowes (buttons, capacitors, velcro, etc). I probably could have gotten some things much cheaper online, but I didn't have the patience to wait for the velcro to ship. All the parts were around $110 with shipping - but since I plan on reusing most of the stuff for future projects, the cost felt reasonable. <br> <br>Hope that helps.
thats very helpful thanks <br>
Note: On the box plans, the center piece has an issue with the spacing of the raspberry pi's holes. If you are making the same box, double check the holes (I don't have the original files to correct the images...)
<p>Very nice and interesting work</p>
<p>Its useful :)<br></p>
<p>Would anybody be interested in my version? I made it using Python only (no Bash) it works using only 3 buttons and 2 LEDs and a motion sensor (no screen). Total cost is around $45 US including the Raspberry, a pack of LEDs, a pack of resistors, female to female jumper wires and an empty Tea Box. </p>
<p>Hey Jay - I'd be really interested to see your software! Do you have it on a repo?</p>
<p>very helpful thanks</p>
<p>Thats outstanding</p>
<p>Good one</p>
<p>Great one</p>
<p>If anyone is interested I did a PCB layout for the buttons and attachment to the LCD screen. A lot more work than using a breadboard but it saves space and doesn't tie up your breadboard in the process. Send me a message if you want the file! </p><p>R1-R7 are 10K</p><p>R8-R13 are 1K</p><p>I'm going to try etching it with the toner transfer method. We'll see if it takes...</p>
<p>very good</p>
<p>Thats awesome</p>
<p>This looks really cool, but I don't have access to a place to get the housing. Could it be, say, 3D printed? Then a company like Shapeways (or a friend with a 3D printer) could make the model. What would be involved in making that into a model?</p>
<p>Its useful :)</p>
<p>The apt-get version of pianobar is out of date I believe, which is the reason it doesn't work. You'll have to install from github</p>
<p>Pretty neat project. I added an Adafruit 20W stereo amp and a couple scavenged speakers from an old iHome iPod dock that died. Now I just need a case.</p><p>Thanks!</p>
<p>Question for a beginner :</p><p>Can someone tell me if this lcd module could work instead of the Sparkfun :</p><p><a href="http://www.amazon.fr/MODULE-AFFICHEUR-16X2-ECRAN-RETRO-ECLAIRE/dp/B00AT8KGF2/ref=sr_1_1?ie=UTF8&qid=1408520724&sr=8-1&keywords=module+lcd#productDetails" rel="nofollow">http://www.amazon.fr/MODULE-AFFICHEUR-16X2-ECRAN-R...</a></p>
<p>Its magnificent</p>
<p>Its sweet</p>
<p>Its cooler</p>
<p>Extremely good</p>
<p>Its splendid :)</p>
<p>Thats impressive</p>
<p><br>Very good<br></p>
<p>Its awe-inspiring :)</p>
<p><br>Its stunning :)<br></p>
<p>Could i get an estimate of the cost?</p>
<p><br>Thats trendy...<br></p>

About This Instructable


1,130 favorites


More by Ayy: Pandora's Box - An Internet Radio player made with a Raspberry Pi!
Add instructable to: