LinuxMCE Forums

General => Developers => Topic started by: coley on March 31, 2011, 04:58:53 pm

Title: Dusky Sky Controller
Post by: coley on March 31, 2011, 04:58:53 pm
A quick search of the forums returns quite a few hits on the dusky sky controller.
There seems to be numerous starts at getting it integrated - but I don't see any templates/devices having been completed.

What is done/not done?
What is the best approach for integration?

I'd like to get this PnP and am willing to do the legwork to achieve this.

-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on March 31, 2011, 05:27:22 pm
I do not know of any device templates submitted.

This would have to be done.

But also, any packages required to make it work, would also need to be folded into the build.

Also, can the dusky stuff be detected, a la USB etc?

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on March 31, 2011, 05:36:09 pm
Yep, the little unit can be detected when its plugged in, at least the USB ver is, I don't have the serial one to check.
Code: [Select]
root@moon264:~# lsusb -v -d6666:f100

Bus 004 Device 004: ID 6666:f100 Prototype product Vendor ID
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x6666 Prototype product Vendor ID
  idProduct          0xf100
  bcdDevice            9.04
  iManufacturer           1 Dusky Control
  iProduct                2 Sky/Sky+ Digibox Controller
  iSerial                 0
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3 Config. 1: HID
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      81
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     2
    iConfiguration          4 Config. 2: non-HID
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
Device Status:     0x0001
  Self Powered
-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on March 31, 2011, 05:51:56 pm
Okay, then that goes into the pnp section of the device template. Now you need to make a device template, either C++ or GSD that can control the device.

I am a C++ person myself, but... ;)

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on March 31, 2011, 06:19:09 pm
Thom,
Is C++ overkill for this? I'll try either but the device is just one-way comms. Injects remote commands in the rf port of the box.

I tried a GSD device template and the orbiter pops up that its detected.
Now what commands go into the device? as its not so much an end point or device to be controlled but for another device e.g. the sky box, to be "controlled via" this.

thanks
-Coley.

 - spotted edit Ruby codes, I guess I should be looking in there :)
Title: Re: Dusky Sky Controller
Post by: tschak909 on March 31, 2011, 06:56:29 pm
this is a "cable box" ... keep in mind, that LinuxMCE needs to have commands for things you need to be able to do.. look at the other cable box templates for ideas.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on April 01, 2011, 03:35:41 pm
The unit I have just controls one box, but they are available to control multiple sky boxes, would each sky-box then be a child of this device?
Is it not more along the lines of something like a USB-UIRT?

thanks
-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on April 01, 2011, 04:23:21 pm
then each device would be a child of the interface device, and would be dealt with in RecievedCommandForChild.

If you use a UIRT, you could..but you would lose bi-directional control. maybe this is important, maybe it isn't.

But also keep in mind that a UIRT can only deal with one IR zone at a time, so two Sky boxes, unless they can respond to two different sets of IR codes, would not work in this situation.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on April 01, 2011, 04:30:35 pm
Sorry Thom, maybe I wan't clear enough, I don't have a UIRT, but was thinking of it conceptually as a similar interface.
Md/core  -> Dusky - OP1 -> skybox1
                            - OP2 -> skybox2
                                       .
                                       .
                            - OP(n) -> skybox(n)

-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on April 01, 2011, 04:39:52 pm
Yes. It's set up the same way in the device tree. As I said, you deal with DCE::ReceivedCommandForChild, basically dealing with the commands that come across it like a giant switch statement....

So you have two device templates:

(1) an interface device template
(2) a child device template with all the commands of the box.

And the switch() inside ReceivedCommandForDevices() deals with passing on commands from (1) to (2)

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on April 01, 2011, 05:32:18 pm
Ok, so I'm guessing (1) the interface device template needs to be a DCE device - C++, and then I can reuse the sky plus template that already exists for (2) and add my new interface as a parent, i.e. it can be controlled by either IR interface or this.

thx
-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on April 01, 2011, 05:50:58 pm
unfortunately, since the child device already probably has IR commands in it.. i'm not sure.. you could try...

-Thom
Title: Re: Dusky Sky Controller
Post by: gtsupport on May 19, 2011, 03:43:47 pm
@ Coley,

How did things go with the template for this device??  I've got one, but as I could never get it working its sitting in a box somewhere.  Is it time to dust the thing off and give it another try?  I don't have the expertise to develop this myself, but am sending you much good will and encouragement on behalf of anybody who has tried to get these working in the past  :)

Matt
Title: Re: Dusky Sky Controller
Post by: coley on May 20, 2011, 11:39:39 am
Unfortunately my free time is a bit curtailed with a new baby girl at the moment, hopefully I'll get back to this soon.

-Coley.
Title: Re: Dusky Sky Controller
Post by: totallymaxed on May 21, 2011, 12:24:13 am
Unfortunately my free time is a bit curtailed with a new baby girl at the moment, hopefully I'll get back to this soon.

-Coley.

What are you even doing in here... Congratulations on becoming a dad :-)

All the best to you and your family

Andrew
Title: Re: Dusky Sky Controller
Post by: coley on June 14, 2011, 04:27:21 pm
Thanks Andrew!

Back to things lmce - how have you the dusky devices integrated in the systems you supply?

thanks,
-Coley.
Title: Re: Dusky Sky Controller
Post by: totallymaxed on July 04, 2011, 02:18:18 pm
Thanks Andrew!

Back to things lmce - how have you the dusky devices integrated in the systems you supply?

thanks,
-Coley.

We use our DCEwhisperer API for all our devices and that applies to the Dusky too. We have a Sky remote screen and we treat Sky boxes (and other devices like BluRay players) as 'External Devices' that accessible from the main menu screen.

All the best


Andrew
Title: Re: Dusky Sky Controller
Post by: uplink on July 12, 2011, 04:28:56 pm
We can't easily port the Dusky control from Dianemo to LinuxMCE, since we diverged from the standard way of doing things. It's not easy mainly because I have no idea how this is properly done (and hence the reason why Dianemo diverged :P)
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 17, 2012, 12:38:39 am
Hi all,

I've tried to get this working for the past 2 years as a gsd, and have picked it up again a couple of days ago.The furthest I've got is a template which  registers but will not work because "no com port specified".wether ComPortOnPc is used as a device data field or not

Udevadm info reports it as ....../hiddev0

After an intense  weekend of research, I contacted J. Heenan ,the manufacturer, who has kindly provided the following 

Quote
""
Hi Ian,

Right, I think I'm starting to understand a bit.

The basic issue is that the 'Generic Serial Device' driver in Lmce is intended only to talk to serial devices (or, oddly, network connections), and the USB dusky is not a serial device. It doesn't even pretend to be a serial device (lots of usb devices are actually serial devices with a usb <-> serial converter built in, but not the dusky).

The USB dusky is based around a PIC16C745 - it doesn't present anything like a serial interface, it is (in USB terms) a 'HID' device. You talk to it by providing binary packets of data to the linux USB HID subsystem.

There's probably 3 approaches that might work:

1) (Easiest) Swap your USB dusky for a serial model. That should then be directly possible to use with the GSD

2) Write a network listener that accepts commands from the lmce GSD and calls 'sky-control' to pass them to the sky box. It's probably still quite a lot of work though, I don't really fully understand what would be necessary and it's probably not a very clean solution.

3) (Hardest, I think) write a lmce 'device driver' that talks directly to the USB dusky, reusing the 'sky library' code that's used in sky-control.

Hope that helps!

Cheers,

Joseph
"
End Quote

SO......can anyone suggest a workaround without me having to learn C++?
           or would anyone of you beautiful genii  hazard an estimate for writing the driver ?
                    tho I must say  it's unlikelythat I could afford this option on my own--- any other USB Dusky owners willing to chip in?


          .can anyone direct me to  a good beginners book on C++  ?
           does anyone have any experience with the PIC16C745...?
          can anyone suggest  a similar/any lmce device that has a  C driver, so I can study it's code?


regards

Ian












                     
Title: Re: Dusky Sky Controller
Post by: tschak909 on January 17, 2012, 01:36:40 am
We all can help you write the driver, the first place to start, is to read the Developing a DCE page in the wiki; to get a development environment started.

Where is this library he is talking about? I would like to look at the API, I can guide you a bit.

-Thom
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 17, 2012, 02:57:39 am
Hi thom
thanks for the response,

library, and other software at http://www.dusky-control.com/docs.shtml


regards

Ian
Title: Re: Dusky Sky Controller
Post by: tschak909 on January 17, 2012, 05:05:55 am
Basically the C library needs to be taken and put into a DCE C++ device. Each command stub made by DCEGen needs to call an equivalent function inside the aforementioned C library to do the right thing.

-Thom
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 17, 2012, 05:25:53 am
Hi Thom,
many thanks for speedy response,

so , and forgive a complete (pre-)Newbie  programmer if I'm spouting gibberish...but is this a reasonable
 plan ?

       1......set up dev environment as per wiki
       2.......generate  basic driver 
       3........examine existing code  and newly generated (would Doxygen be helpfull ?)
       4.........translate c to c++ functions
       5.........have a nervous breakdown

do you honestly think this is achievable for a complete novice, given that I have a fair amount of free time ?

Title: Re: Dusky Sky Controller
Post by: tschak909 on January 17, 2012, 05:29:36 am
Yes, it is. Just be patient, and take it one step at a time.

If you wish, you can stop by #linuxmce-devel on IRC (server irc.freenode.net), as I tend to hang out there with the other developers, and can help you there, much more quickly.

-Thom
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 17, 2012, 01:16:09 pm
I am pleased to announce the birth of a little code  !!!! ;D ;D ;D ;D ;D
.........concieved in trepidation at 05:50  (first install of 10.04)...
..........birthed by DCEGen at  11:45 today,
...........fathered by my "hunt and peck" right index finger

     ..........midwifery duties  most excellently performed by  the developers and contributors (forums and wiki).....thank you all.


Many thanks  for the encouragement thom, have you any suggestions regarding a "simple"  IDE   ?

BTW   I'm taking notes on every step for a wiki entry,

If any other " novice" would like to make this a joint project  SHOUT NOW  please,

regards,
Ian



Title: Re: Dusky Sky Controller
Post by: coley on January 17, 2012, 02:05:01 pm
Ian,
Suppose I should dust off my lmce hat and get stuck back in here!!
As you gather from the thread I have one of these devices too.
I had started a C++ dce device but lost the hd and lmce install that was on :(

Does your Dusky device control just the one sky box? or has it more than one o/p?

-Coley.
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 17, 2012, 03:22:38 pm
Hi coley

2 ports ,on mine,........ but from what I've managed to pick up so far that shouldn't be a prob,

........you're not a closet coder by any chance ?

Ian

edit ...coley what you doing here ,you've a little girl,  ;D ;D ;D  congrats

Title: Re: Dusky Sky Controller
Post by: coley on January 17, 2012, 03:42:51 pm
;D never been referred to as a closet coder, but yep can code have the t-shirt!
-Coley.
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 17, 2012, 04:04:08 pm
 ;D ;D  ;D

coley

 are you on 810   or 1004 ?
are you up for making it a collaborative effort, or  do you prefer to be alone in your closet ? 
          (bear in mind that I'm on a VERY steep learning precipice here, so altho I've got time ,I'm  gonna be slow SOoh slow     :(

Ian
Title: Re: Dusky Sky Controller
Post by: coley on January 17, 2012, 04:14:48 pm
I run 1004 but can have either 810 or 1004 as a VM for testing.
Collaboration is good, I'm up for it.
Hopefully I can make more time for this than I have been doing.

-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 18, 2012, 07:28:35 pm
I am pleased to announce the birth of a little code  !!!! ;D ;D ;D ;D ;D
.........concieved in trepidation at 05:50  (first install of 10.04)...
..........birthed by DCEGen at  11:45 today,
...........fathered by my "hunt and peck" right index finger

     ..........midwifery duties  most excellently performed by  the developers and contributors (forums and wiki).....thank you all.

Ian, what kind of device template did you select to generate the DCE device?
What was the cpp file output for the device?
I'll have a go at wrapping the existing code into a lib.
-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 19, 2012, 03:52:42 pm
a quick update - I've taken the original code from the dusky website and compiled a small shared lib.
I've taken his "sky-example" file and linked it against my new lib and it seems to work.

@Ian, What template did you base your new DCE device on?

It should now just be a matter of plugging in the exposed functions from the lib into the generated functions in the device cpp file.

-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 20, 2012, 05:28:32 pm
another update ...
I created my own device to keep this going - I'll have to work out with Ian if there is a way of merging what he has done, its category is "AV - Satellite box".
Anyway I've added the new device as a child of the MD where the dusky controller is connected.
I'm running the device standalone and have populated some of the functions to output the matching commands. The library seems to be emitting the appropriate bytes to control the box :)

a wee problem - I get nothing through to my device when I press the numeric keypad displayed on the orbiter - where should I start looking to dbg?

-Coley.
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 21, 2012, 01:01:30 pm
Hi Coley ,

apologies for the abrupt & prolonged abscense,......Who's been a busy boy then ? ;D ;D ;D


I have set up my Dusky as follows


child of GenericPC as core/hybrid

Category #71 Interfaces
manuf  Heenan #1153
#37 ComportOn PC   string
#76 COM Port  parity/bit/stop   string        N81
#78 Baud rate   strinng     B5700
#48 Number of Ports   int     number of outputs on dusky        2
#81 Channel  int          1
#171  Port    int         2


I think more (int)  parameters need to be added  to account for the number of Dusky's on the system and to specify which one the template will refer to

I also think the driver should be able to address both usb & rs232 variants




I set the sky box up as   ............. a child to the dusky.......    sattelite>AV........ir controlled

..........this is what DCEGen used to spit out  the code... which as yet hasn't been compiled and  tested ...I'm trying to work out  what it does  atm    ???   so I've nothing to merge as yet.

So that we  (and anyone else in future)  are  singing off the same hymn sheet  , can I suggest :


          a) we agree  & submit  the required    temlpates  to  "fix" the template numbers & device data  numbers?
                        for e.g  sat box ...manufacturer Sky  ..av/Sat box.....name== "duskySky+/hd"  
                                                             and another  "=duskySky" for the standard digibox
                

          b) open a wiki page (I can do that ) to document  what we're doing, which will also give us a method to swap code and an easy entry point for anyone to jump in , as well as a standard working base  ?

best regards

Ian

    
EDIT: (As my understanding of programming is  VERY limited )  ...I'll get to work on the templates and
the wiki  (edit draft page at   http://wiki.linuxmce.org/index.php/Dusky_Sky_Controller..Driver_Effort  )
  & try to follow what you're doing,  chipping in where I can.

PLEASE can anyone recommend a beginners guide to OOP  and  to C++   ?
  
Title: Re: Dusky Sky Controller
Post by: coley on January 21, 2012, 08:55:36 pm
@Ian - I had envisaged going down that route before using the existing sky/sky+ template, see earlier in the thread. As the existing template was controlled via IR Thom didn't think it would work as a child of this device.

As it stands the lib called via the DCEdevice handles both usb and serial.
Detecting a USB version of the device already works with the existing lmce PnP system. A detection script would need to be added for the serial version, I don't know if it emits any info. This is one of the questions I'll need to ask the dusky guy, Joseph.
The other question is whether either dusky device knows what number of ports they have.

-Coley.

p.s. I don't know what to recommend regards c++, http://www.cplusplus.com/files/tutorial.pdf maybe as a start,

Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 22, 2012, 01:03:36 am
Hi coley,

I'm a bit confused

@Ian - I had envisaged going down that route before using the existing sky/sky+ template, see earlier in the thread. As the existing template was controlled via IR Thom didn't think it would work as a child of this device.

             ...................I thought that thom meant not to use ( and  therefore  alter,) the existing sky plus template, as that would mess around with existing sky users using ir control........I'm suggesting 2 additional  templates (duskySky  & duskySky+/hd.....and a new ir command group)   set up in the wizard as controlled by ir, but using the  4digit codes detailed on dusky's website, plus an additional data box  (type int) to indicate which output on the dusky it is connected to.

...........................I assume the dusky  knows  how many outputs it has, (wether this can be determined i dont know)    surely it must, as it returns an error if the wrong command is given in the cli  ?
                    ..........but isnt that point mute.....the installer/user  filling out the template will know, and, be able to add additional data paramaters in the template, I'd venture that most domestic/normal users  won't  need anymore than two outputs.

.........as regards serial detection,

quote    "p     0x70   'ping' - makes controller respond 'OK'. Only available in version 0.9.6 onwards"

 ............cplusplus.com was my first port of call , I think it's the OOP part of the business that's confusing me most, I'll keep googling & reading 'till I find something my addled brain will swallow   :(


Does all this make any sense,

regards,

Ian




Title: Re: Dusky Sky Controller
Post by: tschak909 on January 22, 2012, 05:03:23 am
I can help answer questions about C++.

As for the approach with creating a new template, This is the correct action to take, if for no other reason than people may be using the IR template.

If there is a way to scan for Dusky Sky devices, and parse their contents, a radar can be made to accurately detect these devices and send device detected events to the plug and play plugin.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on January 23, 2012, 12:30:36 pm
I've had an answer back from Joseph;
 - The USB controlled dusky controllers will have one or two ports but don't return that info.
 - The RS232 versions however do return the number of ports at the end of their version string in response to a query, so as Thom says this can easily checked with a script.

@Ian, I wouldn't split the templates into "duskySky  & duskySky+/hd". A box type param could be used in the template to determine the appropriate codes to send depending on whether we are connected to a Sky/Sky+/Sky+hd box.

-Coley.
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 24, 2012, 12:43:59 am
Hi coley

errm, I think we're at cross purposes, sorry,

what I meant to say was---4 templates in total

1.......DuskySkyController
2.......duskySky              ie a sky digibox controlled by Dusky
3.......duskySky+/hd        ie a Sky+ or Skyhd+  (both at present on same codes)
4.......SkyPlus i.e  the existing  template in the db.       

                          to distinguish the sky boxes controlled by ir (present SkyPlus template)  and those controlled by rf/Dusky                 (which   have    2   different codesets )


or have I completely misunderstood ?     

regards

Ian

Title: Re: Dusky Sky Controller
Post by: coley on January 24, 2012, 02:07:48 am
Nope not at crossed purposes - converging :)
We both agree on not touching existing IR Sky template.
Whether we go with a parent as the Dusky controller and each output as a child, or single device with n outputs, I don't know.

A single template can handle the two you refer to here:
2.......duskySky              ie a sky digibox controlled by Dusky
3.......duskySky+/hd        ie a Sky+ or Skyhd+  (both at present on same codes)

If we go the parent child route, having the children in different Entertainment Areas to the parent won't be a problem, I don't know if it is an issue of one device having outputs in different EAs??

-Coley.
Title: Re: Dusky Sky Controller
Post by: maybeoneday on January 24, 2012, 04:13:52 am
ermmm,  sorry if I'm being thick,

 but how can we have 2 different codesets in the same template?  (for the 2 different types of sat box)

:- agreed, the sat box  template(s) need a parameter to show which output on the dusky it's connected to, & then,they can be assigned to different  ent. areas/rooms.

Surely it has to be a single box with n outputs,?   sitting between the md and the sat box:(the sat box is the av equipment after all,)(the dusky outputs  would be better named command channels) or else it's no longer the interface, and becomes the AV device(s) itself..... (and would still need separate codesets to cover the two possible boxes that could be connected to it.)?

And if you wern't confused before ......   !!!!!    I know I am   ::)

Ian


EDIT any  chance you could post your code, so I can try and follow it ?

  
Title: Re: Dusky Sky Controller
Post by: coley on January 24, 2012, 12:15:51 pm
but how can we have 2 different codesets in the same template?  (for the 2 different types of sat box)

If you look at the table on the dusky site http://www.dusky-control.com/sky-control-codes.shtml and look at the sky/sky+ remote control commands you'll see they are all in the format 0x00XX. To convert to a sky+ code 0x0C00 is added and to convert to a skyHD code 0x5C00 is added. This allows the device to send the appropriate command once it knows the box type its connected to. I'm ignoring the sky navigator commands.

I see what you are saying re AV devices vs Interfaces - It can be done either way as you describe - just which is the "right" way?

The code isn't ready for public consumption yet and may end in the bin depending on the design decision of how the DCE device is implemented. If you want to PM me your email address I can send you a tgz of what I've done.

-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 24, 2012, 12:38:19 pm
In deciding how to add this as an interface can somebody tell me what is the difference between

a.) Device Category - Interfaces #71
b.) Device Category - Interfaces - Specialized #97

as a device category in the device template?

thx,
-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 26, 2012, 01:48:20 pm
 ... some more on this;
I've parked the initial effort as complete.
Now I'm back to the drawing board and have created, as we've teased out here, an interface template "DuskySkyController" and have a child created "skycontrolusb" for now. The device template for the interface has been ticked as implements DCE, while the child doesn't.
I've generated the stub devices but don't see the linkage between child and parent - how is this established? i.e. the child spits out debug as orbiter buttons are pressed, but I see nothing from the parent handling the child's commands.

-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on January 26, 2012, 04:35:04 pm
Any commands for children need to be implemented in their DCE parent using the ::ReceivedCommandForChild() method.

Basically, the message comes in pMessage, you extract the command and any parameters from it, and do something with it (i.e. use a switch()) ... For examples, look at ZWave, PLCBus, etc.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on January 26, 2012, 04:42:33 pm
Ok, I figured that and have debug output in the stub ::ReceivedCommandForChild(), this never appears, I see the child spit out "need to implement command X" from the stubs in the child device.

-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on January 26, 2012, 04:47:43 pm
The child does not need to implement DCE, uncheck its box.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on January 26, 2012, 04:53:26 pm
Yup, had that unchecked.
I'll regen the devices to clean things up.

thx
-Coley.

also have controlled via set in the child to the parent device, with reroute Messages to Parent ticked.
Title: Re: Dusky Sky Controller
Post by: coley on January 26, 2012, 05:40:05 pm
OK mystery solved!
I was creating a device for the child and this was swallowing the commands, now when I don't run a child device commands are handled by the parent.
Note to self - if you don't check the implement DCE box - don't run DCEGen for the template!

-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 26, 2012, 07:23:00 pm
Woohoo for little victories!
Right events and params are coming through for the child devices!
Next to make it all happen automagically :)

-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 27, 2012, 01:55:59 am
After todays efforts I'm still stumped by this:
a wee problem - I get nothing through to my device when I press the numeric keypad displayed on the orbiter - where should I start looking to dbg?

Now if I go to my child device and select "send command to device" from the webadmin and choose the digits from the dropdown list I get them in my interface device as expected.
Any suggestions appreciated :)

-Coley.

Title: Re: Dusky Sky Controller
Post by: tschak909 on January 27, 2012, 03:08:46 am
can i see a screenshot of the orbiter screen affected?

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on January 27, 2012, 11:51:59 am
yep screen grab attached.
thx
-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on January 30, 2012, 02:47:22 pm
I'm writing the detection scripts for these devices, the RS232 version reports its number of ports but the USB does not, however it only comes in one or two port versions. Is there a way to prompt the user from the script to select one or two ports?

thanks,
-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on February 02, 2012, 01:26:09 pm
@Ian I have checked in in an initial cut of the src into svn, look for DuskySkyController, its a better approach than the initial tgz I gave you.

-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on February 02, 2012, 04:45:23 pm
If you look at the devicedata: PnP prompt for options, in some templates, there is a way to create menu options to select.

These menu options become device data entries in the template.

Look at Device Template # 1772 for an example.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on February 02, 2012, 05:35:55 pm
Thanks Thom, and do you have to add the text strings to the database table manually or is there some way via webadmin?
-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on February 02, 2012, 05:38:45 pm
Normally this is done via HA Designer, but you can add them manually.

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on February 02, 2012, 06:02:56 pm
Ah OK, I've a copy of HA Designer installed that I can dust off, probably the safest way to do it.
-Coley.
Title: Re: Dusky Sky Controller
Post by: coley on February 03, 2012, 01:25:54 pm
Added the new string via HA Designer.
Populated the PNP Prompt for options in the template as per the sample above.
Regen and reload, then plugged in device.
PNP detected it and new screen appeared ;D but no text  ??? .
Checked dB for txt, it's there alright - spotted a field AddToOrbiter, set this to '1'.
regen, reload plug device in again and txt appears!!
Now did I do this correctly? or should that field have been set via some setting in HA Designer?

-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on February 03, 2012, 03:47:56 pm
very strange, that field should have automatically been set by HADesigner, but no matter.

All good,
Thanks Coley!

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on February 03, 2012, 11:13:39 pm
Does anyone on here have an RS232 version of one of these devices? I have a single port USB controlled one and Ian(maybeoneday) has a two port USB one. I'd like to test my detection script.

thanks,
-Coley.
Title: Re: Dusky Sky Controller
Post by: tschak909 on February 04, 2012, 01:14:07 am
To quote Hari at times like this:

"You Rock!"

-Thom
Title: Re: Dusky Sky Controller
Post by: coley on February 23, 2012, 12:20:22 pm
thanks Thom for the compliment!

Now would anyone know why my device is detected multiple times?

-Coley.
Title: Re: Dusky Sky Controller
Post by: gtsupport on April 06, 2012, 09:09:07 pm
Excellent work on getting this device integrated, I have a single port USB version of this and wondered if its plug and play at this point, or if there is a device template number I can find it under in the webadmin?

Happy to test anything you have, as my system is in tatters at the moment so I'm not worried about breaking anything.

Thanks again.
Matt.
Title: Re: Dusky Sky Controller
Post by: coley on April 10, 2012, 10:44:31 pm
I haven't been at this for a while - but I will dust it off and get it wrapped up, damn life got in the way!
I had it being auto detected and added, but it kept getting re-added.
I'll try and iron out a few kinks and then give you something that should be PnP to test.

-Coley.