Software Setup

Monsur Hossain edited this page Apr 24, 2015 · 3 revisions
Clone this wiki locally

This will guide you through the steps for installing sonos-now-playing on a new Raspberry Pi.

Install Raspbian

Update Raspbian using sudo apt-get update && sudo apt-get upgrade

Run raspi-config and enable SSH as well as boot-to-gui

Install node and npm. The instructions below are from from http://raspberryalphaomega.org.uk/2014/06/11/installing-and-using-node-js-on-raspberry-pi/

sudo su -
cd /opt
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-arm-pi.tar.gz
tar xvzf node-v0.10.28-linux-arm-pi.tar.gz
ln -s node-v0.10.28-linux-arm-pi node
chmod a+rw /opt/node/lib/node_modules
chmod a+rw /opt/node/bin
echo 'PATH=$PATH:/opt/node/bin' > /etc/profile.d/node.sh
^D

Install global prereqs

npm install -g grunt
npm install -g grunt-cli
npm install -g nodemon

Install sonos-now-playing

git clone https://github.com/monsur/sonos-now-playing.git
cd sonos-now-playing
npm install
grunt

Install Chromium

sudo apt-get install chromium

Update the paths in bin/autostart and bin/run.sh (if necessary).

Copy bin/autostart over /etc/xdg/lxsession/LXDE-pi/autostart

Screensaver config

The app can be configured to power off the screen after 15 minutes. In order to get this to work, the server needs to be able to call the sleep.sh and wake.sh shell scripts. I took a few liberties to make this work. This probably isn't the best practice security-wise, but it works.

Make the tvservice and chvt tools suid:

chmod u+s /opt/vc/bin/tvservice
chmod u+s /bin/chvt

Grant execute permissions to the two shell scripts:

chmod 755 ./bin/sleep.sh
chmod 755 ./bin/wake.sh