[LINUX] HOW-TO use all custom buttons of your remote control with LIRC
#46
Thanks for the quick reply!
OK, now I understand the difference between keymap.xml and remote.xml. I have renamed to keymap.xml to remote.xml (under "/.xbmc/userdata/Keymap.xml $HOME/.xbmc/userdata/keymaps/")

Quote:When using irw you should always see a line which lists the name of the remote and the name of the button which was pressed. Otherwise something is wrong with your LIRC setup.

I agree that something must be wrong in the LIRC configuration. Do you have any hint what I have to check? Do you think I have to reinstall LIRC? (By the way, I don't know how).
Reply
#47
Zubbeli Wrote:Thanks for the quick reply!
OK, now I understand the difference between keymap.xml and remote.xml. I have renamed to keymap.xml to remote.xml (under "/.xbmc/userdata/Keymap.xml $HOME/.xbmc/userdata/keymaps/")

You should delete your Keymap.xml file if you have a userdata/remote.xml file. Otherwise it could cause problems in the future.


Quote:I agree that something must be wrong in the LIRC configuration. Do you have any hint what I have to check? Do you think I have to reinstall LIRC? (By the way, I don't know how).

The fact that you get some irw-output, shows that you LIRC configuration is not completely messed up. Can you provide a sample of the irw-output you receive?

Reinstalling lirc is not required. But if you really want to, you can do it with:

Code:
sudo apt-get install --reinstall lirc


Normally it is enough to just fix the configuration problem. You can do that by reconfiguring LIRC:

Code:
sudo dpkg-reconfigure lirc
Reply
#48
Quote:The fact that you get some irw-output, shows that you LIRC configuration is not completely messed up. Can you provide a sample of the irw-output you receive?

I receive by pressing some buttons on the remote:
Code:
^[[A^[[B^[[C^[[D
Reply
#49
Zubbeli Wrote:I receive by pressing some buttons on the remote:
Code:
^[[A^[[B^[[C^[[D

Ok, that looks pretty messed up :-)

Try to reconfigure LIRC and make sure you select the correct IR-receiver and the correct remote control. If your remote is not supported you need to create a custom lircd.conf file using irrecord.
Reply
#50
I've used "devunit" before upgarding to dharma 3 which worded pretty good by follwing the Wiki from

Code:
http://forum.xbmc.org/showthread.php?tid=60068&highlight=dharma&page=2
(I have exactly the same hardware)

I reconfigure manually again in the same way (except the keymap.xml) without sucess.

I do not know what I can select by using "sudo dpkg-reconfigure lirc"
Reply
#51
Zubbeli Wrote:
Code:
http://forum.xbmc.org/showthread.php?tid=60068&highlight=dharma&page=2
(I have exactly the same hardware)

Then you are probably better off asking in that thread. I can only give you general advice about LIRC debugging.

Quote:I reconfigure manually again in the same way (except the keymap.xml) without sucess.

Forget about Lircmap.xml and keymap.xml/remote.xml - that's all XBMC stuff. You only need two programs to debug LIRC:
  • mode2: Connects to the hardware device and displays the raw IR codes.
  • irw: Connects to the LIRC subsystem and displays the translated button codes.

Using mode2

First you have to check if the LIRC driver is working correctly. This can be done using mode2. As LIRC allows the configuration of multiple IR receivers on one PC, you have to know the device name of the hardware driver. Usually that is "/dev/lirc" or "/dev/lirc0",... In your case this seems to be "/dev/input/irremote" but I would have a look for /dev/lirc* devices too and test them as well.

When you know the device name you can test it using mode2. Start...
Code:
mode2 -d <device-name>
... and press some buttons on your remote. You should see some numbers on the screen whenever you press a button. If you _do_ see some numbers, then you found the right device. If you don't see any numbers, try another device.

Let's say you found "/dev/lirc" to be the right device name. Now you have to add this device name to your /etc/lirc/hardware.conf file. The configuration variable is named REMOTE_DEVICE. So if /dev/lirc is the correct device, somewhere in your hardware.conf should be the line:
Code:
REMOTE_DEVICE="/dev/lirc"

Now you can restart LIRC using:
Code:
sudo service lirc restart


Using irw

irw is used to validate your /etc/lirc/lircd.conf file. The lircd.conf contains a translation map which allows to map incoming ir-codes to cleartext button names. The LIRC service uses this file to translate the incoming ir-codes. The translated button names are then send to the client applications like i.e. XBMC.

irw is therefore the most basic infrared application which is possible. It just connects to the LIRC service and spits out whatever button names it receives. So basically if mode2 did not provide any output you don't need to try irw, because without a working device the LIRC service can not do its job and therefore irw will not receive any valid data.

If irw does work, you can start configuring your XBMC Lircmap.xml and remote.xml. If it does not work, but mode2 works, then your /etc/lirc/lircd.conf file is wrong. In this case you either have to find a valid /etc/lirc/lircd.conf file for your remote or you have to create a custom one using irrecord.
Reply
#52
First of all thank you for the detailed answers!

When I'm trying

Code:
mode2 -d /dev/input/irremote

I will get the following reply:

Code:
mode2: could not get hardware features
mode2: this device driver does not support the LIRC ioctl interface
mode2: did you mean to use the devinput driver instead of the default driver?

I found one /dev/lirc* -> it's /dev/lircd. So I tried

Code:
mode2 -d /dev/lircd

and I will get the same strange replies from the remote as with IRW (^[[A^[[B^[[C^[[D ...). There is no more /dev/lirc* existing.

These are my "devs" under /dev:

Code:
adsp             loop4               ram5        tty1   tty39  ttyS1
audio            loop5               ram6        tty10  tty4   ttyS2
block            loop6               ram7        tty11  tty40  ttyS3
bsg              loop7               ram8        tty12  tty41  urandom
bus              mapper              ram9        tty13  tty42  usb
cdrom            mcelog              random      tty14  tty43  usbmon0
cdrw             mem                 rfkill      tty15  tty44  usbmon1
char             mixer               root        tty16  tty45  usbmon2
console          net                 rtc         tty17  tty46  usbmon3
core             network_latency     rtc0        tty18  tty47  usbmon4
cpu_dma_latency  network_throughput  scd0        tty19  tty48  vcs
disk             null                sda         tty2   tty49  vcs1
dsp              nvidia0             sda1        tty20  tty5   vcs2
dvd              nvidiactl           sda2        tty21  tty50  vcs3
dvdrw            oldmem              sda5        tty22  tty51  vcs4
ecryptfs         pktcdvd             sda6        tty23  tty52  vcs5
fb0              port                sdb         tty24  tty53  vcs6
fd               ppp                 sequencer   tty25  tty54  vcs7
full             psaux               sequencer2  tty26  tty55  vcs8
fuse             ptmx                sg0         tty27  tty56  vcs9
hidraw0          pts                 sg1         tty28  tty57  vcsa
hidraw1          ram0                sg2         tty29  tty58  vcsa1
hidraw2          ram1                shm         tty3   tty59  vcsa2
hpet             ram10               snapshot    tty30  tty6   vcsa3
input            ram11               snd         tty31  tty60  vcsa4
kmsg             ram12               sndstat     tty32  tty61  vcsa5
lircd            ram13               sr0         tty33  tty62  vcsa6
log              ram14               stderr      tty34  tty63  vcsa7
loop0            ram15               stdin       tty35  tty7   vcsa8
loop1            ram2                stdout      tty36  tty8   vcsa9
loop2            ram3                tty         tty37  tty9   vga_arbiter
loop3            ram4                tty0        tty38  ttyS0  zero

and under /dev/input it's

Code:
by-id    event0  event2  event4  event6    mice    mouse1
by-path  event1  event3  event5  irremote  mouse0  mouse2

Do you think I need to try any other as "/dev/lircd"?
Reply
#53
Zubbeli Wrote:
Code:
mode2 -d /dev/input/irremote

I will get the following reply:

Code:
mode2: could not get hardware features
mode2: this device driver does not support the LIRC ioctl interface
mode2: did you mean to use the devinput driver instead of the default driver?

So /dev/input/irremote is definetly the wrong device. I just picked it up when taking a quick look at the thread you posted. Normally all LIRC devices have a name of /dev/lirc?.

Quote:I found one /dev/lirc* -> it's /dev/lircd. So I tried

/dev/lircd is the device (socket) which client applications like XBMC, irw, etc. use to connect to the LIRC service. So that can't be used as an input device.

You are looking for a lirc device which is either called /dev/lirc or /dev/lircN (with N being a number). However it is possible that certain device drivers might use different names like /dev/input/irremote. This however is off standard. All LIRC devices should use a name of /dev/lircN.


Quote:Do you think I need to try any other as "/dev/lircd"?

Yes, you need a real LIRC device. It seems that the hardware driver of your IR receiver is either not loaded or not properly configured or just broken. Otherwise you would have a /dev/lircN device. You can now check the output of the command "dmesg" to see if LIRC attempted to load a driver. "dmesg" outputs all kernel messages since the last boot. So the output is very long. Just search for some lines containing LIRC.

If you don't find any LIRC lines in your dmesg output then your driver is probably not loaded or not installed. You might want to paste your dmesg output on http://pastebin.com so others can have a look at it.

If you already know the name of your driver, you can just try to load it. Just unload it in case it is already loaded; reload it and check the dmesg output. You can do that with:

Code:
sudo rmmod <driver-name>
sudo modprobe <driver-name>
dmesg
ls -l /dev/lirc*
Reply
#54
I am having trouble getting my MCE remote working on my current XBMC linux edition.

I am running Debian squeeze kernel 2.6.32.5, XBMC PRE-10.5 r34598 (compiled Oct. 9 2010) from SVN.

I got lircd setup correct I belive:
Code:
XXXXX@XXXXX:~/$ irw
000000037ff07be1 00 Up mceusb
000000037ff07be1 01 Up mceusb
000000037ff07be1 02 Up mceusb
000000037ff07be1 03 Up mceusb

I got the following files:
~/.xbmc/userdata/keymaps/Lircmap.xml:
Code:
<lircmap>
  <remote device="mceusb">
    <left>Left</left>
    <right>Right</right>
    <up>Up</up>
    <down>Down</down>
  </remote>
</lircmap>

~/.xbmc/userdata/keymaps/remote.xml:
Code:
<keymap>
  <global>
    <remote>
      <left>Left</left>
      <right>Right</right>
      <up>Up</up>
      <down>Down</down>
    </remote>
  </global>
</keymap>

but I cannot use my remote in XBMC?
Reply
#55
terr1 Wrote:~/.xbmc/userdata/keymaps/Lircmap.xml:

Lircmap.xml belongs in the directory "~/.xbmc/userdata/".
The Lircmap.xml is not a keymap. It is a IR-button to XBMC-event map.
Reply
#56
Ah ok.. I moved the file, still no action (I have restarted XBMC) :/

I can start XBMC using my remote (irexec) fine.. so the remote works.. just the XBMC connection that dont.

Any difference if lirc wasent installed at compile point? (if .configure picks it up somehow)
Reply
#57
terr1 Wrote:Ah ok.. I moved the file, still no action (I have restarted XBMC) :/

I can start XBMC using my remote (irexec) fine.. so the remote works.. just the XBMC connection that dont.

Any difference if lirc wasent installed at compile point? (if .configure picks it up somehow)

Enable debug mode in System->System; restart XBMC and paste the logfile on http://pastebin.com

We can then have a look at the debug output and see why XBMC does not like your configuration.

EDIT:
The logfile can be found in ~/.xbmc/temp/xbmc.log
Reply
#58
XBMC log:
http://pastebin.com/tWGNN3vT
Reply
#59
terr1 Wrote:XBMC log:
http://pastebin.com/tWGNN3vT


20:23:52 T:140630000400448 M:3218575360 INFO: LIRC Initialize: using: /dev/lircd
20:23:52 T:140630000400448 M:3218575360 INFO: LIRC Initialize: connect failed: No such file or directory

Your system uses another device name for the LIRC daemon. In many cases that is /var/run/lircd. You either have to reconfigure lirc to use /dev/lircd or reconfigure XBMC to use the correct path of your distribution.
Reply
#60
DOH, I dont know why I missed that message.. I looked twice.. GAH sorry for wasting your time..

sudo ln -s /var/run/lirc/lircd /dev/ did the trick.. thanks
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] HOW-TO use all custom buttons of your remote control with LIRC2