s.k. wrote
@ all
Does anyone manage to install a remote control successfully?
This was made possible thanks to @ Janui
For who may concern to setup an IR remote on v0.5b
First of all you should do a git pull before setting up the remote.
The build version should be janui-20180903
- 5 or higher.
In that version the following configuration files:
/usr/lib/systemd/system/irexec.service
/etc/lirc/lirc_options.conf
/etc/conf.d/lircd.conf
are already
preconfigured.
Step by step instractions :
1) Edit
/boot/config.txt
file.
Find these three lines in the file, and uncomment them, in order to enable lirc:
dtoverlay=lirc-rpi
dtparam=gpio_out_pin=7
dtparam=gpio_in_pin=22
Note :
Modify the gpio numbers according to your IR sensor wiring.
In this example is used the gpio_in_pin=22 & the gpio_out_pin=7 .
2) Reboot your Pi to activate it.
3) Create the file
/etc/lirc/lircd.conf.d/lircd.conf
This file configures the keys of your specific remote.
For pre-configured files of many remotes see here:
https://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/
To create your own configuration file
(/etc/lirc/lircd.conf.d/lircd.conf) there are instructions elsewhere on the forum/net.
This specific example refers to Apple remote (A1294):
begin remote
name apple
bits 8
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9140 4390
one 608 1618
zero 608 518
ptrail 610
repeat 9141 2157
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0x79
gap 107219
toggle_bit_mask 0x0
begin codes
KEY_UP 0x50 # Was: UP
KEY_DOWN 0x30 # Was: DOWN
KEY_LEFT 0x90 # Was: LEFT
KEY_RIGHT 0x60 # Was: RIGHT
KEY_PLAY 0xFA # Was: PLAY
KEY_MENU 0xC0 # Was: MENU
KEY_OK 0x3A # Was: OK
end codes
end remote
4) Test your LIRC setup
Type in the following command to start LIRC:
systemctl start lircd
And then type in this command:
irw
Now press buttons on your remote, you should see these presses in the console, - if everything is right.
5) Enable LIRC on startup
Type in the following command:
systemctl enable lircd
6) Now you have to match the above remote keys with MPD actions.
Create the lircrc file:
/etc/conf.d/lircrc
This specific example refers to the mapping of Apple remote (A1294):
begin
prog = irexec
remote = apple
repeat = 0
button = KEY_PLAYPAUSE
config = mpc toggle
end
begin
prog = irexec
remote = apple
button = KEY_RIGHT
repeat = 0
config = mpc next
end
begin
prog = irexec
remote = apple
button = KEY_LEFT
repeat = 0
config = mpc prev
end
begin
prog = irexec
remote = apple
button = KEY_UP
delay = 2
repeat = 10
config = mpc volume +2
end
begin
prog = irexec
remote = apple
button = KEY_DOWN
delay = 2
repeat = 10
config = mpc volume -2
end
begin
prog = irexec
remote = apple
button = KEY_MENU
button = KEY_DOWN
button = KEY_OK
repeat = 0
config = systemctl poweroff
end
Tip: remote name in the "lircd.conf" must matching with the remote name in "lircrc"
7) Enable IREXEC on startup
systemctl enable irexec.service
8) Reboot
The end !
Stavros