Setup Ambilight with Kodi & Boblight on Arch Linux

Ambilight with Boblight Add-on & Kodi / XBMC on Arch Linux

Boblight uses server-client model and consists of two component parts. The client component captures video or audio input, processes the stream and sends the resulting light data to the server. In this case the client is Kodi Boblight Add-On. Boblight daemon – boblightd runs in the background and translates the light data from the client into commands for the external light controller such a Arduino. Before configuring the software build Ambilight Clone with Arduino & WS2801 LED Pixels.

 

Install Boblight Daemon

Install PackerYaourt or use another package wrapper.

 

Install the package with packer.

packer -S boblight

 

Configure Boblight Daemon

Configuration can be created manually or copied and modified but it is quite verbose and can vary significantly depending on the LED strip count, protocol user and many other factors. The most efficient way is to use Boblight Config Maker tool to generate the configuration file. Download Boblight Config Maker for Windows, Linux or Mac.

 

[global] section consists of the two options that specify client location options. IP address of the client is defined with the interface option. If the server and the client are on the same machine this can be 127.0.0.1 but it will prevent connecting from outside such as with the BobDroid App. Ideally you should configure static IP on Arch Linux and enter the static IP address explicitly. Besides the IP address the port option also needs to be specified to connect to the client running boblightd. By default this is set to 19333 and there is generally no need to change this unless the port value setting is different on the server which in this case is the system running XBMC Boblight Add-on.

[device] section defines the options of the LED controller. The name option can be anything as long as it is unique. Protocol used by the device is specified with the type option. For Arduino this is momo and not WS2801 as illogical as this may appear at first glance. Interface that the LED controller is connected with is defined with the output option. For Arch Linux this is /dev/ttyACM0 but could be /dev/ttyUSB0 or other value for other Linux distributions. The number of LEDs is defined with the channels option. Since each LED contains 3 distinct colours the number of LED’s is multiplied by 3 so for WS2801 strip with 50 lights the values should be 150. Boblight sends a specific value before sending the actual light data and this is defined with the prefix option. This value should match up with the prefix value in the Arduino sketch. Update rate is set with interval option in microseconds. Value of 20000 will update 50 times per second. The baudrate of the LED controller is set with the rate option. This value should match the baudrate in the Arduino sketch. For troubleshooting purposes the debug option can be changed to on from the default off. This will print certain messages via serial port on Arduino console. To delay sending data to the controller set a value of delayafteropen in microseconds.

[color] sections define 3 colours with optional adjustments. The name option can be anything as long as it is unique to each section. Colour value is defined with rgb option in hex. Red being FF0000, green 00FF00 and blue 0000FF. The colour brightness can optionally be changed with the adjust option from 0.0 to 1.0. The minimum light level can be adjusted with blacklevel option ranging from 0.0 to 1.0. Brightness or more precisely gamma can be adjusted with the gamma option with values ranging from 0.0 to 3.0.

[light] section is used to define each individual LED that can be individually controlled with he LED controller. Title of the light is defined with the name option and can be anything as long as there are no duplicate titles. Each light should have all colours defined with the color option for each colour that the LED is capable of displaying. Colours are specified with the colour name followed by device name and device channel. Horizontal and vertical locations of the LED are specified with hscan and vscan respectively. Both options have a range in percentages from 0 to 100 percent.

 

Create the configuration file.

sudo nano /etc/boblight.conf

Copy the contents of the configuration file generated by Boblight Config Maker, paste it to the newly created configuration file and save.

 

Run Boblight Daemon

Start the systemd service.

sudo systemctl start boblight

 

Enable the systemd service to run on boot.

sudo systemctl enable boblight

 

Install Boblight XBMC Add-on

In Kodi / XBMC navigate to System -> Add-ons -> Get Add-ons -> Services -> XBMC Boblight -> Install. Once installed you can also configure XBMC Boblight Add-on with self explanatory options but the defaults are fine to get started.

 

Install BobDroid Android App

This is very much optional but the app can be useful for testing and makes it easy to demonstrate or show off your Ambilight set up to others. BobDroid lets you take control of your screens back-lighting manually with several modes such as solid colour, rainbow or music activated colours.

dom