For those of you who aren’t acquainted with pianobar on the Pi yet, pianobar is a free/open-source console-based client for the online radio Pandora. Essentially it allows you to access Pandora via the command line and in doing so remove the resource intensive Flash Player from the equation. The interface is simple, intuitive and the navigation & playback were both very responsive. Pianobar by design is also a bit more flexible than it’s XBMC Counterpart.
For example: I can run pianobar from within my desktop environment, via command line, call it from scripts or voice-commands!
1.) First we need to make sure we are up to date:
sudo apt-get update
sudo apt-get upgrade
2.) Then we need to install pianobar
sudo apt-get install pianobar
3.) Next we will want to create our pianobar config file….
sudo nano config
4.) Now we want to populate the config file that pianobar is going to use:
(Example Config file can be found /usr/share/doc/pianobar/contrib/config-example)
Make sure that you replace the user & password entries below with YOUR Pandora account information.
**Now would also be a good time to customize your keybindings or set your autostart_station.
# 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 = firstname.lastname@example.org
password = password
#password_command = gpg --decrypt ~/password
# Proxy (for those who are not living in the USA)
#control_proxy = http://127.0.0.1:9090/
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 = )
#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 = [32m%t[0m by [34m%a[0m on %l[31m%r[0m%@%s
#format_nowplaying_station = Station [35m%n[0m
#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 = 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0
**Note the tls_fingerprint at the end of the config file. The one listed in this config file is up to date and working as of today’s date. (4/1/2014) If you receive the below error when running pianobar:
(i) Login… Network error: TLS handshake failed.
Pandora has changed the certificate used for making a secure connection, in which case you will need to update it![learn_more caption=”To Update TLS cert…”]
User r35krag0th over at Github has written a simple script to grab the latest key.
Simply create the script file like so:
sudo nano pandora_tls
## A simple little shell script that will return the current
## fingerprint on the SSL certificate. It's crude but works :D
## Author: Bob Saska (r35krag0th) <email@example.com>
openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \
openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2
Then to run it:
sudo bash ./pandora_tls
It should then return the latest TLS cert needed.
(In the below example I named my script ssl)
5.) When all is said and done, you should be able to simply run:
You should then be greeted by your list of radio stations….
- If you are running a RetroArch Emulator (Like UltraSlim). You can easily create a script to run it from the /Roms/apps directory.
1234#!/bin/bashpianobar#Ctrl+C to exit
- Control Pianobar from your Android Phone w/ – PianoBar Remote Control
- Pianobar Man Page: HERE.
- Pianobar Project Page: http://6xq.net/projects/pianobar/
If you have any questions /comments please share below.