LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Configure buttons of remote control? (https://www.linuxquestions.org/questions/linux-hardware-18/configure-buttons-of-remote-control-545961/)

DaneelGiskard 04-14-2007 03:25 AM

Configure buttons of remote control?
 
Hi all,

I'm using a remote control (TTS35AI) which is connected to the PC using a USB IR receiver (it came with my Skystar 2 DVB-S card). I'm using the latest kernel on FC6 and it's working flawlessly. I plugged it in and it immediately works, for example, if I press "up" on the remote it has the same effect as pressing the "up" arrow on the keyboard - very nice!

However, I have no idea why or how it works and this is the problem. I have no idea how to map buttons of the remote control to specific keys on the keyboard. Can anyone give me a hint where I can configure this?

Many thanks,
Michael

Nylex 04-14-2007 06:38 AM

Look at the documentation for LIRC.

DaneelGiskard 04-14-2007 06:47 AM

Awesome...that was the missing link - thanks!

DaneelGiskard 04-14-2007 07:45 AM

Hi!

Quote:

Originally Posted by Nylex
Look at the documentation for LIRC.

I now went through the lirc documentation and there are still a few strange things. Could it be that lircd is after all not the program providing me access to the remote controll through the USB IR receiver?

The remote is working. However, I do not get any input at the /dev/lircd socket. The input from the remote is comeing from the /dev/input/event4 socket and if I do a "cat /dev/input/event4" I correctly see the input everytime I press a button.

"cat /proc/bus/input/devices" gives me:

I: Bus=0003 Vendor=147a Product=e02d Version=0110
N: Name="USB IR Receiver USB IR Receiver"
P: Phys=usb-0000:00:0b.0-4/input0
S: Sysfs=/class/input/input4
H: Handlers=kbd event4
B: EV=10000b
B: KEY=e080ffdf01cfffff fffffffffffffffe
B: ABS=30000000000

I have the proper lircd.conf for the remote at /etc
I also have a lircrc at /etc with the following entry:

begin
prog = irexec
button = 9
repeat = 0
config = echo "Hello world!"

However, if I run the irexec command to test it it says:
irexec: could not connect to socket
irexec: Connection refused

I guess it is trying to connect to /dev/lircd, right?

A "cat /dev/lircd" gives me:
"cat: /dev/lircd: No such device or address"

I didn't have any lircd.conf or lircrc before and still the remote worked fine...and it is also working fine while doing all this currently.

Any hints what I'm doing wrong in trying to assign additional keyboard keys to the buttons of the remote?

Many thanks,
Michael

Nylex 04-14-2007 09:14 AM

Ah yes, that would appear to be the case (I can use some of the buttons on my remote under Slackware without LIRC). I think it might just be that the kernel is treating it like a keyboard. As for defining what the buttons do, I think you may need to use LIRC (other than rewriting kernel code perhaps! I think you'd have to do that if you wanted to remap what keyboard keys "did"), but am not sure.

Tovad 04-15-2007 01:49 AM

I am unfortuntely not close to the machine where I did the configuration but I remember that I remapped my remote keys using the KDE Accesability - Keyboard shortcuts - then adding dcop controls.

(such as: dcop kmix Mixer0 setMasterVolume 0)


I also used the following script:

#!/bin/bash
# VolUp
# VolDwn
# Mute
# ChanUp
# ChanDwn
# Get remote keycodes with xev

xmodmap -e 'keycode 174=F20'
xmodmap -e 'keycode 176=F21'
xmodmap -e 'keycode 176=F22'
xmodmap -e 'keycode 99=F23'
xmodmap -e 'keycode 105=F24'

Do a search on xev and xmodmap

Sorry that I cannot be more specific but this should give you couple of hints...

Nylex 04-15-2007 02:42 PM

Hmm, I guess I'm having the same problem really. My remote works under Debian and I haven't got a clue how. I can press the power button on said remote and I get GNOME's log out dialog :/.

DaneelGiskard 04-16-2007 02:06 AM

Hi all,

Quote:

Originally Posted by Nylex
Hmm, I guess I'm having the same problem really. My remote works under Debian and I haven't got a clue how. I can press the power button on said remote and I get GNOME's log out dialog :/.

it works fine for me now. The remote (receiver) was indeed registered as a regular USB device and the special file was /dev/input/eventX where X depends on when you plug it in. What I did is to create udev rules to registere the remote as /dev/usb_irc_receiver. Then I configured lircd to read from this file with driver being dev/input. It works fine now and all my lircrc mappings are accepted.

All the best,
Michael

Nylex 04-16-2007 04:53 AM

That's how mine's set up under Slack. What does your lircrc look like, out of interest?

DaneelGiskard 04-16-2007 05:02 AM

Hi!

Quote:

Originally Posted by Nylex
That's how mine's set up under Slack. What does your lircrc look like, out of interest?

That's still a ToDo for me. I'm currently using the lircrc from this (german) website:
http://mythwiki.de/index.php?title=T...Empf%C3%A4nger

However, the lircrc provided there does not seem to fit the lircd.conf which is provided there. The lircd.conf correctly defines all buttons which are available on the remote, but the lircrc then refers to buttons which are never defined in the lircd.conf. I think the author of this wiki entry made a (copy and paste?) mistake with regards to that.

I'll have to adjust it to my mythtv usage today. Shouldn't take long since that wiki entry does provide all the buttons from the remote and all the mythtv functionalities, it's just a matter of rewriting the lircrc mappings ...

All the best,
Michael


All times are GMT -5. The time now is 06:49 AM.