Raspberry Pi running Ambient light
Build
On this article I will assume that openelec is already installed on Pi. Openelec image can be found from Raspberry Pi downloads or directly from get-openelec.
On my build I am taking power to APA102 led strip directly from RPi. That is now the way it should be done but it seems to work.
My configuration based on configuration used with WS2801 LED strip.
On Raspberry Pi 2 MOSI and SCLK pins are at the same position.
Hyperion
Hyperion is used to control led strip
Install Hyperion, see instructions on https://github.com/tvdzwan/hyperion/wiki/Installation-on-RPi-with-OpenELEC
On SSH command line get installation file
curl -L --output install_hyperion.sh --get https://raw.githubusercontent.com/tvdzwan/hyperion/master/bin/install_hyperion.sh
And run it
sh ./install_hyperion.sh
Hyperion configuration
Create configuration file by using HyperCon. See instructions on Git page https://github.com/tvdzwan/hyperion/wiki/configuration
To be able to use apa102 led strip following configuration changes need to be made on HyperCon
Type: |
Adalight |
Output: |
/dev/spidev0.0 |
Baudrate: |
900000 |
RGB Byte order: |
BGR |
Rest of the configuration on this page depend how many leds are used and how those are constructed. See more instructions from HyperCon Git
On Effect engine set
Directory: |
/storage/hyperion/effects |
On created hyperion.config.json file change Type from Adalight to apa102
And copy created configuration file hyperion.config.json in Openelec directory /storage/.config
Since we are using apa102 Leds we need to enable SPI on raspberry Pi. By default SPI is not available.
On SSH command line
mount -o remount,rw /flash nano /flash/config.txt
At the end of file add
dtparam=spi=on
Press Ctrl-x , Y , Enter to save changes
Set directory readonly
mount -o remount,ro /flash
And reboot Pi
reboot
When Openelec start led strip should show rainbow colors and Ambient light should be running.
Sources:
- openelec
- How to build your own Ambilight TV with Raspberry Pi and XBMC
- How to build an Ambilight for every HDMI input source
- Ambilight with Raspberry Pi and Openelec (part 1)
- Ambilight with Raspberry Pi and OpenElec (part 2)
- Ambilight from any video source with a Raspberry (part 3)
- github/hyperion
- HyperCon, config builder
- [DIY] Amblight project/guide – Hyperion – WS2801/ WS2812B / APA102