<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://etcwiki.org/index.php?action=history&amp;feed=atom&amp;title=LIRC_-_Raspberry_Pi</id>
	<title>LIRC - Raspberry Pi - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://etcwiki.org/index.php?action=history&amp;feed=atom&amp;title=LIRC_-_Raspberry_Pi"/>
	<link rel="alternate" type="text/html" href="http://etcwiki.org/index.php?title=LIRC_-_Raspberry_Pi&amp;action=history"/>
	<updated>2026-05-04T13:48:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://etcwiki.org/index.php?title=LIRC_-_Raspberry_Pi&amp;diff=3268&amp;oldid=prev</id>
		<title>Ddxfish at 15:53, 14 October 2013</title>
		<link rel="alternate" type="text/html" href="http://etcwiki.org/index.php?title=LIRC_-_Raspberry_Pi&amp;diff=3268&amp;oldid=prev"/>
		<updated>2013-10-14T15:53:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[File:Raspberry-pi-infrared-sensor-diagram.png|thumb|right|alt RPi Connected to a TSOP4838]]&lt;br /&gt;
This is a complicated guide to setting up LIRC on the Raspberry Pi to run remote commands.&lt;br /&gt;
[[Category:Raspberry Pi]]&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Materials&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Vishay TSOP4838 $4 (aka 38kHz Infrared (IR) Receiver Module - Part Number 276-640 at Radio Shack)&lt;br /&gt;
&lt;br /&gt;
Start by installing LIRC&lt;br /&gt;
 apt-get install lirc&lt;br /&gt;
&lt;br /&gt;
Now, edit the file /etc/lirc/hardware.conf&lt;br /&gt;
 # /etc/lirc/hardware.conf&lt;br /&gt;
 #&lt;br /&gt;
 # Arguments which will be used when launching lircd&lt;br /&gt;
 LIRCD_ARGS=&amp;quot;&amp;quot;  &lt;br /&gt;
 &lt;br /&gt;
 #Don&amp;#039;t start lircmd even if there seems to be a good config file&lt;br /&gt;
 #START_LIRCMD=false&lt;br /&gt;
 &lt;br /&gt;
 #Don&amp;#039;t start irexec, even if a good config file seems to exist.&lt;br /&gt;
 START_IREXEC=true&lt;br /&gt;
 &lt;br /&gt;
 #Try to load appropriate kernel modules&lt;br /&gt;
 LOAD_MODULES=true&lt;br /&gt;
 &lt;br /&gt;
 # Run &amp;quot;lircd --driver=help&amp;quot; for a list of supported drivers.&lt;br /&gt;
 DRIVER=&amp;quot;default&amp;quot;&lt;br /&gt;
 # usually /dev/lirc0 is the correct setting for systems using udev&lt;br /&gt;
 DEVICE=&amp;quot;/dev/lirc0&amp;quot;&lt;br /&gt;
 MODULES=&amp;quot;lirc_rpi&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Default configuration files for your hardware if any&lt;br /&gt;
 LIRCD_CONF=&amp;quot;&amp;quot;&lt;br /&gt;
 LIRCMD_CONF=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now edit the file &amp;#039;&amp;#039;&amp;#039;/etc/modules&amp;#039;&amp;#039;&amp;#039; and add this line&lt;br /&gt;
 lirc_rpi&lt;br /&gt;
&lt;br /&gt;
Now edit (or make) the file &amp;#039;&amp;#039;&amp;#039;/lib/udev/rules.d/98-lircd.rules&amp;#039;&amp;#039;&amp;#039; and add this line&lt;br /&gt;
 KERNEL==&amp;quot;lirc[0-9]*&amp;quot;,   SUBSYSTEM==&amp;quot;lirc&amp;quot;, SUBSYSTEMS==&amp;quot;platform&amp;quot;, GOTO=&amp;quot;begin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now test to see if receiver works, run this and press some buttons, see anything?&lt;br /&gt;
 /etc/init.d/lirc stop&lt;br /&gt;
 mode2 -d /dev/lirc0&lt;br /&gt;
&lt;br /&gt;
Now setup your remote control or use a default lircd.conf for a remote on file with LIRC&lt;br /&gt;
Notes: setup as many or as few buttons as you want. I would recommend doing them all now.&lt;br /&gt;
 irrecord --list-namespace      (print or save this, you will need it during setup)&lt;br /&gt;
 irrecord -d /dev/lirc0 ~/lircd.conf     (follow instructions and use above command for key names)&lt;br /&gt;
&lt;br /&gt;
Now copy the created ~/lircd.conf to its new home&lt;br /&gt;
 mv /etc/lirc/lircd.conf /etc/lirc/lircd.original    (backup original)&lt;br /&gt;
 cp ~/lircd.conf /etc/lirc/lircd.conf     (Copy it home)&lt;br /&gt;
&lt;br /&gt;
Now test your keys and remote setup&lt;br /&gt;
 service lirc restart&lt;br /&gt;
 killall irexec&lt;br /&gt;
 irw     (now spam some buttons! Ctrl + C to exit)&lt;br /&gt;
&lt;br /&gt;
Want to launch programs with your remote? Edit or create &amp;#039;&amp;#039;&amp;#039;~/.lircrc&amp;#039;&amp;#039;&amp;#039; ~/ means the users home directory&lt;br /&gt;
 touch ~/.lircrc&lt;br /&gt;
 vi ~/.lircrc&lt;br /&gt;
&lt;br /&gt;
Add these lines to &amp;#039;&amp;#039;&amp;#039;~/.lircrc&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Note: Replace KEY_POWER with your key from your lircd.conf&lt;br /&gt;
Note: Use an &amp;amp; at the end of the config = line. It will run the command without making you wait for it to complete&lt;br /&gt;
 begin&lt;br /&gt;
      prog = irexec&lt;br /&gt;
      button = KEY_POWER&lt;br /&gt;
      config = /home/pi/gpio/11blink.sh &amp;amp;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Test... Again but this time to exec the program&lt;br /&gt;
 killall irexec&lt;br /&gt;
 service lirc restart&lt;br /&gt;
 irexec -d    (now test your button)&lt;/div&gt;</summary>
		<author><name>Ddxfish</name></author>
	</entry>
</feed>