Lirc seems a lot easier to set up with Buster - if you are using it to control Mopidy it's a doddle to set up.
Set up is assuming you have set up Mopidy on a Raspberry Pi with Buster, you will also need to have installed mpc (sudo apt install mpc)
First of all you need to get your IR receiver, the kit here is what I've used.
To connect up to the GPIO pins there are lots of images here, I used pin 2 for 5v power, pin 6 for Ground and pin 12 (GPIO 18) for data/input. You can choose whichever pins suit, but remember which one you use for the data/input as you'll need to enter it in the conf later.
If using a similar receiver to the one in the link, the wiring is as follows, with the X on the receiver facing away from you;
Pin 1 is Ground, Pin 2 is Power and Pin 3 is Data/input.
If you have a lot of info etc on the sd card I would recommend backing up the card.
Once you have the hardware in place and if relevant you've backed up the sd card.
Start here, ssh or open a terminal window, then;
sudo nano /boot/config.txt
Scroll down to this line, remove the # and enter the gpio pin number.
dtoverlay=gpio-ir,gpio_pin=18
#dtoverlay=gpio-ir-tx,gpio_pin=17
ctrl x to save and close
sudo reboot
Once it's restarted
sudo apt install lirc
Installation might fail on Buster here because of the .dist suffix, if so the following will help, then run the install lirc again.
sudo apt install lirc
Once installed, open,
sudo nano /etc/lirc/lirc_options.conf
and change the following lines
device = /dev/lirc0
ctrl + x to save and exit.
Now to set up the remote config files with the scan codes;
sudo nano ~/lircd.conf
If you are using the Keyes or similar remote you can try the codes below - if not you can either use irrecord to record your own, search sourceforge for similar brand or search google.
-------------------------
# brand: KEYES
button = KEY_3
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_4
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_5
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_6
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_7
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_8
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_9
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
begin
prog = irexec
button = KEY_0
config = mpc stop; mpc clear; mpc load "Your playlist here";mpc play;
end
ctrl + x and y to save and exit
No comments:
Post a Comment