You are not logged in.

#1 2009-05-01 15:43:43

the_isz
Member
Registered: 2009-04-14
Posts: 280

Suggestions needed for programming a driver for an USB IR receiver

Hi all,

before I start explaining my problems and plans, I'd like to apologize for the massive text wall coming in. This thread is not only a call for help,
but also an attempt to structure my ideas and thoughts. I'll try to structure my text as good as possible, so that reading it will be as pleasent as
possible.

The goal

This is short: I want to control programs such as vlc with a remote control. Best would be an all-in-one remote, so I can finally clear the table of
our flat a little.

The situation:

Without much knowledge about IR and linux (I just read around on the lirc website and in the Arch linux wiki a little), I decided that it's possibly
best to just buy a cheap usb receiver and then see which problems I come across. No sooner said than done. I attached it to my pc and it was
immediately recognized:

May  1 15:40:48 Discworld kernel: SigmaTel STIr4200 IRDA/USB found at address 2, Vendor: 66f, Product: 4200
May  1 15:40:48 Discworld kernel: irda0 (stir4200): not using net_device_ops yet
May  1 15:40:48 Discworld kernel: stir4200 5-1:1.0: IrDA: Registered SigmaTel device irda0
May  1 15:40:48 Discworld kernel: usbcore: registered new interface driver stir4200

I'm also able to bring up a network interface for the device:

root ~ ifconfig irda0 up
root ~ ifconfig irda0
irda0     Link encap:IrLAP  HWaddr d8:14:d4:60  
          UP RUNNING NOARP  MTU:2048  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:8 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

The problem

That's when I started googling around on how to get this thing working. It didn't take long to find out that many people encountered the same
problem before. Unfortunately, it turned out that lirc doesn't support the device.

The way I see it is that the driver is intended to communicate with other devices such as laptops, PDAs or mobile phones, but not to receive raw
IR signals. It probably waits for a device knowing a certain protocol, which no remote control will ever handle.

Now, I could send the receiver back, but as I was looking for a hobby project anyway, I thought maybe I could get this thing working over time.

The problem is: I don't know where to start my work! So I really could use some input from experienced hardware/driver programmers.

My ideas

I already thought about where to start, so I'll just write down my ideas in case one of it is good smile

The first idea is to communicate with the device over the network interface. If this was possible, all I had to do was write a script or program that
attaches itself to the network interface listening to incoming transmissions.

The second idea would be to take the driver's sources (they're public source) and modify them to create an lirc driver that is not intended to
connect to other devices but instead can receive any transmission, passing them on to lirc. I already found a datasheet on the device, which might
prove helpful to understand the messages coming from the device.

Lastly, it might be possible to write a new program that retrieves the usb device from the operating system and reads values from it. This might
be similar to the second suggestion, but as I don't know how difficult writing an own driver is, this might be an easier solution which is just not
compatible with lirc.

What I need

So, I would really appreciate any knowledge an experienced hardware/driver programmer would kindly share with me. What I need most is an
idea on where to start learning and which way is the most promising. Oh yeah, if this idea is total bullshit and the hardware doesn't allow for such
games anyway, I'd like to know that, too big_smile

Thank you very much in advance!

Offline

Board footer

Powered by FluxBB