Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: DMX lighting controlled via Girder using lanbox

  1. #1
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default DMX lighting controlled via Girder using lanbox

    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 :

    Code:
     
    --------------------------------------------------------------------------------
    -- 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 :

    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
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	20071208 003 (Small).jpg 
Views:	159 
Size:	30.1 KB 
ID:	4382  
    Last edited by mhwlng; December 28th, 2007 at 02:34 PM.

  2. #2
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Very nice - no idea what's happening with the callback though.

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

  3. #3
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    Quote Originally Posted by Rob H View Post
    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/moo...npricelist.pdf

    Marcel

  4. #4
    Join Date
    May 2004
    Posts
    2,588

    Default

    Amazing! Do you think one of the more expensive panels would be enough to light up a 12x12' room?
    Beware of the robot.

  5. #5
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    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

  6. #6
    Join Date
    May 2004
    Posts
    2,588

    Default

    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.
    Beware of the robot.

  7. #7
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    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

  8. #8
    Join Date
    May 2004
    Posts
    2,588

    Default

    OK, Thanks for the tip.
    Beware of the robot.

  9. #9
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    I now control RGB strips, via DMX, wirelessly, using zigbee technology

    hardware comes from www.thewillows.nl (dutch only), german/english is here : 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
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	1.jpg 
Views:	116 
Size:	59.6 KB 
ID:	4408   Click image for larger version. 

Name:	2.jpg 
Views:	124 
Size:	52.8 KB 
ID:	4409   Click image for larger version. 

Name:	3.jpg 
Views:	123 
Size:	39.5 KB 
ID:	4410   Click image for larger version. 

Name:	4.jpg 
Views:	136 
Size:	99.6 KB 
ID:	4411  

  10. #10
    Join Date
    May 2004
    Posts
    2,588

    Default

    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...
    Beware of the robot.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •