Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "OLA LED Pixels"

From wiki.openlighting.org

Jump to: navigation, search
m (Software Setup: udev config link)
Line 1: Line 1:
 
[[Image:Lpd8806.jpeg|300px|right]]
 
[[Image:Lpd8806.jpeg|300px|right]]
  
Since March 2013, [[OLA]] contains an SPI plugin, which allows you to drive strings of LEDs pixels provided your hardware has an SPI device. Using embedded Linux platforms like the [[OLA_Raspberry_Pi | Raspberry Pi]], this allows one to build  Pixel strings controlable via any of the [[OLA#Supported_Protocols|supported protocols]] ([[ArtNet]],  [[E1.31]],  [[OSC]] & more)   for < $100.
+
Since March 2013, [[OLA]] contains an [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus SPI] plugin, which allows you to drive strings of LEDs pixels provided your platform has an SPI interface. Using embedded Linux platforms like the [[OLA_Raspberry_Pi | Raspberry Pi]], this allows one to build  Pixel strings controllable via any of the [[OLA#Supported_Protocols|supported protocols]] ([[ArtNet]],  [[E1.31]],  [[OSC]] & more) for < $100.
  
Alternatively if you don't want network control, you can send [[DMX512]] to the LEDs using the Python, C++ or Java client library.
+
Alternatively if you don't want network control, you can send [[DMX512]] to the LEDs using the Python, C++ or Java client library running on the host itself.
  
== Supported Hardware ==
+
This page is focused on the Raspberry Pi, but may be applicable to other hardware such as the BeagleBone.  If you're using a Raspberry Pi you can save yourself a lot of time by using the pre-built images, see [[OLA_Raspberry_Pi| OLA on the Raspberry Pi]] for details.
  
On the host side, any SPI hardware supported by the Linux kernel should work correctly. By default OLA looks for devices in the form /dev/spi* . If you're using a Raspberry Pi you can save yourself a lot of time by using the pre-built images, see [[OLA_Raspberry_Pi| OLA on the Raspberry Pi]] for details.
+
== Host Hardware ==
  
On the LED pixel side the following is supported:
+
The Raspberry Pi contains three SPI interfaces, but only one of these is wired to the 26-pin connector. The interface comes with 3 chip-enable (CE) lines but again only two are connected (pins 24 & 26). With the default mode, pin 24 is pulled low when the /dev/spi0.0 device is used and pin 26 is pulled low when /dev/spi0.1 is used.
* LPD8806, e.g. https://www.adafruit.com/products/306
+
 
* WS2801, e.g. https://www.adafruit.com/products/738
+
Here are some timings taken from the Pi:
 +
 
 +
{| border=1 cellspacing="0"
 +
! SPI Speed !! Number of bytes || time taken for write()  !! Time on the wire
 +
|-
 +
|| 1MHz || 75 ||  13.5ms || 11.1ms
 +
|-
 +
|| 2MHz || 75 ||  8.1ms || 5.6ms
 +
|-
 +
|| 4MHz || 75 ||  4.7 ms || 3.0 ms
 +
|-
 +
|| 8MHz || 75 ||  3.7ms || 1.4ms
 +
|-
 +
|| 12MHz || 75 ||  3.2ms || 0.75 ms
 +
|-
 +
|| 1MHz || 516 ||  78.5 ms || 76.15  ms
 +
|-
 +
|| 2MHz || 516 ||  40.2 ms || 38.2ms
 +
|-
 +
|| 4MHz || 516 ||  21.5 ms || 19.1 ms
 +
|-
 +
|| 8MHz || 516 ||  12.2ms || 9.6ms
 +
|-
 +
|| 12MHz || 516 ||  7.4ms || 4.83 ms
 +
|-
 +
|}
 +
 
 +
It also takes somewhere between 3.6 and 4.6 ms to toggle a GPIO pin. The importance of these numbers will be clearer in a minute.
 +
 
 +
 
 +
Beyond the Pi, any SPI hardware supported by the Linux kernel should work modulo the timing numbers. By default OLA looks for devices that match the /dev/spi* .
 +
 
 +
== Pixel Hardware ==
 +
 
 +
On the pixel side the following is supported:
 +
* LPD8806, e.g. https://www.adafruit.com/products/306.  since 0.8.27
 +
* WS2801, e.g. https://www.adafruit.com/products/738, since 0.8.38
  
Only the WS2801 was supported in the 0.8.27 release. 0.8.28 added support for the LPD8806.
 
  
 
== Hardware Setup ==
 
== Hardware Setup ==

Revision as of 21:51, 13 September 2013

Lpd8806.jpeg

Since March 2013, OLA contains an SPI plugin, which allows you to drive strings of LEDs pixels provided your platform has an SPI interface. Using embedded Linux platforms like the Raspberry Pi, this allows one to build Pixel strings controllable via any of the supported protocols (ArtNet, E1.31, OSC & more) for < $100.

Alternatively if you don't want network control, you can send DMX512 to the LEDs using the Python, C++ or Java client library running on the host itself.

This page is focused on the Raspberry Pi, but may be applicable to other hardware such as the BeagleBone. If you're using a Raspberry Pi you can save yourself a lot of time by using the pre-built images, see OLA on the Raspberry Pi for details.

Host Hardware

The Raspberry Pi contains three SPI interfaces, but only one of these is wired to the 26-pin connector. The interface comes with 3 chip-enable (CE) lines but again only two are connected (pins 24 & 26). With the default mode, pin 24 is pulled low when the /dev/spi0.0 device is used and pin 26 is pulled low when /dev/spi0.1 is used.

Here are some timings taken from the Pi:

SPI Speed Number of bytes time taken for write() Time on the wire
1MHz 75 13.5ms 11.1ms
2MHz 75 8.1ms 5.6ms
4MHz 75 4.7 ms 3.0 ms
8MHz 75 3.7ms 1.4ms
12MHz 75 3.2ms 0.75 ms
1MHz 516 78.5 ms 76.15 ms
2MHz 516 40.2 ms 38.2ms
4MHz 516 21.5 ms 19.1 ms
8MHz 516 12.2ms 9.6ms
12MHz 516 7.4ms 4.83 ms

It also takes somewhere between 3.6 and 4.6 ms to toggle a GPIO pin. The importance of these numbers will be clearer in a minute.


Beyond the Pi, any SPI hardware supported by the Linux kernel should work modulo the timing numbers. By default OLA looks for devices that match the /dev/spi* .

Pixel Hardware

On the pixel side the following is supported:


Hardware Setup

TODO(someone): document this.

  • Connect the MOSI pin to the data line on the pixel string
  • Connect the SCLK pin to the clock line on the pixel string.
  • Connect one of the ground pins to the ground on the pixel string
  • Connect a 5V power supply to the pixel string.

Software Setup

You'll want to see here for suitable udev config, so OLA has permission to talk to your SPI port, as well as some Raspberry Pi specific config.


Once you have OLA running it's a matter of patching an SPI Output port to a universe and then patching the desired input port. This can be done from the OLA web UI, which runs on port 9090.

Example of an ArtNet controlled LED String

Configuration

The type of LED drivers, operating mode and DMX Start Address are configurable via RDM. Click on the RDM tab and you'll see the options.

Using RDM to set the hardware type and DMX start address


The number of LEDs and SPI speed is set using the ola-spi.conf file.

base_uid = 7a70:00000100
device_prefix = spidev
enabled = true
spidev0.0-dmx-address = 1
spidev0.0-personality = 1
spidev0.0-pixel-count = 25
spidev0.0-spi-speed = 100000
spidev0.1-dmx-address = 1
spidev0.1-personality = 2
spidev0.1-pixel-count = 25
spidev0.1-spi-speed = 100000

Related Links

http://www.solderlab.de/index.php/software/glediator (Pixel Control Software that outputs ArtNet)