Hi there.
I've been playing in this area too (controlling a Sky box from LinuxMCE with the Dusky Control device). Not sure whether to post this as a new topic, but since I'm trying to do the same thing as you are, I thought I'd do it this way.
I have the dusky-control device working (couldn't get it working reliably on IR).
I've had a MythTV setup for a while, so I thought I'd have a go with LinuxMCE.
I'm a competent C++ programmer, and various other relevant things besides, so I thought it would be straightforward (As straightforward as anything is - don't forget I've compiled MythTv from sources, and upgraded about the last 6 releases).
I could use the Linux command line tool, but that only provides channel changing (I'd like to use the LinuxMCE pass-through capabilities to get to the on-demand and programme guide stuff sometimes). Still, I thought I'd try the Ruby snippet approach, just to get it going. Boy, was that a mistake.
Is it me, or is the LinuxMCE Wiki seriously out of step with the code? I thought I could figure most things out from a good worked example, but I can't seem to get to any existing Ruby snippets.
For example, I tried
http://wiki.linuxmce.org/index.php/GSD_-_Ruby_codes, but it doesn't tell me where to put the fragments. It's something to do with Ruby internal commands, but it isn't clear where you put the
cmd = Command.new( <device from>, <device to>, <priority>, <type>, <id>)I thought I'd try following the instructions here...
For Generic Serial Devices the architecture allows implementing the commands directly from the LinuxMCE Admin Web Page, using Advanced/Device Templates. After picking the device template, select ruby codes and add the command groups that you want to implement (should be supported by the devices for which you want to create the template)
...but if you try that, there's no help on the syntax of what you can put in there. OK, I went googling, and worked out that you put it as a series of bytes in <>. But then I've got to reverse engineer Ruby to work out how to extract (say) the channel number digits that come in
cmd.params_["ProgramID"]. No help on that anywhere I can find.
So then, I thought I'd have a look at a non-trivial example elsewhere, and I found this on the Wiki
http://wiki.linuxmce.org/index.php/Control_A/V_equipment_with_RS232/USB/Ethernet. It suggests that if you
Click Advanced, Device Templates, Manufacturer: Denon, Category: A/V - Amps/receivers, Model: AVC-A1SRA (RS232), and click "Edit". Under "Infrared Groups", click the "Edit Commands" next to "Denon AVR/AVC protocol #1300"
...those instructions seem to be wrong. I think it's...
Click Advanced, Configuration, Device Templates, Manufacturer: Denon, Category: A/V - Amps/receivers, Model: AVC-A1SRA (RS232), and click "Pick Device Template" (there is no "Edit"). Under "Infrared Groups", click the "Edit Commands" next to "Denon AVR/AVC protocol #1300"
...there is no InfraRed Groups, there is no Edit commands button next to "Denon AVR/AVC protocol #1300". Either I'm doing something wrong, or the Wiki is seriously out of step with the Admin site.
One final try with a worked example. Oh, here's another one that looks tantalising....
http://wiki.linuxmce.org/index.php/Here_is_a_detailed_example_of_how_to_add_Clipsal_Interface_using_Generic_Serial_Device. Unfortunately, although it goes much further discussing the uses of the Ruby internal commands (Private Method Listing et al), there is no Clipsal implementation example in the standard implementation. So I'm still stuck with instructions that don't quite fit the software.
I gave up on the Ruby snippet approach at that point.
The Dusky source code makes it apparent that the Dusky USB control device is a HID USB implementation, not serial. The C# examples make it clear what the code would look like in Linux/C++.
Frankly, I have some experience of USB programming, and HID devices are only "simple" in the sense that they don't require device driver debugging. In every other way, they're a bewildering maze of compexity. I think it's unlikely I can get a HID device to work without C++ code.
OK, so let's try the C++ approach. Define the device template, and using the instructions here
http://wiki.linuxmce.org/index.php/Cpp. The instructions say...
To create your C++ project, run DCEGen, which will be in /usr/pluto/bin on Linux or \pluto\bin on Windows. Add a -d [device template id] parameter. Your device template id is shown after the description input box.
...so off we go, create the Dusky device, and run DCEGen. I get an error saying it can't find any of the templates. It seems to be looking in the filesystem for them, but I would expect it to look in the pluto_main database.
Clearly I've got a lot to learn, and clearly I'm not going to learn it from the documentation! If any of this rambling contains any obvious errors, please someone let me know otherwise I'm going to be stumbling around for a while.