Ryan Pusztai, 2016 (MIT/X11)
Control Pandora through a website using pianobar and libpiano.
The idea is to have a cheap headless server with audio that you can control through the web. A possible solution is a Raspberry Pi for $35.00. Then you can connect to it through any laptop, computer or phone and use the web browser to control the audio without being near the audio system. This can be helpful if you have builtin home audio system or you are out on the deck and want to change the music or check who is playing that current song.
The name is just a combination of Remote and Pandora.
-
Install LuaJIT 2.0+ and Pianobar. NOTE: Pianobar is old when you get it from the repository, so your results may very. Please see doc/notes.md for instructions on installing it from source. At this time I recommend installing it from source.
$ sudo apt-get install luajit pianobar libssl-dev liblua5.1-0-dev
If you are using a Raspberry Pi 2 I recommend using Pulse Audio by simply installing it. I found that there is a lot of static from the analog headphone jack. Installing pulseaudio
$ sudo apt-get install pulseaudio
Edit /etc/libao.conf
by changing default_driver=alsa to default_driver=pulse.
$ sudo nano /etc/libao.conf
-
Install LuaRocks
$ wget http://luarocks.org/releases/luarocks-2.2.2.tar.gz $ tar zxpf luarocks-2.2.2.tar.gz $ cd luarocks-2.2.2 $ ./configure; sudo make bootstrap
-
Install Turbo.lua and LuaJSON
$ sudo luarocks install turbo $ sudo luarocks install luajson $ sudo luarocks install penlight $ sudo luarocks install luasocket
-
Download the source from GitHub
-
Extract it to any location
$ unzip <remodora>.zip
-
Execute the
remodora
script from inside the directory you extracted the source to. If a prefix is needed then pass that as the first argument. A prefix is appended to the URL. This can be useful if you are running any other apps on the server or for using a proxy server. In normal operation this is probably not needed. Also change the href attribute of<base href="">
in the fileindex.html
to match any prefix you are using.$ ./remodora
or
$ ./remodora <prefix-if-any>
-
Open a browser and point it at
http://your-ip:8888/<prefix-if-any>
. -
Close Remodora after the first launch. It will create the config file template. Close Remodora and edit
~/.config/pianobar/config
. Change the file to match your Pandora login detailsuser = your@user.name password = password
When it loads for the first time it will take you to the settings dialog. Fill in your Pandora username and password. Please be aware that Remodora will be managing the pianobar settings file, so if you edit it by hand it will overwrite it.
9. Start Remodora again. Enjoy the music.
This will make Remodora start on boot and run as the user www-data
.
NOTE: Please review the settings in remodora.service
if you choose to store the files somewhere else.
-
Copy
Remodora
directory to/var/turbo/remodora
.$ mkdir /var/turbo $ cp Remodora /var/turbo $ mv /var/turbo/Remodora /var/turbo/remodora
-
Copy the
remodora.service
file to/etc/systemd/system/remodora.service
. $ sudo cp /var/turbo/remodora/remodora.service /etc/systemd/system -
Change the permissions of the file to 664.
$ sudo chmod 664 /etc/systemd/system/remodora.service
-
Reload systemd config.
$ sudo systemctl daemon-reload
-
Make the
.config
directory manually so that the user that runs the service can use to store Pianobars configuration.$ sudo mkdir -p /var/www/.config $ sudo chown www-data:www-data /var/www/.config
-
Allow the user
www-data
to play the music by addingwww-data
to the audio group in/etc/group
. -
Add the service to start automatically on boot.
$ sudo systemctl enable remodora.service
CAUTION! CAUTION! - Does not work at this because fifo
is not currently supported by the Pianobar Windows port.
- Install Lua for Windows
- Install the Windows version of Pianobar
- Configure Pianobar
-
Add your username and password to the config file
# User user = your@user.name password = password # or #password_command = gpg --decrypt ~/password
-
- Download the source from GitHub
- Extract the source
- Double-click on the
remodora.lua
. This will open a Command Prompt - Open your web browser and point it at http://your-ip:8080.
- Enjoy the music.