Problems with RC-5, arduino and usbx

Gerion Entrup <[email protected]>
Newsgroups gmane.comp.hardware.lirc
Message-ID <2233981.F0UDpa85ms@gump>
Hi,

I own a Hauppauge TV card with a remote, that was perfectly supported by the 
kernel with lirc and the devinput driver.
Anyway I don't use the the TV function, so I tried to use the remote with an 
arduino and communicate per USB serial with the Linux system.

The detection of the remote control with the arduino was no problem and also
not the output per Serial. The problem is creating a correct lircd.conf.

I decided to use the usbx over the girs driver, bacause of the simple layout 
(on both sides) and no overhead of speaking to the arduino (I also want to use 
the arduino for another service, where only sending signals to the arduino is 
neccessary).

I configured the Arduino to send the following _ASCII_ sequences over the 
Serial line (everything after "#" is not send, but a comment):
07BD #Press key POWER.
17BD #Press key POWER again.
07BD #Press and hold key Power ...
07BD # ...
07BD # ... up to here.
17A5 #Press key OK.

With this output irrecord produces the following lircd.conf file:
------------
begin remote

  name  hauppauge
  driver usbx
  bits           32
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  post_data_bits  16
  post_data      0xD0A
  gap          113942
  toggle_bit_mask 0x1000000
  frequency    38000

      begin codes
          KEY_OK                   0x30374135
          KEY_PLAY                 0x30374235
          KEY_LEFT                 0x30373936
          KEY_0                    0x30373830
          KEY_RIGHT                0x30373937
         ...
      end codes

end remote
------------
The 0x30374135 is the correct hexadecimal bit sequence of the sended ASCII 
code. All codes for all keys differ at least in one byte. The toggle_bit_mask 
describes also the correct bit, that toggles between ASCII '0' = 0x30 and 
ASCII '1' = 0x31.

lircd started with this lircd.conf works in principle. Anyway, there are two 
problems:


Problem 1: You have to click two times, until a button press is recognized.

I've seen in the FAQ, that this is a common problem for RC-5 remotes. But the 
answer in the FAQ refers to a config file, that I cannot find in the sources. I 
found some in the Internet, that sets "flags RC5". Anyway, this line does not 
change anything. The second part of the answer refers to a link, that does not 
exist anymore. I have found in the wiki on sourceforge something similar, but 
this has not helped.
Of course, I can modify the arduino code, so that always two key presses are 
sent, when pressing one key. This works, but does not solve problem 2.


Problem 2: Some keys are recognized as other ones.

For example the key "KEY_5" is mapped to the sequence 0x30373835, which is 
correct, but irw recognizes the key as "KEY_DOWN":
0000303739350d0a 00 KEY_DOWN hauppauge
which is a code, that is not sent over the serial line.
This does not happen to all buttons of the remote, maybe 30% or so.

Do you have an explanation or a hint, how to fix these problems?

Regards,
Gerion

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
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.