-
Notifications
You must be signed in to change notification settings - Fork 30
10. CoreELEC: Create remote.conf
This step by step tutorial shows how to create a remote.conf for a Tanix Factory Remote using a Windows PC, SSH (Putty), and a Home Area Network (HAN).
The instructions can easily be adapted for other Operating Systems.
- PC with MS Windows
- Putty
- Android TV Set Top Box
- Home Area Network
- CoreELEC booting from (μ)SD Card or USB Flash Drive
IMPORTANT |
---|
Ensure the MS Windows PC and Android Set-top Box are both hard wired to, and receiving their network settings automatically from, the home router or modem. |
In CoreELEC:
Use the CoreELEC configuration addon to access the SSH settings.
- Enable SSH
Find the IP of the device in Settings/System information/Summary:
If a security waring shows:
In the terminal run:
systemctl stop kodi
systemctl stop eventlircd
ir-keytable -u
##############################################
# CoreELEC #
# https://coreelec.org #
##############################################
CoreELEC (official): 19.2-Matrix_rc2 (Amlogic-ng.arm)
CoreELEC:~ # systemctl stop kodi
CoreELEC:~ # systemctl stop eventlircd
CoreELEC:~ # ir-keytable -u
Protocols changed to irmp
Waiting for IRMP decode event. Please, press CTRL-C to abort.
Now press the remote power button
Received IRMP code: remotewakeup='0xb24d4040', decode_type='0x0', remotewakeupmask='0xffffffff'
Received IRMP code: remotewakeup='0xb24d4040', decode_type='0x0', remotewakeupmask='0xffffffff'
Received IRMP code: remotewakeup='0xb24d4040
', decode_type='0x0', remotewakeupmask='0xffffffff'
The code is structured as follows:
0x | AA | BB | CCCC |
---|---|---|---|
0x | b2 | 4d | 4040 |
On soc Amlogic only sections 0x, BB and CCCC are needed for remote.conf.
AA is not used.
0xBB becomes the key_code.
CCCC is the factory_code.
# factory_code each device has it's unique factory code.
# pattern: custom_code(16bit)+index_code(16bit)
# example: 0xff000001 = 0xff00(custom cod) _ 0001 (index)
Now that the factory code has been found, it is time to link the key_code
for each key to the corresponding event_code
, which can be found in input-event-codes.sh.
#define KEY_POWER 116 /* SC System Power Down */
IRMP_code | factory_code | key_code | event_code | key_function |
---|---|---|---|---|
0xb24d4040
|
0x40400001 | |||
0x b24d 4040 |
0x4d | 116 | KEY_POWER |
Proceed for each key on the remote.
IRPM_code | key_code | event_code | key_function |
---|---|---|---|
0xb24d 4040 |
0x4d | 116 | KEY_POWER |
0xbc43 4040 |
0x43 | 113 | KEY_MUTE |
0xe817 4040 |
0x17 | 114 | KEY_VOLUMEDOWN |
0xe718 4040 |
0x18 | 115 | KEY_VOLUMEUP |
0xf40b 4040 |
0x0b | 103 | KEY_UP |
0xf10e 4040 |
0x0e | 108 | KEY_DOWN |
0xef10 4040 |
0x10 | 105 | KEY_LEFT |
0xee11 4040 |
0x11 | 105 | KEY_RIGHT |
0xf20d 4040 |
0x0d | 97 | KEY_ENTER |
0xe51a 4040 |
0x1a | 102 | KEY_HOME |
0xba45 4040 |
0x45 | 125 | KEY_MENU |
0xbd42 4040 |
0x42 | 1 | KEY_BACK |
0xfe01 4040 |
0x01 | 2 | KEY_1 |
0xfd02 4040 |
0x02 | 3 | KEY_2 |
0xfc03 4040 |
0x03 | 4 | KEY_3 |
0xfb04 4040 |
0x04 | 5 | KEY_4 |
0xfa05 4040 |
0x05 | 6 | KEY_5 |
0xf906 4040 |
0x06 | 7 | KEY_6 |
0xf807 4040 |
0x07 | 8 | KEY_7 |
0xf708 4040 |
0x08 | 9 | KEY_8 |
0xf609 4040 |
0x09 | 10 | KEY_9 |
0xff00 4040 |
0x00 | 11 | KEY_0 |
0xb847 4040 |
0x47 | fn_key_scancode | BTN_MOUSE |
0xf30c 4040 |
0x0c | 24 | KEY_O ( <x] Kodi Player Process Info) |
-
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
Write the remote.conf file in a Windows text editor with RAW support such as vim for Windows.
Bellow is the resulting remote.conf file.
#
# *********************************************************************************************************
# this file is configuration for each factory remote device
#
# work_mode 0 :software mode 1 :hardware mode
# repeat_enable 0 :disable repeat 1 :enable repeat
#
# factory_code each device has it's unique factory code.
# pattern:custom_code(16bit)+index_code(16bit)
# examble: 0xff000001 = 0xff00(custom cod) 0001 (index)
#
# release_delay unit:ms.release will report from kernel to user layer after this period of time
# from press or repeat triggered.
#
# debug_enable 0 :debug disable 1 :debug disable
#
# SW MODE:
#
# bit_count how many bits in each frame
# tw_leader_act time window for leader active
# tw_bit0 time window for bit0 time.
# tw_bit1 time window for bit1 time
# tw_repeat_leader time window for repeat leader
#
# REG
#
# reg_base_gen set value for PREG_IR_DEC_BASE_GEN
# reg_control set value for PREG_IR_DEC_CONTROL
# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE
# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE
# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME
#
# *********************************************************************************************************
#
# amlogic NEC remote * Tanix Factory Remote for all TX devices
#
factory_code = 0x40400001
work_mode = 0
repeat_enable = 1
repeat_delay = 130
repeat_peroid = 120
release_delay = 20
debug_enable = 1
fn_key_scancode = 0x47 # MOUSE
left_key_scancode = 0x10 # KEY_LEFT
right_key_scancode = 0x11 # KEY_RIGHT
up_key_scancode = 0x0b # KEY_UP
down_key_scancode = 0x0e # KEY_DOWN
ok_key_scancode = 0x0d # KEY_ENTER
mouse_begin
0 0x10 # KEY_LEFT
1 0x11 # KEY_RIGHT
2 0x0b # KEY_UP
3 0x0e # KEY_DOWN
mouse_end
key_begin
0x4d 116 # KEY_POWER
0x43 113 # KEY_MUTE
0x17 114 # KEY_VOLUMEDOWN
0x18 115 # KEY-VOLUMEUP
0x0b 103 # KEY_UP
0x0e 108 # KEY_DOWN
0x10 105 # KEY_LEFT
0x11 106 # KEY_RIGHT
0x0d 97 # KEY_ENTER
0x1a 102 # KEY_HOME
0x45 125 # KEY_MENU
0x42 1 # KEY_BACK
0x01 2 # KEY_1
0x02 3 # KEY_2
0x03 4 # KEY_3
0x04 5 # KEY_4
0x05 6 # KEY_5
0x06 7 # KEY_6
0x07 8 # KEY_7
0x08 9 # KEY_8
0x09 10 # KEY_9
0x00 11 # KEY_0
# 0x00 xx # BTN_MOUSE IS MAPPED IN fn_key_scancode
0x0c 24 # KEY_O <X] (PLAYER PROCESS INFO)
key_end
repeat_key_begin
0x17 114 # KEY_VOLUMEDOWN
0x18 115 # KEY-VOLUMEUP
0x0b 103 # KEY_UP
0x0e 108 # KEY_DOWN
0x10 105 # KEY_LEFT
0x11 106 # KEY_RIGHT
repeat_key_end
Repository for AmRemote & Meson IR Remote Controllers