# How I installed lirc with IR receiver and remote to Volumio

**URL:** <https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382>\
**Category:** Diy Volumio Projects\
**Created:** [January 10, 2014, 5:05pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382 "2014-01-10T17:05:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [January 10, 2014, 5:05pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/1 "2014-01-10T17:05:53Z")

</div>

![RPi_Tsop4838.jpg](https://community.volumio.com/uploads/default/original/2X/e/e854a7af815c95a53ae6c831ceeccaee0bd11731.jpeg)Hi, this is the story how I installed lirc and IR receiver to Volumio on Raspberry PI  
IR Receiver from [http://www.ebay.com/itm/260944290485?ru=http%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html%3F\_sacat%3D0%26\_from%3DR40%26\_nkw%3D260944290485%26\_rdc%3D1](http://www.ebay.com/itm/260944290485?ru=http%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html%3F_sacat%3D0%26_from%3DR40%26_nkw%3D260944290485%26_rdc%3D1)  
First connect the TSOP4838 IR Receiver to Raspberry Pi like in the picture

Log in with ssh as:  
user: pi  
password: raspberry

sudo apt-get update  
sudo apt-get install lirc  
Now we need to configure lirc hardware:  
sudo nano /etc/lirc/hardware.conf  
…  
LIRCD\_ARGS="–uinput"  
…  
DRIVER=“default”  
…  
DEVICE="/dev/lirc0"  
…  
MODULES=“lirc\_rpi”  
Now save all this ctrl+x and Y.  
Now we need to learn lirc with IR commands:  
sudo /etc/init.d/lirc stop  
irrecord -n -d /dev/lirc0 ~/lircd.conf  
#follow the instructions on the screen  
#just learn a few button. Do the rest once everything is working.  
#now copy this newly created conf file  
sudo mv ~/lircd.conf /etc/lirc/lircd.conf  
#start lirc  
sudo /etc/init.d./lirc start  
#now run irw to check everything  
irw  
#now press the button on the remote you just learned. The commands should appear on the screen  
We need to create a file in /home/pi folder with the name .lircrc and put this in:  
begin  
prog = irexec  
button = pause  
config = mpc toggle  
end  
begin  
prog = irexec  
button = nextsong  
config = mpc next;mpc play  
end  
begin  
prog = irexec  
button = prevsong  
config = mpc prev;mpc play  
end  
begin  
prog = irexec  
button = stop  
config = mpc stop  
end  
Again ctrl+x and Y to save this.  
Next we need to run irexec as a background process:  
irexec -d

Now we have to add irexec to rc.local to startup after every reboot:  
sudo nano /etc/rc.local  
and add this before exit 0:  
(sleep 3;  
sudo -u pi irexec -d  
)&  
and again save with ctrl+x and Y.  
and reboot with sudo reboot. When the Pi is up again check dmesg for errors about lirc and lirc modules loaded lsmod  
References : [http://mightyohm.com/forum/viewtopic.php?f=2&t=3420#p5621](http://mightyohm.com/forum/viewtopic.php?f=2&t=3420#p5621)  
 ![rpi_lirc.jpg](https://community.volumio.com/uploads/default/original/2X/0/0cb0bdd07f9223dd7ae45f03269c1ad1a83ad626.jpeg)

---

<div class="post-metadata">

**Author:** ![shano](https://community.volumio.com/user_avatar/community.volumio.com/shano/32/8_2.png) [@shano](https://community.volumio.com/u/shano)\
**Post date:** [January 10, 2014, 8:01pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/2 "2014-01-10T20:01:19Z")

</div>

Excellent thank you.  
Going to order IR receiver now and I look forward to getting it working. So it looks like I won’t need to solder as the legs of the device slot onto the GPIO pins?

---

<div class="post-metadata">

**Author:** ![iorr](https://community.volumio.com/letter_avatar_proxy/v4/letter/i/0ea827/32.png) [@iorr](https://community.volumio.com/u/iorr)\
**Post date:** [January 12, 2014, 10:38am UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/3 "2014-01-12T10:38:17Z")

</div>

Which remote do you use?  
Karsten

Gesendet von meinem Nexus 7 mit Tapatalk 2

---

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [January 12, 2014, 8:12pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/4 "2014-01-12T20:12:31Z")

</div>

I use an Apple A1156 remote with that, but you can you can use any free remotes you have in the house or any remotes that have spare buttons and don’t do anything with the device they came.

Sent from my Nexus 4 using Tapatalk

---

<div class="post-metadata">

**Author:** ![iorr](https://community.volumio.com/letter_avatar_proxy/v4/letter/i/0ea827/32.png) [@iorr](https://community.volumio.com/u/iorr)\
**Post date:** [January 13, 2014, 4:14pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/5 "2014-01-13T16:14:54Z")

</div>

Hi,  
Will try it with my logi remote.

Thanks,  
Karsten

---

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [January 20, 2014, 7:05pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/6 "2014-01-20T19:05:28Z")

</div>

Update:  
Raspberry Pi rev2 with PCM5102A connected to i2s with ir receiver in aluminium enclosure.  
[http://www.flickr.com/photos/goghi/sets/72157639971214466/](http://www.flickr.com/photos/goghi/sets/72157639971214466/)

---

<div class="post-metadata">

**Author:** ![lcg](https://community.volumio.com/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lcg](https://community.volumio.com/u/lcg)\
**Post date:** [February 18, 2014, 9:01pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/7 "2014-02-18T21:01:47Z")

</div>

Dear Gheorghe,

looks very nice and clean. May I ask whether you can share the list of electronic elements and a plan of how to connect them in detail with each other and the RPi? Being not an electrical engineer this would ease the work a lot. Soldering and manual work, etc. is not the problem. Especially the power supply is not known to me.

If you posted it elsewhere or if you had some models, please send the links.

thanks and best regards,  
leo

---

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [February 19, 2014, 5:55pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/8 "2014-02-19T17:55:29Z")

</div>

> [@lcg](#):
>
> Dear Gheorghe,
> 
> looks very nice and clean. May I ask whether you can share the list of electronic elements and a plan of how to connect them in detail with each other and the RPi? Being not an electrical engineer this would ease the work a lot. Soldering and manual work, etc. is not the problem. Especially the power supply is not known to me.
> 
> If you posted it elsewhere or if you had some models, please send the links.
> 
> thanks and best regards,  
> leo

Hi, for my project I used PCM5102A DAC and 4.17uV TPS7A4700 Ultralow noise DAC power supply regulator from [diyinhk.com](http://www.diyinhk.com). and an lm317 as a pre-regulator because I have and linear power supply which gives me 9v at 1amp and i had to use the lm317 board from ebay: 260479385900 to drop down to 6v for TPS7A4700 ultra low noise. For TPS7A4700 its enough 5.5v to output 5.0v at 1amp and if you input more than 6V it will get very hot. But I used Raspberry pi without TPS7A4700, only with lm317 board and it sounds very good. if you need an TPS7A4700, get it from ebay: 390748927641.  
For aluminium enclosure I have the ebay item: 190903719738, which I had to drill the holles.  
You can use the hifiberry dac if you don’t have any dac’s yet.  
To raspberry pi I connected the power cables to TP1 and TP2(see picture)

 ![sony-rasp-pi.jpg](https://community.volumio.com/uploads/default/original/2X/c/cdbe3e43de116d8d838e959fb4c07cfc204029c8.jpeg)

---

<div class="post-metadata">

**Author:** ![Diet\_Shasta](https://community.volumio.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@Diet\_Shasta](https://community.volumio.com/u/Diet_Shasta)\
**Post date:** [February 19, 2014, 6:18pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/9 "2014-02-19T18:18:17Z")

</div>

I have a pifacecad that has an IR receiver built in. I used similar steps as yours, except I didn’t need to add a line to rc.local to start up irexec during boot separately. I think the /etc/init.d/lirc script checks if a lircd.conf or lircrc file exists (don’t remember which) and adds irexec to the start up automatically.

---

<div class="post-metadata">

**Author:** ![lcg](https://community.volumio.com/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lcg](https://community.volumio.com/u/lcg)\
**Post date:** [February 20, 2014, 11:34am UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/10 "2014-02-20T11:34:28Z")

</div>

Dear Gheorghe,

thanks for the information. The idea with such a power supply sounds good and I will do some recherche on it. And - yes - I do not have a DAC yet (still planning stage). The hifi-berry is good compared to what you use?  
Btw - you get a lot of cases like the one you bought at [http://www.audiophonics.fr](http://www.audiophonics.fr) (along with a lot of other audio material) or at [http://www.modushop.biz](http://www.modushop.biz). It seems your case is identical to one of those you can find there.

best regards,  
leo

---

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [February 20, 2014, 12:08pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/11 "2014-02-20T12:08:26Z")

</div>

About hifiberry and PCM5102A from diyinhk, they use the same dac chip, but hifiberry is made for RPi, so will be easier to connect it to RPi

Sent from my Nexus 4 using Tapatalk

---

<div class="post-metadata">

**Author:** ![DerekR](https://community.volumio.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@DerekR](https://community.volumio.com/u/DerekR)\
**Post date:** [March 17, 2014, 3:00am UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/12 "2014-03-17T03:00:49Z")

</div>

Thanks, birca1987. Great to have a quick way to pause etc. I used an Apple A1294 and it works fine. Very useful addition to the Volumio/Pi arsenal.

---

<div class="post-metadata">

**Author:** ![chriz](https://community.volumio.com/letter_avatar_proxy/v4/letter/c/7feea3/32.png) [@chriz](https://community.volumio.com/u/chriz)\
**Post date:** [March 24, 2014, 8:57pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/13 "2014-03-24T20:57:51Z")

</div>

Thank you birca1987 for the useful infos!

My Pi (including hifiberry) is now controlled by a remote as well! A really comfortable addition.

To be able to get even more power from the remote control I wrote a shell script rcmpd  
that can be set up in .lircrc instead of the direct mpc calls in your example.

Additionally to some playlist handling I implemented speech output, inspired by the mightyohm forum talk you are referring to too.

There is a detailed description available here: [ziemski.net/raspberry-pi/rcmpd.html](http://ziemski.net/raspberry-pi/rcmpd.html)

---

<div class="post-metadata">

**Author:** ![starlored](https://community.volumio.com/letter_avatar_proxy/v4/letter/s/f1d935/32.png) [@starlored](https://community.volumio.com/u/starlored)\
**Post date:** [April 6, 2014, 8:33am UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/14 "2014-04-06T08:33:59Z")

</div>

Are you able to shut the raspberry pi down safely by using the remote.  
The reason I ask is because I have 3 raspberry pi’s setup one of which is to be used to serve music to my bathroom, I’m not to keen on using my phone with all that water around.

---

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [April 7, 2014, 5:15am UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/15 "2014-04-07T05:15:58Z")

</div>

Yes you can execute every command from the remote

Sent from my Nexus 4 using Tapatalk

---

<div class="post-metadata">

**Author:** ![nomad13](https://community.volumio.com/letter_avatar_proxy/v4/letter/n/ecc23a/32.png) [@nomad13](https://community.volumio.com/u/nomad13)\
**Post date:** [April 9, 2014, 8:56pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/16 "2014-04-09T20:56:09Z")

</div>

mine doesn’t seem to work.

after typing this command:

> [@](#):
>
> irrecord -n -d /dev/lirc0 ~/lircd.conf

here is what I get:

> [@](#):
>
> irrecord - application for recording IR-codes for usage with lirc
> 
> Copyright (C) 1998,1999 Christoph Bartelmus([lirc@bartelmus.de](mailto:lirc@bartelmus.de))
> 
> irrecord: could not get file information for /dev/lirc0  
> irrecord: default\_init(): No such file or directory  
> irrecord: could not init hardware (lircd running ? → close it, check permissions)

---

<div class="post-metadata">

**Author:** ![arginine](https://community.volumio.com/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@arginine](https://community.volumio.com/u/arginine)\
**Post date:** [April 13, 2014, 9:36pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/17 "2014-04-13T21:36:18Z")

</div>

Hello,

same problem …  
does anybody solved this ?  
F

Edit : while checking this [http://forum.stmlabs.com/showthread.php?tid=5549](http://forum.stmlabs.com/showthread.php?tid=5549) … this command : sudo modprobe lirc\_rpi  
is needed to make the irrecord command working.

btw, did not manage yet, to control mpc with the IR remote

edit2 : ok, got it to work (in the .lircc file, it’s important to match the button names with the one your record using irrecord (saved in lirc.conf))  
… now only suffering to have “/usr/bin/irexec --daemon /ir\_remote/.lircrc” executed at reboot (knowing that autostart with init.d does not work, have to add a crontab entry but @reboot sudo /usr/bin/irexec --daemon /ir\_remote/.lircrc does not seems to make it) …

---

<div class="post-metadata">

**Author:** ![jpdunord](https://community.volumio.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jpdunord](https://community.volumio.com/u/jpdunord)\
**Post date:** [May 14, 2014, 12:36pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/18 "2014-05-14T12:36:36Z")

</div>

Hello

I want to add an IR remote to my raspberry but i have also a lcd displays connect to my raspberry and ths displays also use the pins18? How can i do?

this is the lists oh the pins that the dislpay use:  
LCD ========== GPIO

VSS —————- GND (pin 6)

VDD —————- +5V (pin 2)

A (Anode) ——— GPIO18 (pin 12) [previously GPIO14]

D7 —————— GPIO14 (pin 8) [previously GPIO18]

D6 —————— GPIO23 (pin 16)

D5 —————— GPIO24 (pin 18)

D4 —————— GPIO25 (pin 22)

E ——————– GPIO08 (pin 24)

RS —————— GPIO07 (pin 26)

thanks a lot

---

<div class="post-metadata">

**Author:** ![birca1987](https://community.volumio.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@birca1987](https://community.volumio.com/u/birca1987)\
**Post date:** [May 14, 2014, 1:57pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/19 "2014-05-14T13:57:55Z")

</div>

> [@jpdunord](#):
>
> Hello
> 
> I want to add an IR remote to my raspberry but i have also a lcd displays connect to my raspberry and ths displays also use the pins18? How can i do?
> 
> this is the lists oh the pins that the dislpay use:  
> LCD ========== GPIO
> 
> VSS —————- GND (pin 6)
> 
> VDD —————- +5V (pin 2)
> 
> A (Anode) ——— GPIO18 (pin 12) [previously GPIO14]
> 
> D7 —————— GPIO14 (pin 8) [previously GPIO18]
> 
> D6 —————— GPIO23 (pin 16)
> 
> D5 —————— GPIO24 (pin 18)
> 
> D4 —————— GPIO25 (pin 22)
> 
> E ——————– GPIO08 (pin 24)
> 
> RS —————— GPIO07 (pin 26)
> 
> thanks a lot

Hi, you can find all info here [mightyohm.com/forum/viewtopic.ph … 3420#p5621](http://mightyohm.com/forum/viewtopic.php?f=2&t=3420#p5621)

Sent from my Nexus 4 using Tapatalk

---

<div class="post-metadata">

**Author:** ![chriz](https://community.volumio.com/letter_avatar_proxy/v4/letter/c/7feea3/32.png) [@chriz](https://community.volumio.com/u/chriz)\
**Post date:** [May 20, 2014, 8:06pm UTC](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382/20 "2014-05-20T20:06:50Z")

</div>

> [@arginine](#):
>
> edit2 : … now only suffering to have “/usr/bin/irexec --daemon /ir\_remote/.lircrc” executed at reboot  
> (knowing that autostart with init.d does not work,  
> have to add a crontab entry but @reboot sudo /usr/bin/irexec --daemon /ir\_remote/.lircrc does not seems to make it) …

I did it via an entry in /etc/rc.local like this:

```auto
su - pi -c "/usr/bin/irexec --daemon /home/pi/.lircrc"
```

You only have to handle Volumio’s resetting of /etc/rc.local on every reboot, for example as described here:  
[http://volumio.org/forum/volumio-mausberry-switch-t229.html#p2447](http://volumio.org/forum/volumio-mausberry-switch-t229.html#p2447)

[Next page](https://community.volumio.com/t/how-i-installed-lirc-with-ir-receiver-and-remote-to-volumio/382.md?page=2)
