Boblight Web GUI Control RaspBMC

Boblight GUI Control

Since setting up an boblight on my RaspBMC, I’ve been wanting a nice gui to manage it; turn it on and off, change colours.

I was going to make a plugin to improve my Python knowledge but decided a web plugin would be more flexible as it would be controllable from any device. Using Chris Oattes’ TV Control page as base, I moulded the PHP to be compatible with the standard RaspBMC setup, which currently uses the boblight-dispmanx service. The standard XBMC web server doesn’t support PHP and I couldn’t figure a way of getting it to, so my solution requires setup of another lightweight webserver: lighttpd:

sudo apt-get update
sudo apt-get install lighttpd
sudo apt-get install php5-common php5-cgi php5
sudo lighty-enable-mod fastcgi-php

You’ll get an error as lighttpd will try to assign to the default web port 80 but libmicrohttpd will already be running on that. You could disable it but I use for remote control. Instead change the default port to something else, I use 3000:

vi /etc/lighttpd/lighttpd.conf

Change server.port = 80 to 3000. Then sudo service lighttpd force-reload

Set the permissions for the server folder:

sudo chown www-data:www-data /var/www
sudo chmod 775 /var/www
sudo usermod -a -G www-data pi

Now all that is left is to copy my boblight control page to the /var/www directory:

tar -zxvf boblight.tar.gz
mv -r boblight /var/www
chmod -R 775 /var/www/boblight

Visit http://[your raspbmc ip]:3000/boblight to set any static LED colour, disable the dynamic lights or turn off the lights all together. I plan on adding function to edit the boblight.conf settings and implementing some more visual effects.

8 replies on “Boblight Web GUI Control RaspBMC”

Thanks. Because it requires a web server and php, I’m not sure how you would install those on OpenElec – I haven’t used it but know it isn’t based on a linux operating system like other XBMC installs. I’d like to get this into a simple XBMC add-on for the included web server, but can’t find a way to execute shell commands with Javascript.

Running it on a separate system is definitely doable, so you could go down that route to control an OpenElec system. You’ve have to install boblight on the separate system, setting it to connect to the OpenElec server, rather than local host.

Sounds like the permissions for the /var/www folder aren’t set. cd var‘ and ls -l. It should be:

rwx rwx r-x

on the left.

Run chmod -R 775 /var/www if it isn’t.

I’m. A total novice at this. I dont understand the above permissions bit but I executed the chmod cmd and i now get the web page controller . Controls don’t do anything though. I have rebooted pi etc..

It’s probably something to do with the web server not having the right to run the php commands. You need to set some server logging to find out. Can’t say much more without more information.

It’s also over a year since I did this so things may of changed. I no longer use RaspBMC so can’t test I’m afraid!

Leave a Reply