Installing Pianobar on Raspberry Pi

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

# install dependencies

sudo apt-get install git libavcodec-dev libavformat-dev libavfilter-dev libcurl4-gnutls-dev libao-dev libmad0-dev libfaad-dev libjson0-dev libgcrypt11-dev

# install pianobar manually from source

git clone https://github.com/PromyLOPh/pianobar.git

cd pianobar

make && sudo make install

sudo cp pianobar /usr/bin

# Make sure audio is routed to the headphone jack rather than the HDMI port

# (you can skip this step if using a USB audio device)

sudo amixer cset numid=3 1

# Create a folder called pianobar in /home/pi/.config

mkdir /home/pi/.config/pianobar

# Create /home/pi/.config/pianobar/config

nano /home/pi/.config/pianobar/config

# and add the following:

autostart_station = 546398786227524465
tls_fingerprint = cat tls-fingerprint
user = [Pandora Email]
password = [Pandora Password]

# Create /home/pi/.config/pianobar/get-tls.sh

nano /home/pi/.config/pianobar/get-tls.sh

# and add the following:

#!/bin/bash
##
## A simple little shell script that will return the current
##  fingerprint on the SSL certificate.  It’s crude but works 😀
##
## Author: Bob Saska (r35krag0th)

openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null |
openssl x509 -noout -fingerprint | tr -d ‘:’ | cut -d’=’ -f2 > ~/.config/pianobar/tls-fingerprint
# Create /home/pi/Desktop/Pianobar.desktop

nano /home/pi/Desktop/Pianobar.desktop

# and add the following:

[Desktop Entry]
Name=Pianobar
Comment=Plays Pandora Music
Icon=/usr/share/pixmaps/openbox.xpm
Exec=pianobar
Type=Application
Encoding=UTF-8
Terminal=true
Categories=None;
# Create /home/pi/Desktop/Fix.desktop

nano /home/pi/Desktop/Fix.desktop

# and add the following:

[Desktop Entry]
Name=Fix Pianobar
Comment=Updates TLS Fingerprint
Icon=/usr/share/pixmaps/openbox.xpm
Exec=sh /home/pi/.config/pianobar/get-tls.sh
Type=Application
Encoding=UTF-8
Terminal=false
Categories=None;
# Create /home/pi/Desktop/Website.desktop

nano /home/pi/Desktop/Website.desktop

# and add the following:

[Desktop Entry]
Name=Website
Comment=Displays a URL in browser
Icon=/usr/share/pixmaps/openbox.xpm
Exec=x-www-browser https://upods.net
Type=Application
Encoding=UTF-8
Terminal=false
Categories=None;
# Disable Xsession from blanking
# Add these lines to /etc/xdg/lxsession/LXDE-pi/autostart
@xset s noblank
@xset s off
@xset -dpms

 

References

Pianobar: Command line Pandora client HOWTO

https://learn.adafruit.com/pi-wifi-radio/raspberry-pi-setup-1-of-3

https://gist.github.com/r35krag0th/4173333

Desktop Shortcuts

https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=57552