I have a new TX3-Pro (S905X- Android 6) box. I run it with kszaq 7.0.2.009 version (thanks to kszaq, great job!). The only problem I had was that the remote control didn’t work at all. Also copying remote.conf from the Android /etc folder to libreelec /storage/.config didn’t help. I thought a while, that may be the device tree (dtb) was wrong for my box but this wasn’t. It was the remote.conf. It seems to me, that Android 6 uses a remote configuration different from the /system/etc/remote.conf.
After ‘googleing’ a while, I found a description from a openelec user. He build a romete.conf from scratch for a WeeTeck-Box. I tried and it works. I was able to generate a working remote.conf for my box and now may remote works perfectly. Another benefit is, I was able to do my preferred key mapping.
I’ve seen a lot of posts regarding a not working remote-control. Hopefully my post will help a little bit.
1) Peparation
Copy a remote.conf file to libreelec Configuration folder over SSH :
/storage/.config
or using Windows shares:
\\your_box_IP\Configuration
You can either use my file from the post or the file from your Android. If you use your file, take care that:
- all lines between key_begin and key_end are deleted or marked as comment (leading #)
- debug_enable = 1
2) Set Factory Code
Open the /storage/.config/remote.conf in any editor. You can also use the windows share \\your_box_IP\Configuration.
Open a SSH session to your box (I use putty for this. User root, password libreelec).
Type ‘dmesg –c’ in the ssh terminal. Ignore the message, it’s only for clearing the cache.
Press any key in your remote control and directly dmesg -c in the ssh terminal. You will get something like this:
Go to the editor with the remote.conf. You will find a line like this:
Change the factory_code with this 0xZZZZ0001 (ZZZZ is the digits you have got as 'wrong custom code is' from the ssh above).
For example if you get in the dmesg wrong custom code is 0x14fg76ad then your factory_code should be 0x76ad0001.
Save the remote.conf and type 'remotecfg remote.conf' in the shell (or reboot your box). Factory code is set.
3) Key Map
Open the remote.conf in editor and the ssh in 2nd window again. Type Type ‘dmesg –c’ in the ssh terminal and ignore the message.
Press any key in your remote control and directly dmesg -c in the ssh terminal. You will now get something like this:
If you get this, the Factory code was set correctly.
Now you can start the do the keymapping. In my remote.conf file, you’ll find the lines between key_begin and key_end likes this:
# 0xca 116 ;POWER
# 0x07 105 ;KEY_LEFT
Start with the fist line. Press the POWER button on your remote. Type dmesg -c in the ssh terminal. You will now get something like this:
Change the 1st line in the remote.conf to
0x43 116 ;POWER
This means:
- removing the leading # (line is active)
- change 0xca to 0x43 (change old/wong remote code with the correct code.)
- keep 116 (this is the linux code for POWER button).You need to do this for all lines in the file. Don’t forget to save from time to time.
Do this for all lines in the file.
If you have no corresponding button on the remote, keep the line unchanged or delete it.
If you have keys on the remote with no corresponding line in the file, you can create a new line. For this, you need to now the right linux code. In the link below, you’ll find all avalible codes. Not all of them work in Kodi, so you need to play a bit with the codes.
linux/input-event-codes.h at master · torvalds/linux · GitHub
If you set the code for all buttons on your remote, save the remote.conf and and type 'remotecfg remote.conf' in the shell (or reboot your box). Key Maping is done.
4) Mouse
If you like to use the mouse function on your remote, you have to define one key on your remote as mouse key. To get the mouse working, you also need to set the values in the upper section of the remote.conf. This are the lines you need to change. The '0x25' is the value you need to change with the value you got bavk from the ‘dmesg –c’. You also need to remove the leading '#'.
5) repeat key section
This is for keys on your remote where you like to have a repeat function if you press the key and keep it pressed. The only thing you need to do is to copy the relevant lines from the key section into the repeat_key section. I did it with the for lines for 'left', 'right', 'up', 'down'.