Now that the Moode 6.5.0 is released and I had to reinstall lirc, I thought I'd share an up-to-date guide.
At the time of writing the current lirc version is 0.10.1
1. Install lirc:
Code:
sudo apt-get update
sudo apt-get install -y lirc
You'll get some errors, it's fine
2. Remove .dist suffix from lirc files:
Code:
cd /etc/lirc
sudo mv lirc_options.conf.dist lirc_options.conf
sudo mv lircd.conf.dist lircd.conf
sudo mv irexec.lircrc.dist irexec.lircrc
You might as well disable the default remote configuration file:
Code:
sudo mv ./lircd.conf.d/devinput.lircd.conf ./lircd.conf.d/devinput.lircd.conf.dist
3. Complete the lirc installation:
Code:
sudo apt-get install -y lirc
4. Set up the hardware
Open lirc_options.conf:
Code:
sudo nano lirc_options.conf
And replace
Code:
driver = devinput
device = auto
with
Code:
driver = default
device = /dev/lirc0
Then open /boot/config.txt:
Code:
sudo nano /boot/config.txt
And add this line at the end (replace 25 with whichever gpio pin you use):
Code:
dtoverlay=gpio-ir,gpio_pin=25
5. Set up the irexec service to start on boot:
Code:
sudo systemctl enable irexec
6. Reboot
Usage
Add your "*.conf" remote configuration files to /etc/lirc/lircd.conf.d/, then restart lirc and irexec services:
Code:
sudo systemctl restart lircd
sudo systemctl restart irexec
Use /etc/lirc/irexec.lircrc to set actions for your remote keys, refer to
The lircrc file format.
Restart the service after you made changes:
Code:
sudo systemctl restart irexec
You can get configuration files from the
remotes database, or you create them manually using the irrecord utility:
1a. Apply the fix mentioned in the
post above (I haven't tested it personally) and skip step 1b.
1b. Alternatively, you can find a remote that uses the same protocol as yours in the
remotes database. Your best bet is a remote from the same manufacturer and from the same era that looks similarly.
Download the config file, put it in /home/pi and delete the part between "begin codes" and "end codes".
2. Stop the lircd service:
Code:
sudo systemctl stop lircd
3. Run irrecord and follow the instructions, the generated file will be saved to /home/pi/*.lircd.conf.
If you went with step 1b instead of 1a, replace "ircd.conf" with the config file you downloaded:
Code:
irrecord -n -d /dev/lirc0 ~/lircd.conf