Author Topic: DIVICE DRIVER i think its very close to working  (Read 7670 times)

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
DIVICE DRIVER i think its very close to working
« on: June 03, 2010, 09:01:57 am »
Hi,
I have DMX lighting through out my home and have been working on a serial to dmx512 protocol converter from Milford Industries.  I intend to add it to the Wikapaedia when I get it running.  I have set-up a template and have created a child device.  The following is the device log:

========== NEW LOG SECTION ==========
1   04/26/10 16:40:25   101 (spawning-device)   Starting... 1
1   04/26/10 16:40:25   101 (spawning-device)   Found /usr/pluto/bin/Generic_Serial_Device
05   04/26/10 16:40:25.256      Creating child 102 <0xb70738d0>
05   04/26/10 16:40:25.256      Note: Device manager has attached a device of type 37 that this has no custom event handler for.  It will not fire events. <0xb70738d0>
05   04/26/10 16:40:25.256      Note: Device manager has attached a device of type 37 that this has no custom handler for.  This is normal for IR. <0xb70738d0>
RCODE:
   0:require 'Ruby_Generic_Serial_Device'
   1:class Command < Ruby_Generic_Serial_Device::RubyCommandWrapper
   2:end
   3:class Device_101 < Ruby_Generic_Serial_Device::RubySerialIOWrapper
   4:def cmd_ReceiveCommandForChild(cmd)
   5:id=device_.childdevices_[cmd.devidto_].devdata_[12]#get child device number
   6:        off=',0'#turns the channel off
   7:        on=',254'#turns the channel on full
   8:        half=',127'#turns the channel on to 50 %
   9:    if cmd.id_==192#192 is on
  10:      conn_.Send(id+on+'\r')#set id to full%
  11:   end
  12:    if cmd.id_==193#193 is off
  13:      conn_.Send(id+off+'\r')
  14:   end
  15:end
  16:#### START SETTERS ####################################################################
  17:def initialize()
  18:super
  19:@returnParamArray=Array.new
  20:end
  21:####  END  SETTERS ####################################################################
  22:end
 24:05   04/26/10 16:50:36.132      GSDMessageTranslator isCmdImplemented = false <0xb56ffb90>
05   04/26/10 16:50:36.162      #### Pre-Process Queue = 1 <0xb56ffb90>
05   04/26/10 16:50:36.162      _QueueProc Pre - 192 : 0 <0xb7072b90>
05   04/26/10 16:50:36.162      GSD-Sleep Pre 192 : 0 <0xb7072b90>
05   04/26/10 16:50:36.163      Process Queue = 1 <0xb7072b90>
05   04/26/10 16:50:36.196      GSD-Sleep Post 192 : 0 <0xb7072b90>
05   04/26/10 16:50:36.196      _QueueProc Post - 192 : 0 <0xb7072b90>
05   04/26/10 16:50:46.669      GSDMessageTranslator isCmdImplemented = false <0xb56ffb90>
05   04/26/10 16:50:46.671      #### Pre-Process Queue = 1 <0xb56ffb90>
05   04/26/10 16:50:46.705      _QueueProc Pre - 193 : 0 <0xb7072b90>
05   04/26/10 16:50:46.705      GSD-Sleep Pre 193 : 0 <0xb7072b90>
05   04/26/10 16:50:46.705      Process Queue = 1 <0xb7072b90>
05   04/26/10 16:50:46.708      GSD-Sleep Post 193 : 0 <0xb7072b90>
05   04/26/10 16:50:46.708      _QueueProc Post - 193 : 0 <0xb7072b90>

As you can see, when I send a message from the child device from what I understand it registers to the parent.  However, it does not send the serial code to the device to turn the lights on.
when i reboot my core it randomly turns the lights on
I would appreciate any help with understanding the system better and also getting the driver to work


thanks steve   

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: DIVICE DRIVER i think its very close to working
« Reply #1 on: June 03, 2010, 12:33:54 pm »
You might want to constantly update a wikipage with your progress, including updating the code in there. That way, other people can directly see the code, and are better able to help you.

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #2 on: June 13, 2010, 09:14:51 am »
Hi,

This is a board from Milford Instruments www.milinst.com.  It has a RS232 socket, a DMX out, a DMX in, a voltage output, a voltage input and servo connectors.  It can be configured with various combinations.  All I am planning on using is the RS232 socket to receive GSD/Ruby data from a template in LMCE (the Clipsal GSD template can just be copied) and then the DMX out to send the channel control (the card will run 112 channels which can be configured from 0 to 254).  So the GSD device template will need 112 child devices/light switches and to be able to select a level between 0 and 254.  All you need to do to turn a light off is select 0 and to turn the light full on is to select 254 and to set the light a half power is to select 127.  Basically, child device ID/channel number, perameter on #192/level 254 perameter off #193/level 0 or data format "channel number" ",channel level".

I have taken this as far as I can and I have got stuck.  Any help would be appreciated.

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #3 on: June 13, 2010, 11:26:59 am »
Hey gonesurfing, have you started the wiki page on this yet? Quite many of us are interested in advanced lightning.

Few questions that hopefully aid in getting your device working:
First, could you point to the specific board you're using?
Have you setup the serial protocol in the GSD correct?
Can you control the board with TestSerialPort command?

/Kooma

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #4 on: June 14, 2010, 04:05:58 am »
HI
I have made a start on the wika and will try to finish it over the next day or so.
The board has not got a part number however there is a guide to the specific board on the wika - it is under dmxlighting it is my first one so please modify if I have got something wrong.  I am not sure about the serial protocol however I think I can just modify the Clipsal code to suit.  The  test serial command would look something like /usr/pluto/bin/testserialpost -p /dev/ttySO -p N81 -b 9600 -t "1,254\r" #serial port ,parity/stop/bit ,buadrate ,my code
steve

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #5 on: July 04, 2010, 09:01:14 am »
hi
when i run  /usr/pluto/bin/TestSerialPort -p /dev/ttyUSB0 -P N81 -b9600 -t "5,254\r"
i get unknown 5,254\r
can any one suggest what to try next
thanks steve

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #6 on: July 04, 2010, 09:49:05 am »
Hi,
one step might be checking the correct cabling.
Have you tested your serial connection with this (Windows) software http://www.milinst.co.uk/shop/DMX/downloads/DMXDriver.zip?
/Kooma

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #7 on: July 04, 2010, 10:20:20 am »
hi Kooma
I have tryed the win driver and it works okay also when i reboot the core the serial detection script triggers the lights to come on at differant levels but i have no control over them, can you suggest anything else
thanks steve

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #8 on: July 04, 2010, 02:12:08 pm »
OK, I got a similar response (unknown..) when playing with TestSerialPort. This happens when the baudrate is given as "-b9600". Try "-b 9600" instead.
/Kooma

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: DIVICE DRIVER i think its very close to working
« Reply #9 on: September 05, 2010, 11:00:26 am »
hi
i had some more time to play with this today and is now working although on a some what more expensive interface here is the wiki
http://wiki.linuxmce.org/index.php/Cueserver_dmx_lighting
this interface has the ability to send messages to lmce to keep it updated and also has 8 contact closures which can also send messages to lmce i plan to use this as an alarm system , can anyone point me to some basic examples please and also an example of #184 command i am using it as the dimmer for the lights i have it turning the lights on, off and to 50 % but can't workout how it steps to 60 or 70 %

i think the original board has a setting that is wrong and plan to contact the manufacturer and will update this post 

thanks steve