[Tutorial FEB 2021] Add any IR remote to android 9 based atvXperience

Post your great articles here :)
Post Reply
xijunw
Posts: 4
Joined: Sat Jan 23, 2021 6:33 pm
Been thanked: 1 time

[Tutorial FEB 2021] Add any IR remote to android 9 based atvXperience

#1

Post by xijunw » Tue Feb 09, 2021 9:00 am

Table of Contents
|. Facts
II. Steps by Steps
III. Trouble shooting

I. Facts

- Any IR remote (NEC protocol) can be used on android 9 based atvXperience; (Most remotes sold on amazon or aliexpress are NEC IR remote.)
- atvXperience support multiple remotes simultaneously;


In this tutorial, I will demonstrate how to add any IR remote to TV boxes with atvXperience and make it work easily by yourself.
Googling a configuration file is not recommended since the file could be using Key_codesdefined totally different even the scan_codes are correct.

First of all, I will make it short for experienced users, then I will explain step by step for fresh players.

3 Steps to make a remote work on TV box with atvXperience (android 9 based.)
A. Find, edit or make the right configuration file for the remote in the proper format;(see further details below)
B. Put it under /vendor/etc , name it as remote.tab5 following 4 remote.tabx files already there; (file name does not matter at all as long as it is properly configured into the core service)
C. Configure it with /vendor/bin/remotecfg with root by executing

Code: Select all

$ /vendor/bin/remotecfg -c /vendor/etc/remote.cfg -t /vendor/etc/remote.tab5
Then the remote should be working immediately without rebooting the box or any other action.

II. Steps by steps

1. The format of the remote configuration file

Code: Select all


## Amlogic NEC remote

custom_name   = remote-df00    # Any name is OK; Including device code is recommended for debug reason
custom_code   = 0xdf00  # df00 is the device code; prefix with "0x"
release_delay = 80 

fn_key_scancode    = 0x03 # MOUSE
cursor_left_scancode  = 0x47 # LEFT
cursor_right_scancode = 0x07 # RIGHT
Cursor_up_scancode    = 0x1a # UP
Cursor_down_scancode  = 0x48 # DOWN
Cursor_ok_scancode    = 0x06 # OK

mouse_begin

  0 0x47 # LEFT
  1 0x07 # RIGHT
  2 0x1a # UP
  3 0x48 # DOWN

mouse_end

key_begin

## BASIC TV CONTROL
  0x1c 116 # POWER
  0x5c 114 # VOLUME_DOWN (VOL-)
  0x5d 115 # VOLUME_UP (VOL+)
  0xf3 113 # MUTE (KBUTTON)

## DAPD and FUNCTION KEYS
  0x47 105 # LEFT
  0x07 106 # RIGHT
  0x1a 103 # UP
  0x48 108 # DOWN
  0x06 97  # ENTER (OK)

  0x0a 1   # RETURN or BACK
  0x42 102 # HOME
  0x18 139 # MENU
  
  0x4b 121 # REWIND  |<<
  0x4f 120 # FORWARD >>|
  0x01 119 # PLAY PAUSE
  0x5f 62  # HELP
  0x41 20  # WEB EXPLORER

## NUMBERS

  0x54 2   # 1
  0x16 3   # 2
  0x15 4   # 3
  0x50 5   # 4
  0x12 6   # 5
  0x11 7   # 6
  0x4c 8   # 7
  0x0e 9   # 8
  0x0d 10  # 9
  0x0c 11  # 0

repeat_key_begin

## ADD MORE IF YOU WANT
## USUALLY ONLY FOLLOWING KEYS NEED REPEAT
  0x47 105 # LEFT
  0x07 106 # RIGHT
  0x1a 103 # UP
  0x48 108 # DOWN
  0x5c 114 # VOLUMEDOWN (VOL-)
  0x5d 115 # VOLUMEUP (VOL+)

repeat_key_end

key_end

What you need to know:

A. custom_code the device code the unique ID of the remote which you have to find out (see below)
B. scan_code The first column in the key section and any other 0x?? code are called scan_code. The NEC protocol translate the physical IR signal into the code that is received by TV box and Linux core;
C. key_code The second column in the key section are called key_code, each key_code correspond to a action or event which is defined by the keylayout file (.kl) under /vendor/usr/keylayout
D. The above remote configuration file must accompanied with a remote.cfg file which is already included in atvXperience under /vendor/etc


2. How to find the device code and scan_code by yourself
This is the most reliable way to make a correct configuration file for a remote and it is strongly recommended to do by yourself.
(To be working on)

3. How to upload the configuration file into the TV box and put it under /vendor/etc
(To be working on)

4. How to run linux command to configure the remote without using developer's adb tool
(To be working on)

III. Trouble shooting

I will add discussion here. Feel free to ask questions related to remote here.

This topic has 1 reply

You must be a registered member and logged in to view the replies in this topic.


Register Login
 
Post Reply