Pandora's Box - An Internet Radio player made with a Raspberry Pi!

FeaturedContest WinnerContest Winner

Step 3: Installing Pianobar

Picture of 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.
Peter Roca6 months ago

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

sgehring2 years ago
When installing with apt-get the .config/pianobar directory is not getting created plus i get a TLS handshake error. Is anyone else experiencing this?
Ayy (author)  sgehring2 years ago
Are you sure .config isn't being created? Not knowing your knowledge of linux, I want to mention that .config is a hidden file - but if you type "cd ~/.config" in the terminal it should come up. If the folder still doesnt exist, just make the directory ("mkdir ~/.config/pianobar") then create the "config" file with the example I gave in the instructions.

The handshake error should be fixed by this process. Occasionally Pandora updates the tls_fingerprint value. If this is still an issue, look at the pianobar github issues page.

Hope this helped!
ddaily1 Ayy1 year ago
How do I create the config file?
I have the newest fingerprint 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0

but i still have the TLS handshake failed issue (this was working 3 days ago, and when i check the tls fingerprint with a code found here http://learn.adafruit.com/pi-wifi-radio/raspberry-pi-setup-3-of-3

it returned the same code found above. Please help me!
kaplow2 years ago
I am having the same problem as sgehring and aasselhoff. When I installed pianobar, the entire .config directory was missing, including anything inside of it, such as the config file or eventcmd. I followed your instructions and created /.config/pianobar and wrote the necessary information into the config file, but whenever I start pianobar, I get a "no such file or directory" error for eventcmd.
ianrab2 years ago
I had many issues getting even this far, but after much searching, I found this:


It helped a whole bunch. I followed the directions precisely, and when I had an error, I tried running as the other user (between root and pi). Also, I set the permissions on the folders for read and write for all users. Not sure if that alone helped, but it made me feel better.
aasselhoff2 years ago
For those who get TLS Handshake Error, this works for me:

Changing TLS_Fingerprint to: "tls_fingerprint = 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0"

but i'm getting an eventcmd error that (No such file or directory)
but what i have to do to fix it? haven't got any clue.