-
Notifications
You must be signed in to change notification settings - Fork 30
02. Amlogic: Creating remote.conf from scratch
SoC Amlogic natively manages the NEC protocol for remote control units. Through the file remote.conf, the remote control code can be associated to a Linux system event. The codes for the Linux system events are available in the header files of the Linux kernel.
- Create a terminal session
eq: ssh root@<device.ip>
- Create remote.conf
touch remote.conf
- Stopping services
systemctl stop kodi
systemctl stop eventlircd
- Scanning for IR Codes
Press a button on the remote control, then run in SSH:
dmesg -c
or
ir-keytable -p NEC,RC-5,RC-6,JVC,SONY -t
dmesg argument -c clears the log so it must be used only once before pressing any button on remote. After that use only dmesg command without argument.
If the remote control is compatible there should be a message:
[ 9087.000717@0] meson-remote ff808040.meson-remote: invalid custom:0xae517f80
If there is no message, the remote is most likely incompatible.
- Enter data into remote.conf
run vi remote.conf
and enter the data under the corresponding headers.
- Location
Copy remote.conf to /etc
cp remote.conf /etc
- Restart the device
reboot now
The remote code received by the device is: 0xae517f80
The code is structured as follows:
0x | AA | BB | CCCC |
---|---|---|---|
0x | ae | 51 | 7f80 |
On soc Amlogic only sections 0x, BB and CCCC are needed for remote.conf.
0xBB is the code send by keypress.
CCCC is the factory code.
-
One file:
remote.conf
-
The factory code is inserted as
factory_code = 0xCCCC0001
-
Mouse events are entered between
mouse_begin
andmouse_end
-
Key events are entered between
key_begin
andkey_end
-
Repeat key events are entered between
repeat_key_begin
andrepeat_key_end
In this example, the power button on remote control is pressed, then the dmesg -c
command is executed in SSH.
Reply: [ 9087.000717@0] meson-remote ff808040.meson-remote: invalid custom:0xae517f80
The factory code is: 7f80
Change factory_code to: 0x7f80
0001
The remote control key code is: 0x51
The KEY_POWER event from input-event-codes.h is 116
In remote.conf this would be entered between key_begin
and key_end
as 0x51 116
IMPORTANT: ensure there is a space between the two data 0x51
116
Repeat till each key has been mapped.
Repository for AmRemote & Meson IR Remote Controllers