Friday, November 30, 2012

Introducing LightingPi




As a companion to my pixelPi software and I've started work on an output device which works with OLA (Open Lighting Architecture).  This allows the Raspberry Pi to be use to control; servos; dimmers; relays and pixels (via pixelPi) all controlled over standardized lighting/prop control protocols supported by OLA.  This would essentially be a configurable node which drives hardware and can be controlled with Artnet; E1.31; ESP Net; Pathport; Sandnet; Shownet.

https://github.com/LightingPi/lightingPi

Features:

  • Control strings of LED pixels with a raspberry Pi
  • Control strings of analog RGB LED strings (up to 16 channels per PWM board)
  • Control Incandessent lighting via SSR boards (work in progress)
  • Control servo position
  • Control of all fixtures provided over all major lighting protocols Artnet / E1.31/ OSC ...via OLA

Overview:

DMX based protocols are quite flexible.  The LightingPi software is a client which allows control of a large variety of light fixtures attached to the Raspberry Pi



Hardware:

(1) RaspberryPi
(2) PWM Hardware (Needed for Analog RGB Pixels and Servos)
(3) Something to play with (Servo motor; LED strips; LED pixels, SSRs)

Wiring Diagram:


No rocket science here:
Dimmer and RGB analog control provided by an I2C PWM generator
Led Pixel support provided by SPI bus directly on the raspberry pi


RGB LED strings driven by passing the PWM output to FET drivers (in the form of "RGB String Amplifiers cheaply available from ebay)

Servos are directly driven from the PWM IC

SSRs for dimmers are directly driven from PWM IC

Software:

lightingPi:

Grab the latest version here: https://github.com/scottjgibson/lightingPi

Configuring the peripherals:

Have a look at config.ini; its pretty self explanitory

OLA:

Install via apt; sudo apt-get install ola





28 comments:

Anonymous said...

Scott I am getting this error

Traceback (most recent call last):
File "lightingPi.py", line 7, in
from Adafruit_PWM_Servo_Driver import PWM
File "/root/lightingPi/Adafruit_PWM_Servo_Driver.py", line 5, in
from Adafruit_I2C import Adafruit_I2C
File "/root/lightingPi/Adafruit_I2C.py", line 9, in
class Adafruit_I2C :
File "/root/lightingPi/Adafruit_I2C.py", line 11, in Adafruit_I2C
def __init__(self, address, bus=smbus.SMBus(0), debug=False):
IOError: [Errno 2] No such file or directory

luis said...

Scott I fixed that error with this cmd modprobe i2c-dev.
so I run the script sudo python lightingPi.py and then I go to the browser 192.168.1.107:9090 and I get the Ola admin, but I dont see the way how this work. Ola admin comunicate with lightingPi.py? and then lightingPi.py comunicate with the ws2801 LED?

Scott Gibson said...

Hey; yeah I should document more how to setup OLA. I'll work on something tonight. OLA now supports OSC which allows for some really good control apps. Essentially OLA is the bridge from Any protocol (Artnet, E1.31, OSC...) to lightingPi. LightingPi registers with OLA and receives the DMX data on the specified universe (1).

luis said...

hey, I got the lightingPi comunicating with OLA, this is the log "Added sink client, 0x1059080 to universe 1" but I dont know why I can not use the ola admin send the data to lightingpi. do you know what do I have to do?

luis said...

Now its working, well I hope so

otipohc said...

Hi,

I have an error when using this script with LPD6803 chips:

File "/usr/lib/python2.7/dist-packages/ola/OlaClient.py", line 817, in UpdateDmxData
self._universe_callbacks[request.universe](data)
File "lightingPi.py", line 200, in data_handler
fixture.handler(dmx_data)
File "lightingPi.py", line 97, in rgb_pixel_handler
self.send_spi(data)
File "lightingPi.py", line 176, in send_spi
spidev.write(bytearray(b'\x00\x00'))
NameError: global name 'spidev' is not defined

And also, might it have an indent error in the for loop of def send_spi for the case of LPD6803 ?

Anyway thanks for the work

luis said...

I am not sure know but can you try to change it to self.spidev.write(bytearray(b'\x00\x00'))

it may work

otipohc said...

Thanks luis,

That was it, I definitly need to learn progamming...

SAG said...

hi
i am currently a student at college and have been given a raspberry pi to do a project on anything.
i quite like the lighting idea but need help on
it would be great if i could get some serious help
thanks

Scott Gibson said...

Hi SAG; A good place to start is the adafruit http://learn.adafruit.com/ It should help get you up and running. Send an e-mail or post here for more help

Unknown said...

hi Scott.
Cheers for the work you have done here :)

I have ola installed and working as well as lightingPi however I have no idea of how to connect lightingPi and ola??

Thankyou :)

gwillyboy said...

Hi Scott. Thank you for your work on all this. I saw your initial blog and rushed out to buy what I thought where WS2801.. Turns out after much frustration and deconstruction they have a ucs 5903 chip driving each led. Do you know if it possible to make these work with your apps? If not I'll be ordering some true ws2801's and start again. Thanks in advance Ant. PS if I can donate/buy you a beer somehow for your work to date let me know.

Scott Gibson said...

Hey; So I hadn't heard of the UCS5903 but from what I read its functionally compatible with LPD6803 so hopefully that option will work for you; Good luck and let me know how it goes.

gwillyboy said...

Thanks for the quick reply. I tried setting it as a LPD6803 and the vendor also suggested they were lpd6803s but had limited results. I'm not sure if its due to the pins as advised by the vendor not matching with the PCB labels or something else. Out of curiosity, when wired correctly should all the leds be on or off before the pi boots. If I wire them as labelled all LEDs are just different random colours and don't respond via the python commands. I did try them as ws2801 and had limited success.. Eg all LEDs sequentially going to full white when pi boots and responding to some commands albeit with an unexpected results (wrong colours and sequences and other crazy ness lol) so frustrating but addictive at same time!

gwillyboy said...

In response to my previous comment - i have success with PixelPi after rewiring and figuring out the correct wiring for these chips (nothing like what was described by vendor). Thank you for the tip to list as LPD6803 - worked a treat. Cant wait to get this up and running now with LightingPi!

Once again - thanks Scott.

Det0 said...

Does this support more then 1 universe for large matrix's?

Anonymous said...

Great work! Love it.
I was wondering what app are using for the ipad?

Giorgio said...


This is probably a noob problem but

If you are getting the

from ola.ClientWrapper import ClientWrapper
error

install this package :

sudo apt-get install ola-python

Anonymous said...

Hi guys,
we're currently trying to get the spidevs working on my raspi. we am using a 100 piece led stripe with P9813 chips which should behave in the same way as a regular WS2801 chip. Now im struggling with controlling the pixels. My pixels wont change nor do they show any reaction at all. How do we know whether pixelpi sends correct data to the chips? And which spidev do we have to use?

Our wiring looks like this:

http://img15.myimg.de/IMG1076c2af4_thumb.jpg

Thanks in advance,
Jonatan & Robert from Germany

Anonymous said...

Sorry, wrong link to the image..

http://img15.myimg.de/IMG1076c2af4.jpg

greetings,
Jonatan & Robert

George said...

Hi,

Great project :-)
Is there any way to have more than 170 pixels with this (ie more than one universe controlling them, so that it goes into the next)

Thanks,
George

Anonymous said...

What hardware do you use for the raspberry pi to the DMX connector?

Anonymous said...


Hi Scott,
I am getting this error :

pi@raspberrypi ~/lightingPi-master $ sudo python lightingPi.py
Traceback (most recent call last):
File "lightingPi.py", line 6, in
import liblo
ImportError: No module named liblo

How can i install liblo and wich version ?

Regards
Vincent

Birk said...
This comment has been removed by the author.
Birk said...

Hi,

I am totally noobing this thing but have wet dreams about managing to solve the puzzle...

What have I done wrong in the proses if I get this message you think?

"E: Unable to locate package ola-python"

Birk said...

Nailed OLA, its installed, but i still don't get what to do with your software. Can you give me a hint? :)

Birk said...

By the way, I'm getting the same error message that Vincent got.

ImportError: No module named liblo

Is there a library that I have not installed?

Region Assignment said...

Is there any way to get this to work with an IC6803?