<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jpascher</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jpascher"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Jpascher"/>
	<updated>2026-07-13T15:19:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=HOW-TO:Set_up_LIRC&amp;diff=129458</id>
		<title>HOW-TO:Set up LIRC</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=HOW-TO:Set_up_LIRC&amp;diff=129458"/>
		<updated>2017-04-30T14:22:03Z</updated>

		<summary type="html">&lt;p&gt;Jpascher: /* Download and install Lirc */ update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav| [[Remotes]] | [[LIRC]] }}&lt;br /&gt;
&lt;br /&gt;
{{cleanup}}&lt;br /&gt;
&lt;br /&gt;
This guide explains how to set up Kodi to understand a universal remote&#039;s commands (so not the standard MCE remotes that work out of the box). You obviously need some hardware device for this that reads infrared commands. I&#039;m using a cheap (+- 10 euro) device called the IRMan. You can find a list of supported devices [http://www.lirc.org/html/table.html here].&lt;br /&gt;
&lt;br /&gt;
== Download and install Lirc ==&lt;br /&gt;
First you have to download and install Lirc. If you&#039;re using Ubuntu or Debian you can just type &#039;&#039;&#039;apt-get install lirc&#039;&#039;&#039;. If you don&#039;t have a lirc package in you distribution or (in my case) a buggy version, it&#039;s pretty easy to compile lirc from source:&lt;br /&gt;
&lt;br /&gt;
 user@computer:~$ wget http://prdownloads.sourceforge.net/lirc/lirc-0.9.4b.tar.bz2&lt;br /&gt;
 user@computer:~$ tar -jxf lirc-0.9.4b.tar.bz2&lt;br /&gt;
 user@computer:~$ cd lirc-0.9.4b&lt;br /&gt;
 user@computer:~/lirc-0.9.4b$ aclocal &amp;amp;&amp;amp; autoheader &amp;amp;&amp;amp; autoconf&lt;br /&gt;
 user@computer:~/lirc-0.9.4b$ ./configure --with-x --with-driver=irman  (or whatever remote you are using, check ./configure --help for supported ones - for homebrew serial IR use --driver=serial)&lt;br /&gt;
 user@computer:~/lirc-0.9.4b$ make &amp;amp;&amp;amp; sudo make install&lt;br /&gt;
&lt;br /&gt;
Next comes the interesting part.&lt;br /&gt;
&lt;br /&gt;
== Configure Lirc to understand your remote&#039;s commands ==&lt;br /&gt;
You have downloaded and installed Lirc and are now ready to set it up. First, check if your IR receiver is already preconfigured. Ubuntu stores the configuration files in &#039;&#039;&#039;/usr/share/lirc/remotes&#039;&#039; but you can also find them in the source tree in the remotes directory. If you can find you remote, copy the config file to /etc/lirc/lircd.conf and open the file with a text editor. Delete the lines between &#039;&#039;begin codes&#039;&#039; and &#039;&#039;end codes&#039;&#039;.&lt;br /&gt;
 &lt;br /&gt;
=== Learning Commands ===&lt;br /&gt;
Now we&#039;re going to learn commands. Fire up &#039;&#039;&#039;irrecord&#039;&#039;&#039; with the following command:&lt;br /&gt;
 user@computer:~$ sudo -s ## you have to be root for this part&lt;br /&gt;
 [sudo] password for user:&lt;br /&gt;
 root@computer:~# cd /etc/lirc&lt;br /&gt;
 root@computer:/etc/lirc# irrecord --driver=irman --device=/dev/ttyS0 MyRemote ## use the driver that you chose in the previous part. /dev/ttyS0 = first com port&lt;br /&gt;
&lt;br /&gt;
You&#039;ll get a wall of text and are asked to press enter. Next you&#039;ll see a prompt.&lt;br /&gt;
 Hold down an arbitrary button.&lt;br /&gt;
Just hold down any button on your remote until the next prompt. &lt;br /&gt;
 Found gap length: 215947&lt;br /&gt;
 Now enter the names for the buttons.&lt;br /&gt;
Now you have to learn all buttons. Enter a name, press enter, hold down the button you are learning and repeat. When you&#039;re done, press enter. Press one button on your remote as fast as possible but DO NOT hold it down.&lt;br /&gt;
 &lt;br /&gt;
=== Testing the new lirc configuration ===&lt;br /&gt;
Next we&#039;re going to test the config file we just created. Start lirc with the following command:&lt;br /&gt;
 root@computer:/etc/lirc# lircd --driver=irman --device=/dev/ttyS0 /etc/lirc/MyRemote&lt;br /&gt;
You can test your config by starting irw:&lt;br /&gt;
 root@computer:/etc/lirc# irw&lt;br /&gt;
Press the buttons on your remote you just learned and see if they match. Press ctrl+c to quit irw. If there&#039;s a problem, stop lirc with&lt;br /&gt;
 root@computer:/etc/lirc# killall lircd&lt;br /&gt;
delete the file we just created&lt;br /&gt;
 root@computer:/etc/lirc# rm -f MyRemote&lt;br /&gt;
and repeat the whole learning process back from the top. If it still doesn&#039;t work, have a look at [http://www.lirc.org/html/help.html#new_remote this site] or ask on the forums.&lt;br /&gt;
 &lt;br /&gt;
=== Make the changes to lirc ===&lt;br /&gt;
If &#039;&#039;irw&#039;&#039; gave the right output, stop lirc with&lt;br /&gt;
 root@computer:/etc/lirc# killall lircd&lt;br /&gt;
and move the file we created to lircd.conf&lt;br /&gt;
 root@computer:/etc/lirc# mv MyRemote lircd.conf&lt;br /&gt;
Finally start up lirc with&lt;br /&gt;
 root@computer:/etc/lirc# /etc/init.d/lircd start&lt;br /&gt;
You can now leave your root shell.&lt;br /&gt;
&lt;br /&gt;
== Configure Kodi to understand Lirc&#039;s commands ==&lt;br /&gt;
So now that you configured lirc and &#039;&#039;irw&#039;&#039; gives the expected output, it&#039;s time to let lirc talk to Kodi. Start your text editor and open the file named &#039;&#039;&#039;Lircmap.xml&#039;&#039;&#039;, which is usually located in &#039;&#039;&#039;$home$/.kodi/userdata/&#039;&#039;&#039; and the generic is on &#039;&#039;&#039;/usr/share/Kodi/system/&#039;&#039;&#039;.&lt;br /&gt;
There are some remotes in there by default. Copy the part between&lt;br /&gt;
 &amp;amp;lt;remote device=&amp;quot;mceusb&amp;quot;&amp;amp;gt; ... &amp;amp;lt;/remote&amp;amp;gt;&lt;br /&gt;
and paste it in the file. Change the new &#039;&#039;mceusb&#039;&#039; to &#039;&#039;MyRemote&#039;&#039; (or whatever name you picked for your remote in the lirc configuration) and change the values of the tags to the names of the buttons. If you forgot them, they are in /etc/lirc/lircd.conf.&lt;br /&gt;
 &lt;br /&gt;
The &#039;&#039;&#039;Lircmap.xml&#039;&#039;&#039; configuration is explained in more detail in [http://forum.kodi.tv/showthread.php?t=45972 this forum post]&lt;br /&gt;
&lt;br /&gt;
== It works :) ==&lt;br /&gt;
&lt;br /&gt;
remember order to use lirc on Kodi (generic for ubuntu)&lt;br /&gt;
first install modules&lt;br /&gt;
then compiling lirc&lt;br /&gt;
then setting remote&lt;br /&gt;
&lt;br /&gt;
== Changes in Linux IR ==&lt;br /&gt;
&lt;br /&gt;
With kernel 2.6.35 some changes began to be made in the way Linux handles infrared remotes. What used to be a job just for LIRC is now partly done by the Linux kernel. Some distributions &#039;backport&#039; changes to the kernel, so even though your kernel is older than 2.6.35 it might affect you.&lt;br /&gt;
&lt;br /&gt;
The drivers for several remotes have been moved into the kernel and this means that many of them should &#039;Just Work&#039; out of the box. Unfortunately LIRC, the LIRC configuration tools, the distribution setup scripts for LIRC and most of the documentation available has not yet (as of February 2011) been updated to reflect these changes.&lt;br /&gt;
If you are experiencing problems, your remotedriver may have been moved to the kernel. In this case, try to setup LIRC with &#039;devinput&#039; as the driver (and something like /dev/input/event3 as the device).&lt;br /&gt;
Further reading:&lt;br /&gt;
[http://www.lirc.org/html/configuration-guide.html#key-symbols-using-linux-input-layer Getting the key symbols using linux input layer]&lt;br /&gt;
[http://lirc.org/html/devinput.html Linux input layer driver]&lt;br /&gt;
&lt;br /&gt;
[[Category:How-to|Lirc]]&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Kodibuntu]]&lt;br /&gt;
[[Category:Remotes]]&lt;/div&gt;</summary>
		<author><name>Jpascher</name></author>
	</entry>
</feed>