I didn’t want to get out a soldering iron and wire up some LEDs to my Pi, so I decided to go down the LightPack route and hope I could get it to work to enjoy Boblight on XBMC – and I did!
[EDIT] Ive moved on to Hyperion and a WS2801 LED strip if you’d like to read how to do this – Click here
Here’s how to do it….
- 1 Raspberry Pi
- 1 LightPack
- and….. THATS IT!
1 – Buy a LightPack
2 – Install Raspbmc
See http://www.raspbmc.com/download/ for instructions.
3 – Install and Configure Boblight
This is really easy now thanks to Sam Nazarko and Raspbmc – Sam has incorporated all you need to get going other than a config file. Ive based this bit for testing so I suggest doing all of this before jumping in and sticking the lights on the TV.
- Go into the Raspbmc settings add on under programs
- Go to System Configuration
- Scroll down to Service Management
- Select Boblight Support
- Click OK
Now you need a configuration file. Ive done one up so this too should be pretty easy. these instructions are based on using a windows PC for management. You need a few things before you can copy the file to the Pi.
Ok so now we need to set up root access on the Pi – this is needed so we can copy the config file to the \etc location on the Pi. First we need to find out the Pi’s IP address
- On the Pi go to Settings -> System Info
- Note the IP address down
Next we need to SSH to the Pi and set root access
- Follow this guide to establish SSH access for the first time
- Follow this guide to set up root access
Now we can copy the config file
- Connect to your pi using WinSCP, logging in as root and using the IP address you used above.
- navigate to /etc
- copy the boblight.conf file from above to this location
Reboot your Pi and you should be good to go! The lights can take a brief moment to start but they should come on and be active for both the XBMC interface and any media you play.
If you are happy with a set and forget, you can stop reading here…..
Understanding the Config file
The Config file I have made up is designed for use with Speedy’s boblight daemon and the LightPack – you shouldn’t need to change much, and it should work as-is.
Here’s a great link to generic info on the config file but I thought I might help with some LightPack specifics.
Speedy’s boblight daemon uses optimised string searching and it is important that three letters are used for most things
This can be any three letter name and is used to match the [Light] section to the device as boblight can be used with multiple devices
LightPack has 10 strips, each of these, no matter how many LEDs change colour at the same time, so the number of channels calculates to the number of LED strips x 3 colours (red, green and blue), therefore, if for some reason you only wanted to use say 8 strips, this would equate to 24 channels
This must remain as lightpack, so that the software knows what’s plugged in
This specifies the update interval in microseconds. 20000 equates to an update 50 times per second.
These lines are commented out (# at the front of a line makes it a comment) but the first two lines are used to define the USB bus and USB address of the device. You can find these out starting up the boblight daemon from a command prompt, but this is only really needed if you want to run more than one device.The debug line I haven’t yet worked out how to get the output of, but also haven’t really needed to either.
There are three color sections each for red, green and blue – you need to modify each one individually.
This is the name of the color and must be three letters as well.
This is the HEX color code for each color. You can tweak these if you want to get really good color matching if you want (there are some other ways of tweaking below as well)
This is optional but I made this 1.6 it affects the luminescence of the color a bit. If you don’t include this it gets set to 1.0 by default and the setting can more or less than this value.
This is also optional and I have got it in there as the default but can go down to 0.0. It is a multiplier for the color. I didn’t find this made much difference playing with it.
I don’t really know what this does, the documentation refers to it ranging from 0.0 to 1.0 but I didn’t find it did much playing with it and only in there to make it easy to fiddle for people.
color red LP1 1
color blu LP1 2
color grn LP1 3
hscan 0 33
vscan 0 20
There will be 10 [light] sections, one for each of the LED strips for the LightPack
This is the name of the strip and must be three letters. I found it useful to name them sequentially so they were easy to identify which strip was which for tweaking their position. See the Placing your lights on your TV for more info on this.
color red LP1 1
OK so now it starts to all come together, each strip has all three colors and these use the names you defined in the [color] section above. The next part of this is the name you defined in the [device] section. The last is a number for the channel (remember 3 colours with 10 strips = 30 channels that you also defined in the [device] section). The channel needs to be unique (so the next [light] section for the second LED strip will have the same 3 colors, the same device name, but will be channel number 4,5 and 6)
This is the horizontal scan range this LED strip will sample of the TV. The first number is the start range, the second is the end range. For my TV, I have 3 LED strips across the top. This hscan example is for LED strip 1 which is in the top left corner of my TV, so the scan starts at 0 (the very left) and goes in 33% (therefore strip 2 that is in the top middle is 33 – 66, strip 3 in the top right is 66-100)
This is the vertical scan range this LED strip will sample of the TV. The first number is the start range, the second is the end range. It’s basically how far in to the picture to sample the image. A finish value of 20 will cater for black bar movies (just).
Obviously the hscan and the vscan work the opposite way when you are working with the LEDs on the sides of the TV. The config file is designed to start LED strip 1 at the top left of your TV with 1,2,3 across the top (left to right) , 4 and 5 down the right, 6,7,8 across the bottom (right to left) and finally 9,10 up the left.
Heres as diagram I started showing the hscan and vscan units to try and help if you are a bit stuck.
If you make any changes to this file, it is only read when the boblight daemons are started – I could work out a way to stop and start the two daemons so I rebooted the Pi after each change.
The adjustments I have made to the colors I found OK – far from a perfect match but this is where I have got to so far. To help calibrate, I created some videos to use. The first three are pure red, pure green and pure blue, and then the last one has some movement of color with some pauses to help you with hscan and vscan on each strip (thanks to a YouTube publisher for this).
Feel free to download these, add them to your movie library and play them to see your results (and have a laugh at what the movie scraper uses from IMDB)
Link to calibration file (95mb)
Placing the lights on your TV
So once you have tested and configured everything, its time to put the lights on your TV – this can be a bit tricky as for my LightPack, the sequence of strips didn’t logically go down one side and up the other. What I did was to change the boblight.config file to have just 3 channels. This meant that only one LED strip would light up.
Heres the config file in full:
color red LP1 1
color grn LP1 2
color blu LP1 3
hscan 0 33
vscan 0 20
I then rebooted the Pi and watched what LED strip came on. when it did, I marked L01 on the ribbon cable with a sharpie. I then just added 3 to the channel, added the next [light] section for L02 and rebooted. The next strip lights up – I then mark that ribbon cable with a sharpie L02. Do this for all 10 and you know which strip matches which [light] section in your config file.
Next I stuck the LED strips round my TV with Blue tack and ran the calibration video and of course, the avatar torch scene to test. Once I was happy, I stuck down the LED strips and tidied up the cables and I was done.
I’m yet to find a nice add on that will turn my lights on and off – the best I have found is called boblight switch which works for turning them off, but I have to reboot to turn them back on.
I hope this helps anyone exploring a LightPack option for Raspbmc.