User Tools

  • (equal to forum credentials)

Site Tools


remotes

This is an old revision of the document!


Configuring a remote

For all users that have remotes that don't or only partially work, here is a guide on how to map your specific device. This step doesn’t include the loading of the necessary kernel modules/specific LIRC hardware.conf configuration. If you have followed the guide below but your remote does not work: please ask for help on the forum.

Step 1: Is your remote recognized?

The first thing you need to do is to make sure your remote is recognized by LIRC:

xbian@xbian:~# sudo su
root@xbian:~# /etc/init.d/lirc stop
root@xbian:~# mode2
space 989187
pulse 2650
space 894
pulse 467
space 413
pulse 475
space 387
pulse 475
space 866
pulse 483
space 835
pulse 1364

If mode2 doesn’t output anything, then your remote isn’t recognized by the system. Ask for support so we can figure out what the right hardware.conf should be.

If you use GPIO on the rpi add “lirc_rpi gpio_in_pin=#” to /etc/modules (replace # with your input pin) also, move and rename /etc/lirc/hardware/lirc_rpi.conf to /etc/lirc/hardware.conf

Step 2 - Check if LIRC recognized the buttons of your remote

Start irw and check if it generates output when you press a button on your remote.

root@xbian:~# /etc/init.d/lirc start
root@xbian:~# irw
000000037ff07be1 00 KEY_ARROWUP logitech-harmony-300i
000000037ff07be1 01 KEY_ARROWUP logitech-harmony-300i
000000037ff07be1 02 KEY_ARROWUP logitech-harmony-300i

If all buttons are recognized by LIRC, go directly to Step 4. If some or non of the buttons are recognized go to Step 3a.

Step 3 - Mapping your remote

Step 3a - Check online if your remote is already mapped

Lets say we have a Microsoft XBOX remote

Go to http://lirc.sourceforge.net/remotes/ Look for Microsoft then open that folder. There we see 3 files names XBOX:

  • Xbox
  • Xbox360
  • lircd.conf.xbox

Open those files and paste its content at the end of /etc/lirc/lircd.conf.

Restart LIRC:

root@xbian:~# /etc/init.d/lirc restart

And recheck if Step 2 generates output. If it does go to Step 4, if not, then remove the old settings from /etc/lirc/lircd.conf and try one of the other configuration files by repeating step 3a. If none of these configuration files work, then go to step 3b.

Step 3b - Create a custom LIRC config

If no configuration file exists, create a custom one. One important step for creating a custom LIRC map is that you give logical names to each button, and those names are uniform between remotes. For that purpose LIRC has create ‘namespaces’. A list of namespaces and there meanings can be found here

Creating a custom LIRC map is done by using irrecord:

root@xbian:~# irrecord /home/xbian/remote.conf

irrecord is pretty verbose so just carefully follow all steps. When you’re done, you will end up with a custom LIRC map for your specific remote in /home/xbian/remote.conf

Edit this file (/home/xbian/remote.conf ) and look for the parameter name. This should say

name  /home/xbian/remote.conf

Change this name in the name of your remote e.g.:

name  Xbox_Remote

The file should now look similar to this:

begin remote

name  Xbox_Remote
bits            8
eps            30
aeps          100

one             0     0
zero            0     0
gap          163983
toggle_bit_mask 0x0

begin codes
left                     0xA9
up                       0xA6
right                    0xA8
down                     0xA7
enter                    0x0B

Now close the new file and append its content to the lircd.conf and start LIRC:

root@xbian:~# cat /home/xbian/remote.conf >> /etc/lirc/lircd.conf
root@xbian:~# /etc/init.d/lircd start

Now repeat Step 2 to check if all buttons of your remote are recognized. When you miss some buttons simply redo Step 3b. However, remember to first remove the old config from /etc/lirc/lircd.conf. If all buttons are recognized by LIRC, go to Step 4.

Step 4 - Create a XBMC lircmap

The next step is to create a map that maps the buttons of your remote to XBMC functions. To do this, create a new file (if it doesn’t already exists):

root@xbian:~# nano /home/xbian/.xbmc/userdata/Lircmap.xml

The content of this file should look similar to this:

<lircmap>
<remote device="logitech-harmony-300i">
<up>KEY_ARROWUP</up>
<down>KEY_ARROWDOWN</down>
<left>KEY_ARROWLEFT</left>
<right>KEY_ARROWRIGHT</right>
</remote>
</lircmap>

This file contains three important aspects. All of this information can be distracted from the irw output in step 2:

root@xbian:~# irw
000000037ff07be1 00 KEY_ARROWUP logitech-harmony-300i
000000037ff07be1 01 KEY_ARROWUP logitech-harmony-300i
000000037ff07be1 02 KEY_ARROWUP logitech-harmony-300i

The name of your remote, in this case “logitech-harmony-300i”.

<remote device="logitech-harmony-300i">
Make sure this device is the same as the name in your lircd.conf you just made, or the irw output.

The second and third aspects are the name of the LIRC button and the make of the XBMC command:

<up>KEY_ARROWUP</up>
You saw in step 2 that one of my LIRC buttons is called KEY_ARROWUP. In this case KEY_ARROWUP is linked to the XBMC command up.

A full list of all commands XBMC understands can be found in /usr/local/share/xbmc/system/keymaps/remote.xml. The top of this file looks like this:

<keymap>
<global>
<remote>
<play>Play</play>
<pause>Pause</pause>
<stop>Stop</stop>
<forward>FastForward</forward>
<reverse>Rewind</reverse>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
As you can see, the up is obviously connected to Up. A more interesting example:

Lircmap.xml

<green>KEY_YELLOW</green>
This means that KEY_YELLOW from my logitech-remote-300i is linked to the green command of XBMC.

remote.xml

<green>XBMC.ActivateWindow(MyVideos)</green>
The green command is linked to the internal command XBMC.ActivateWindow(MyVideos). This means that when i push the yellow button of my remote, the MyVideos window is opened.

Now create a Lircmap.xml for all buttons of your remote. When to want to test your config start XBMC again

root@xbian:~# service xbmc start
Whenever you change something in your the config files, restart XBMC to let the changes take effect:
root@xbian:~# service xbmc restart

Step 5 - Share your remote config with us

When you have created a custom lircd.conf + Lircmap.xml that has a generic functionality, please share them with us by mailing these two files to development@xbian.org. We will include them in our default XBian releases. Please remember to only change lircd.conf and Lircmap.xml. Also provide your (nick)name and email address would users have questions. If you have followed all steps above but your remote does not work: please ask for help at the forum.

Additional Note: If XBMC responds to LIRC after:

root@xbian:~# service xbmc restart
But not on system reboot. You may have a problem with XBMC starting too quickly on boot. One solution too this is to edit the 4th line of /etc/init/xbmc-preload.conf to read:

start on stopping mountall and started networking and net-device-up wlan0

This only applies to a network enabled setup, change wlan0 to eth0 if you use ethernet.

remotes.1401891532.txt.gz · Last modified: 2014/06/04 16:18 by ollie smith