Re: Problem with remote control

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Sun, 11 Feb 2007, Guenther Sohler wrote:

> Dear Users,
> 
> On ebay I got a usb remote control. This is a ir receiver having a usb plug and an ir remote control sender.
> 
> It is a  Cypress Semiconductor eDio USB Multi Remote Controller
> from Formosa Industrial Computing, Inc.
> lsusb shows
> Bus 003 Device 023: ID 147a:e006 Formosa Industrial Computing, Inc.
> 
> However I want to receive the key strokes
> 
> I tried
> 
> cat /dev/input/event3 | xxd
> 
> But just the first press after plugging in is received. To receive more events you have to plug in again.
> the same applies to evexec, but the data displayed is incorrect

I can't answer all your questions.  From what you say below, it looks like 
the USB stack is working correctly and any problems probably lie in the 
input layer.

> Looking at usbmon output looks like this ( when something is requesting data from the receiver)
> 
> dee5f2e0 614940404 C Ii:023:01 0 4 = 40001b0f
> dee5f2e0 614940421 S Ii:023:01 -115 4 <
> dee5f2e0 615036386 C Ii:023:01 0 4 = 40801b0f
> dee5f2e0 615036401 S Ii:023:01 -115 4 <
> dee5f2e0 615284335 C Ii:023:01 0 4 = 40801b0f
> dee5f2e0 615284353 S Ii:023:01 -115 4 <
> 
> 
> This looks better. Every keystroke is received.
> But i realized thet the data sent is different. For every event there are 4 bytes sent
> (but my usb keyboard always sends 8 bytes)

Nothing wrong with that; different devices send messages of different 
lengths.

> I suspect an incompatibility with the usbhid driver which requests 8 bytes but just gets 4 bytes each time and so
> just works out for the 1st event.

No.  Your usbmon log shows that the driver requests 4 bytes.

> I really accept writing my own usb driver(i already have experiance) but my driver is never used for my remote device,
> as usbhid still takes precedence and i cannot remove the usbhid driver, because its not compiled as a module.

You don't have to unload usbhid in order to unbind it.  cd to the 
/sys/bus/usb/drivers/usbhid directory and find the filename corresponding 
to your device.  Let's say it is 1-4:1.0 -- then you can do (as root):

	echo -n 1-4:1.0 >unbind

That will unbind usbhid from the device, leaving it available for your 
driver to claim.

> How can I best properly receive the remote keystrokes without having to parse the usbmon output ?

Find out what's wrong with the input parsing and fix it, so that you don't 
need a special driver.

Alan Stern


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.