Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Plugin for USB PC Remote Controller

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
srs
Posts: 9
Joined: Thu Dec 18, 2008 7:53 pm

Plugin for USB PC Remote Controller

Post by srs »

This is an alternate driver and plugin to use with some remote control receivers sold on ebay. They usually go for around $15 and include a usb ir receiver and remote. I'm not sure who the manufacturer is, but the usb vendor id is 06B4 and the product id is 1C70 (VID_06B4&PID_1C70). By default, no driver is required for the receiver as it uses the standard HID driver to emulate keyboard key presses and mouse movements. Unfortunately this makes it less than ideal for use with EventGhost as we don't want extraneous keyboard press and mouse movements.

Attached is an alternate driver, along with a EventGhost plugin that makes the receiver much more suitable for our needs. The alternate driver / plugin disables the standard processing and instead only sends events to EventGhost which is perfect for our needs.

To Install:

1) Start device manager, expand "Human Interface Devices" and locate an entry for "USB Human Interface Device".
2) Open it, and look in the "Details" tab, and look at the "Hardware Ids" property. Make sure it says

"USB\VID_06B4&PID_1C70&REV_0200". The alternate driver is only designed to work with this particular model.
3) Go to the "Driver" tab, then click on "Update Driver"
4) Browse / Let me pick / Have Disk / point to the "driver" folder.
5) After you install the alternate driver, you should see a new entry under "Human Interface Devices" called "PC Remote Controller"
6) Install the EventGhost plugin, and you should be all set.

*DISCLAIMER*

This works for me (tested under Vista i386). It may not work for you. Use at your own risk.

edit: it seems the driver is too big to upload here, so I have uploaded it here
Attachments
USB-PC Remote.zip
(72.83 KiB) Downloaded 1120 times
srs
Posts: 9
Joined: Thu Dec 18, 2008 7:53 pm

Re: Plugin for USB PC Remote Controller

Post by srs »

only problem I have is with enduring events. Upon key down I set TriggerEnduringEvent() and on key up I do EndLastEvent(), but in between I don't get any repeats. Do I have to do the repeats manually?
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

srs wrote:only problem I have is with enduring events. Upon key down I set TriggerEnduringEvent() and on key up I do EndLastEvent(), but in between I don't get any repeats. Do I have to do the repeats manually?
No, to make sure it works right, add a AutoRepeat action to a macro and look if it starts repeating as it should.

In your WndProc you also call TriggerEvent() on wParam == 2. Should this condition be a repeating code? If so you should remove it as it would stop the event. Or has it any other purpose?

If the device is able to capture raw timecode diagram streams, you could let EG do the decoding of the signal. This way the receiver would get more universal.

Does this approach generally work with every HID/USB based device? There are some more receivers that are giving this kind of trouble through their HID-keyboard emulation. The Philips MCE v.1 is one of them for example. The driver looks like some piece build by Microsoft, so I guess there is a chance it would pass driver signing on Vista x64.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

Code: Select all

    def Finish(self):
        ...
        self.Stop() # is this needed?
To answer it: it is not needed.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
srs
Posts: 9
Joined: Thu Dec 18, 2008 7:53 pm

Re: Plugin for USB PC Remote Controller

Post by srs »

No, to make sure it works right, add a AutoRepeat action to a macro and look if it starts repeating as it should.
heh! I knew I was missing something. It's working perfectly now.
In your WndProc you also call TriggerEvent() on wParam == 2. Should this condition be a repeating code? If so you should remove it as it would stop the event. Or has it any other purpose?
Some buttons in the remote only generate an event on key down and none on key up.
If the device is able to capture raw timecode diagram streams, you could let EG do the decoding of the signal. This way the receiver would get more universal.
Unfortunately I don't think it's possible :( The receiver seems hard-wired to generate the HID codes from specific remote codes.
Does this approach generally work with every HID/USB based device? There are some more receivers that are giving this kind of trouble through their HID-keyboard emulation. The Philips MCE v.1 is one of them for example. The driver looks like some piece build by Microsoft, so I guess there is a chance it would pass driver signing on Vista x64.
I think this approach should work with every other HID/USB device (although my driver is specific to this particular device). All it is the WinUSB driver (which is included in Vista, and installable on XP) and a user mode program that listens on the usb port. Vista still gives the unsigned warning though...

I will try to clean up the source a bit and post it later so others can hopefully adapt it to their receivers.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

srs wrote: I think this approach should work with every other HID/USB device (although my driver is specific to this particular device). All it is the WinUSB driver (which is included in Vista, and installable on XP) and a user mode program that listens on the usb port. Vista still gives the unsigned warning though...
Well, this sounds very interesting. An idea might be to build a tool, that enumerates all HID-devices and produces a driver.inf on demand. So we could disable all these keyboard emulating HID devices and grab their data directly without knowing the exact device.

Is the way the DLL captures the data from the device the same to all keyboard'ish devices (some scancodes or similiar read from a pipe)? Or would we have to assume, that the way the data is encoded is completely different for every device?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
srs
Posts: 9
Joined: Thu Dec 18, 2008 7:53 pm

Re: Plugin for USB PC Remote Controller

Post by srs »

As promised here is the source.

All it does is open the usb device, and listen for data for data coming in from a pipe. Some remote codes generate multiple key presses, so I ignore everything but the first.

Another option to explore for devices where you want to keep some of the functionality of the original driver would be to create a filter driver which only intercepts some particular type of data...

I also found this program to be quite helpful in seeing the traffic between a host and usb device.

I also included a exe version of the dll, so if someone want's to install the winusb driver (all you have to do is change the vid and pid), and then run the exe and see if they get back any usable data.

I have tested it on two usb/hid devices and it seems to work.
Attachments
usb-pc-remote.zip
(9.92 KiB) Downloaded 749 times
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

srs wrote: Another option to explore for devices where you want to keep some of the functionality of the original driver would be to create a filter driver which only intercepts some particular type of data...
I thought of something similar to enhance the Keyboard plugin, to differentiate between keypresses sent from the real keyboard and keyboard emulating HID devices. As I see it, a filter driver would be the best choice with Windows strict driver policies. But I have no experience in writing any filter driver. So if you like to experiment in this field, it would be highly appreciated.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

srs, are you still listening?

I have tried your approach with some more remotes and it seems to work really nice. The remotes I have tested so far are:
* Logitech UltraX Media Remote
* Conceptronic Remote Control for Windows® Media Center.
* TechniSat USB IR Receiver

I have only tried it on Windows 7 (32bit) and XP (32bit). Most interesting would be to see if this also works under 64bit OSs or if the restricted driver policy will make the replacement driver unusable.

I have build a more convenient driver package that can be downloaded here. It should automatically replace the drivers for all the devices listed above and your USB PC remote also. In this driver package I have removed the WUDFUpdate_XXXXX.dll, as it seems to work without it. Do you have any knowledge for what this DLL is meant for or found any hints that it might be needed?

Plugins for the remotes above can currently only be found in the SVN trunk (here, here and here) as I need to do some more testing. They all use the same DLL that I have placed in the EventGhost core. This DLL is more stupid than yours, as it only delivers the bytes directly, but this way it is really easy to write new plugins in Python that work after the same principle, without touching a compiler.


BTW: The link to the driver package in your first post doesn't seem to work anymore, because of RapidShare's download restrictions.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
tom101
Posts: 8
Joined: Thu Jun 25, 2009 10:22 am

Re: Plugin for USB PC Remote Controller

Post by tom101 »

Hello bitmonster,

I have the aforementioned conceptronic remote control and came across this page searching for a way to enable it for use with media portal. I installed the driver and copied the text from the svn into a text file, renamed it to __init__.py and placed it in the plugins directory in a folder called 'conceptronic'. When I start the plugin though I get this error

Plugin: Conceptronic CLLRCMCE
Error starting plugin: Conceptronic CLLRCMCE
Traceback (most recent call last) (1030):
File "C:\Program Files\EventGhost\eg\Classes\PluginInfo.py", line 318, in Start
File "C:\Program Files\EventGhost\plugins\Conceptronic\__init__.py", line 101, in __start__
File "C:\Program Files\EventGhost\eg\__init__.py", line 55, in __getattr__
AttributeError: 'eg' object has not attribute 'WinUsbRemote'

Is it because I don't have the dll you speak about?

I am no developer so please feel free to tell me to wait until this is properly released, I don't want to waste your time!

Thanks,

Tom
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

Yep, you would need to update the core through SVN, so better wait for the next release of a new Setup.exe.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
tom101
Posts: 8
Joined: Thu Jun 25, 2009 10:22 am

Re: Plugin for USB PC Remote Controller

Post by tom101 »

OK. I'll do that. Thanks again.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

I did some tests under Vista Ultimate x64 and everything is working. The driver signing is no problem, because the WinUsb.sys that is used is already signed by Microsoft. So it behaves exactly as under 32bit-OSs. It needs some work on the driver package to make it flawless easy to install it under 64bit, but this should be solvable.

So I would say, the idea of srs is really the way to go for all of these HID remotes.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Plugin for USB PC Remote Controller

Post by Bitmonster »

Ok, 0.3.7.r1066 is up, with support for the three above listed remote receivers.

I've also updated the driver package again, to support both 32bit and 64bit systems (hopefully) correctly.

Many thx again to srs, for publishing his findings. I guess we will see some more plugins based on his approach in the future.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Plugin for USB PC Remote Controller

Post by Pako »

I own this remote control.
In EventGhost-log appears this entry:

Code: Select all

System.DeviceAttached [u'\\\\?\\USB#Vid_06b4&Pid_1c70#5&28a88d1e&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}']
What should I do to use the same driver, as for Conceptronic, LogitechUltraX and TechniSatUsb?
Pako
Post Reply