PDA

View Full Version : DMX lighting controlled via Girder using lanbox



mhwlng
December 15th, 2007, 06:03 AM
I got one of these DMX 512 controllers :

http://www.lanbox.com/products/LCEDataSheet.html

connected to some of these RGB led panels (see picture) :

http://www.hqpower.com/product/view/?lang=en&id=368110

The nice thing about the lanbox is, that it can work 'stand alone'.

I.e. you define some cuelists, that can contain animations, (cross)fades, chases etc.
and then you can simply start a cue from girder.
so you don't need to animate each channel from girder over time (although you can)

for example, I made a simple cuelist that slowly brightens the panels from 'off' to 'full on white' in 15 minutes, to replicate this :

http://www.wakeuplight.philips.com



this is the lanbox.lua file to start a cue list or manipulate channels directly :



--------------------------------------------------------------------------------
-- LanBox --
--------------------------------------------------------------------------------
print('Loading marcel\\LanBox.lua')
Marcel = Marcel or {}
Marcel.LanBox = {}
function Marcel.LanBox.SendCommand (address,port,commandstring)
local switch16bitcommand = "*65ff#";
local step = 0;
for j = 1,3 do -- retry
local socket = gip.Open(address, port)
if not socket then
gir.LogMessage ("Marcel.LanBox","Error Connecting",1)
else
for i = 1,2000 do -- wait until command done (for 2 seconds max.)
data = socket:Read (128);
if (data) and (data ~= "") then
print ("&"..data);
if string.find (data,"?",1,1) ~= nil then
gir.LogMessage ("Marcel.LanBox","Error Received",1)
socket:Close();
return;
elseif string.find (data,">",1,1) ~= nil then
if (step ==0) then
print (commandstring);
socket:Write(commandstring);
step=1;
elseif (step==1) then
socket:Close();
return;
end
elseif string.find (data,":",1,1) ~= nil then -- 'enter password :'
socket:Write('777\r');
elseif string.find (data,"d",1,1) ~= nil then -- 'connected'
print (switch16bitcommand);
socket:Write(switch16bitcommand);
else
win.Sleep (1)
end
else
win.Sleep (1)
end
end
socket:Close();
gir.LogMessage ("Marcel.LanBox","Timeout While Sending Command",1)
end
end
end
function Marcel.LanBox.StartCue (address,port,cuenumber)
local commandstring = "*5601"..string.format("%04X",cuenumber).."01#";
gir.LogMessage ("Marcel.LanBox","Sending Command "..commandstring,0)
Marcel.LanBox.SendCommand (address,port,commandstring)
end
function Marcel.LanBox.SetBedRoomColor (address,port,R,G,B)
local commandstring = "*C901";
for i = 0,3 do
commandstring = commandstring..string.format("%04X",i*13+1).."FF";
for j = 0,3 do
commandstring = commandstring .. string.format("%04X",i*13+j*3+2) .. string.format("%02X",R);
commandstring = commandstring .. string.format("%04X",i*13+j*3+3) .. string.format("%02X",G);
commandstring = commandstring .. string.format("%04X",i*13+j*3+4) .. string.format("%02X",B);
end
end
commandstring = commandstring.."#";
gir.LogMessage ("Marcel.LanBox","Sending Command "..commandstring,0)
Marcel.LanBox.SendCommand (address,port,commandstring)
end
function Marcel.LanBox.SetLivingRoomColor (address,port,R,G,B)
local commandstring = "*C901";
for i = 0,1 do
commandstring = commandstring .. string.format("%04X",i*3+100) .. string.format("%02X",R);
commandstring = commandstring .. string.format("%04X",i*3+101) .. string.format("%02X",G);
commandstring = commandstring .. string.format("%04X",i*3+102) .. string.format("%02X",B);
end
commandstring = commandstring.."#";
gir.LogMessage ("Marcel.LanBox","Sending Command "..commandstring,0)
Marcel.LanBox.SendCommand (address,port,commandstring)
end

print('Loaded marcel\\LanBox.lua')




Ron/Rob :

note, that I had coded this using socket:Callback(4.... before.
The manual said that this results in a callback each character ?
It seems to be called every ip packet. (so data is > 1 character)

Also, this method doesn't work properly when called from inside HandleDMEvent :
DeviceManager:Subscribe(function (...) Marcel.X10.HandleDMEvent(unpack(arg)) end)

old code :



function Marcel.LanBox.SendCommand (address,port,commandstring)
local commandbusy=true;
local socket = nil;

function Marcel.LanBox.DataCB ( data, code)
if (code==gip.CONNECTIONCLOSED) then
--print ("LANBOX : Disconnected")
commandbusy = false;
elseif (code==gip.CONNECTIONESTABLISHED) then
local err = tonumber (data)
if err >0 then
gir.LogMessage ("Marcel.LanBox","Error Connecting",1)
commandbusy = false;
end
elseif (code==gip.RXCHAR) then
print ("*"..data);
if string.find (data,">",1,1) ~= nil then
commandbusy = false;
elseif string.find (data,"password :",1,1) ~= nil then
socket:Write('777\r');
elseif string.find (data,"connected",1,1) ~= nil then
print (commandstring);
socket:Write(commandstring);
end
end
end

socket = gip.Open(address, port)
if not socket then
gir.LogMessage ("Marcel.LanBox","Error Connecting",1)
else
socket:Callback(4, function (...) return Marcel.LanBox.DataCB (unpack (arg)) end )
for i = 1,2000 do -- wait until command done (for 2 seconds max.)
if (commandbusy == false) then
socket:Close();
return
end
win.Sleep (1)
end
socket:Close();
gir.LogMessage ("Marcel.LanBox","Timeout While Sending Command",1)
end
end




maybe some threading issue or some strange garbage collection issue ?
I see the data come in and then immediately a gip.CONNECTIONCLOSED.

if I called it from the console, it worked fine..

anyway, socket:read works...

Marcel

Rob H
December 15th, 2007, 08:36 AM
Very nice - no idea what's happening with the callback though.

How much were the panels, and where did you source them?

mhwlng
December 15th, 2007, 08:48 AM
Very nice - no idea what's happening with the callback though.

How much were the panels, and where did you source them?

I got them here (dutch language only)

http://www.plsshop.nl/detail.asp?pid=ELDML001&cat=251

but I'm sure that you can buy them in the u.k. (e.g. from any velleman kit dealer) (see above hqpower link)

also see Traxon Mood Light Classic DMX (different, more expensive, higher quality panel)

http://www.amblight.co.uk/images/moodlight/pdf's/Traxonpricelist.pdf

Marcel

quixote
December 15th, 2007, 09:37 AM
Amazing! Do you think one of the more expensive panels would be enough to light up a 12x12' room?

mhwlng
December 15th, 2007, 09:44 AM
No,

this type of LED lighting, is not bright enough to be used as main lighting.

It's meant to be used as 'mood lighting'

the power consumption of the LED's is very low...

Marcel

quixote
December 15th, 2007, 11:55 PM
OK, I understand. My goal is to build a coffee table that uses glass bricks as the base and light up the base with different RGB values that I enter into Girder somehow. Originally I was going to use Insteon with three different coloured bulbs, but this seems like a (albeit way more expensive) viable alternative. What do you think? Even though the power consumption is very low, would it be sufficient to light up the table?
Thanks.

mhwlng
December 16th, 2007, 02:08 AM
don't expect very bright lights, especially from only one panel

this thing is one big 50x50cm printed circuit board with lots of smd leds.
I don't know how you would build this in your table and evenly light all surfaces.

remember, led lighting, in general, unlinke light bulbs, is very directional (narrow beam angle)..
so it could be that part of your table is light and part is dark.

you can also look into separate, dmx controlled, RGB led spots...

or so called 'wall washers', which are much brighter (again, watch out for the beam angle, you might need several) ...

Marcel

quixote
December 16th, 2007, 02:37 AM
OK, Thanks for the tip.

mhwlng
December 28th, 2007, 01:43 PM
I now control RGB strips, via DMX, wirelessly, using zigbee technology

hardware comes from www.thewillows.nl (http://www.thewillows.nl) (dutch only), german/english is here : http://www.dmx4all.de/ (http://www.dmx4all.de/)

1.jpg = zigbee receiver (You need another one of these, configured as transmitter.
The transmitter will be connected to your DMX controller)

You can have multiple receivers, connected to one transmitter...

2.jpg = 6 channel DMX dimmer, 2A per channel, 5A total

3.jpg = RGB strips (36 LED's 12V, 34cm, 280mA)

4.jpg = netremote screen with RGB scrollbars (and preview of selected colour)


Marcel

quixote
December 29th, 2007, 12:17 AM
That's super nice! What application are you using these strips for? I'm guessing they are thin enough to fit under a bar or table...

mhwlng
January 6th, 2008, 02:16 AM
a different lightstrip experiment :

I used 12meters of these lightstrips :

http://www.ledtuning.nl/catalog/product_info.php?cPath=91&products_id=327 (http://www.ledtuning.nl/catalog/product_info.php?cPath=91&products_id=327)

(6m pointing up and 6m pointing down, controlled separately)...


(the last picture are different light strips... see previous post)

Marcel

quixote
January 8th, 2008, 08:04 AM
Those look really good. I think that I'll try to use them for my coffee table project (I know that they won't be super bright, but I think that the effect will still look nice in a dark room). I don't suppose you have any experience with the Chromoflex RGB-Controller from that site, do you? http://www.ledtuning.nl/catalog/product_info.php?cPath=93&products_id=308

I'm just trying to figure out if I should bother trying to write a script for it or if I should just use the IR control.

mhwlng
January 8th, 2008, 08:16 AM
I've only got experience with DMX...

for above 12m ledstrip, I used 2 of these, to separately control the top and bottom strips :

http://www.ledtuning.nl/catalog/product_info.php?cPath=104&products_id=420

(obviously you would also need a 12V power supply and a DMX controller)


if you use infrared, you won't be able to set an absolute RGB value. (I didn't read the rs2132 specs.)

Marcel

quixote
January 8th, 2008, 08:27 AM
Ah, I see. This is making my choice very difficult, because I really like the factory preprogrammed effects of the Chromoflex controller.
Those light strips were a great find!

mhwlng
January 8th, 2008, 08:36 AM
I really like the factory preprogrammed effects of the Chromoflex controller.

That's why the lanbox DMX controller (see above) is so great.
It can run stand-alone.
you program whatever animation/fades/chases you want with as many steps you want (=cue list)
and then you can just start the cuelist with either a tcp/ip command or an rc5 infrared remote controller (not tested)

Marcel

quixote
January 8th, 2008, 08:55 AM
Do you have to pre-program all of the animation/fades/chases for the lanbox DMX controller, or does it have any preprogrammed routines/randomizations? I kind of like the idea of random fades, the fire simulation and the lightning storm programs (though I haven't seen them yet... they sound cool).

mhwlng
January 8th, 2008, 08:57 AM
Do you have to pre-program all of the animation/fades/chases for the lanbox DMX controller, or does it have any preprogrammed routines/randomizations?

there are no preprogrammed routines and no random fades in the lanbox...

Marcel

quixote
January 8th, 2008, 09:06 AM
I'm going to request the documentation for the Chromoflex and I can give you details on it if you're interested. I'll also post my impressions for anyone else that is curious. Thanks for all of the clarifications.

mhwlng
January 8th, 2008, 09:17 AM
I'm going to request the documentation for the Chromoflex .

that stuff is all here...

http://www.chromoflex.com/

make sure that you buy the right model (i.e. PWM voltage control, not current control)

I prefer a DMX based solution, myself....




Marcel

quixote
January 8th, 2008, 07:46 PM
Thanks for the link. I can see that in your position, DMX control gives you much more power over your system since you are a proficient programmer. Personally I think that I'll need to keep it simple. Does this document make any sense to you: http://www.chromoflex.com/Usp3_com.pdf ? It looks like it offers the same level of control, but it's all a foreign language to me...

mhwlng
January 9th, 2008, 01:56 AM
but it's all a foreign language to me...

So, how are you planning to control your lights, if you're not able to make your own girder plugin for the chromoflex ?

Marcel

quixote
January 9th, 2008, 09:37 AM
So, how are you planning to control your lights, if you're not able to make your own girder plugin for the chromoflex ?

Marcel

Well, I just figured that I would nag you until you made one for me.

hahaha only joking! I guess I'll have to use my USB-UIRT to control it by IR (assuming it is compatible) and try to make sense of the documentation that I mentioned.

mhwlng
February 20th, 2008, 07:21 AM
here's more information about chromoflex...

http://www.domoticaforum.eu/topic.asp?TOPIC_ID=749

(I don't use this myself, so know nothing about it :rolleyes: )

Marcel

quixote
February 22nd, 2008, 10:52 PM
Cool! Thanks for the link. That video gives me confidence that they will work for my application.

Manser
September 24th, 2009, 09:17 AM
I love it! "The Lanbox" thanks for pointing me to this direction!