With it held legs down and the dome facing you...the left-hand pin is input and connects to Pi Gpio=27 (physical pin=13) centre pin is Ground (physical pin=14) and right-hand pin is +3.3v (physical pin=1)

Of course a remote is needed and you've probably got a few about....if your chosen one is not in the Lirc database it can be a real headache making a config file so check here first for a working config... then it's just copy and paste in the appropriate file...http://lirc-remotes.sourceforge.net/remotes-table.html

Edit /boot/config.txt and add these lines ...(where 'xx' is the gpio pin you use for input... eg gpio_in_pin=27)

Code:

# Enable the lirc-rpi module
dtoverlay=lirc-rpi,gpio_in_pin=xx

Edit /etc/lirc/lirc_options.conf and make sure that driver and devices lines are changed to:

Code:

driver = default
device = /dev/lirc1

Usually Lirc uses /dev/lirc0 though for some as yet mysterious reason it is not working in Snakeoil and after some trial and error I found that /dev/lirc1 is what does work.
If your install won't work with /dev/lirc1 then try /dev/lirc0.

Reboot...

If all went well you should now have a lirc device. Verify this by issuing the following command:

Code:

ls /dev/lirc1

or ls /dev/lirc0 if that is what you used earlier.
This command should return a file named lirc0 or lirc1. If this command doesn’t output go back and verify the configuration once again as the drivers have not been loaded.

Test the IR remote and Receiver to verify that the IR receiver is working as expected:

Code:

sudo systemctl stop lircd

mode2 -d /dev/lirc1

Point the remote control at the IR receiver and press its buttons. If the IR receiver is configured successfully you will see output similar to this:

You can now check for the presence of the services and modules with commands...

Code:

dmesg | grep lirc
ls -l /dev/lirc0
ps aux | grep lirc

At this point you can test the configuration created by running :

Code:

irw

Point the remote control to the IR sensor and press some of the buttons, you should get an output similar to this (if using an xbox dvd remote
0000000000559aa6 03 KEY_UP Microsoft_Xbox
000000000051cae3 00 KEY_FORWARD Microsoft_Xbox
000000000053cac3 00 KEY_INFO Microsoft_Xbox

This means that the remote is correctly mapped and all should be working fine.
All that is left to do is setup irexec as a service and create a file with the commands irexec should run upon button presses.
Set irexec up as a user service for better security rather than having it run as root.

Code:

sudo systemctl edit irexec

and add....

Code:

[Service]
User=pi
Group=pi

then set up the remote's key mapping...

Code:

sudo nano /etc/lirc/irexec.lircrc

and add for your remote....the format is quite simple as this example for the xbox dvd remote shows.
Key presses will then cause mpc to run the commands to control mpd.
I have mapped several Webstreams to the number buttons and included a shutdown and reboot....

Our mission is to create a free to use computer OS that is easy to install, intuitive to operate and play music that will connect and engage with you emotionally.

SnakeoilOS gives you the freedom to spend more time on listening, enjoying and exploring music. Wasting time on computers is now a thing of the past! Everything is constantly evolving/improving. Please check back often for updates.

If you like this project, do show your support with a small token donation. All donations collected will be used to run this website, and for purchasing new equipment for the project.