• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 12
Solved Connect Xiaomi Mi Box BT remotes to LibreELEC devices
#16
The one I bought from AliExpress was the genuine one, exactly the same as ashrafhumax (well ... may be a copy, one never can tell with chinese products). But it's Bluetooth, and hardened plastic (and the vendor ID in the BT communication is the Xiaomi one so...). About the same price as the one referenced by wrxtasy. I just had to press home&back for a few seconds to put the remote in discovery mode.

I'll get another one for my second home theater once I get my Raspberry Pi Zero.
Reply
#17
(2017-06-24, 19:47)Petzi Wrote: Aaaaaaand I got it working.

A huge thanks to you ashrafhumax ! Two strangers sharing info on the Internet, possibly at remote ends of the planets ... Love it Big Grin

Here's what I did (there will be additional tweakings to get things working the way I want, and I'll leave other to make it cleaner if they want to Big Grin ). First of all, as I couldn't get it to work on openelec, I tried with LibreElecl. And got it working there, so I'll stick with LibreElec for the moment. This should probably as is with OpenElec.

I created a file 51-these-are-not-joysticks.rules in /storage/.config/udev.rules.d/ as per the info found in your message. I added this line :
Code:
ATTRS{vendor}=="2717", ENV{ID_INPUT_JOYSTICK}=""

2717 is Xiaomi ID

Then, I created the file 99-eventlircd.rules in the same directory and added this :
Code:
KERNEL=="event0", ENV{eventlircd_enable}="true", ENV{eventlircd_evmap}="aftvsremote.evmap"

The obvious limitation is that my remote must be /dev/input/event0, but that's not much of a problem (and still something that could be fixed with udev, but now that the remote is working, I'll move from a linux tweakers to a couch potato). The other one is that I'm doing a broad change, for all Xiaomi's devices. Could be a bit finer, but I don't plan on having more than one remote or BT equipment on that Raspberry Pi !

Also, my remote (Mi Box bluetooth remote) uses most of the keys of the Amazon fire TV remote, so I haven't updated the evmap yet. Will do, one day, when I'll be over my movies. Using the tricks found in the thread I linked to in my first message.

I finally received my Bluetooth remote that you suggested (nice remote for the price). LibreELEC finds it and as you says, it thinks it is a game pad and is listed in Chinese. I can not figure out your instructions, could you give a more detailed explanation, or better yet, make a YouTube video on how to do it.
FYI, this remote works great on my generic Android boxes, running a modded version of the Android TV OS. Strangely, however, it will not connect to my Xiaomi Mi box.

Thanks.

FYI, I also received the $2 remote and as you said, it is IR, tested in on a couple of my Android boxes but did not work on them. Some of my Android boxes share the same remotes, even my HDMI switch shares one of my Android remotes, which is a real pain in the butt. I have to keep the HDMI switch covered with a towel when I use that particular Android box that is running my LibeELEC. This was the reason I purchased this Bluetooth remote.
Reply
#18
(2017-06-25, 18:46)wrxtasy Wrote: These BT remote's make great additions to the unofficial Android TV ROM's for the WeTek Hub & Play2.

I know you work on Odroid C2 builds of LibreELEC; have you been able to get this to work on the C2? I've had zero luck getting either of the two XiaoMi BT remotes I have working with stock LE. If it's working on one of your builds, I'd switch to that. Or if you know what's keeping this from working on C2 LE (when it works on Ubuntu and Android on the same box), it'd be greatly appreciated.
Reply
#19
I'm trying to get this Xiaomi remote running under Libreelec too, but I am struggleing to get the vid and pid from my bluetooth remote, so I can put it in the "51-these-are-not-joysticks-rm.rules" file. It connects as a Joystick/Gamepad in the libreelec bluetooth addon, but now reaction on key presses.

So what do I need to put into over ssh, in the command line to get the vid and pid of my xiaomi bluetooth remote. Then maybe I will be able to continue with the described method from here in the thread.
Reply
#20
Hi Vlaves
Vendor=2717
ProdID=32B1
It works out of the box with LibreELEC-Generic.x86_64-8.0.2.img.gz
Hope that will help you
Reply
#21
(2017-09-10, 17:22)ashrafhumax Wrote: Hi Vlaves
Vendor=2717
ProdID=32B1
It works out of the box with LibreELEC-Generic.x86_64-8.0.2.img.gz
Hope that will help you

Thanks so much for the reply and your help. Hope that the vid and pid will match to my remote too.
But in generell, how would I get the vid and pid from my remote in libreelec?

Thanks again so much for your support here Smile
Reply
#22
I usually use kodi input log
Please see the attached pictures

Image
Image
Reply
#23
(2017-09-11, 18:34)ashrafhumax Wrote: I usually use kodi input log
Please see the attached pictures
...

Thanx so much Smile
Reply
#24
Inordered two of these bt remotes shown in the pictures on the previous page.
They indeed got recognized as a joystick. I will be using this guide to get LE to properly recognize it.


Thanks!
Reply
#25
Just got this working with...

An ABS plastic - aftermarket Xiaomi Mi Box remote or the USA spec Xiaomi Mi Box remote and LibreELEC Kodi Krypton 17.4 running on an S805 ODROID C1 with a v4.0 CSR Bluetooth Dongle:
Those with inbuilt Bluetooth will not even need a USB dongle.

Accessing LibreELEC Help (click)



So far user tested and working on these LE devices: Smile

- RPi's with a BT dongle
- WeTek Hub / Play2
- Generic S9xx devices with inbuilt Bluetooth
- MECOOL M8S Pro+ with a v4.0 CSR BT dongle
- MINIX U9
- ODROID C2 with a v4.0 CSR BT dongle using this test .tar update



How to Set it all up:

1) Kodi Settings > LibreELEC > Services > Bluetooth > Enable

2) Kodi Settings > LibreELEC > Bluetooth > Xiaomi Remote > Trust and Connect

3) Then simply copy and paste this:
Code:
curl -sL http://wrxtasy.libreelec.tv/LE-Xiaomi/xbt.sh | bash -

4) You can check connected devices (USA Spec remote here) with:
Code:
cat /proc/bus/input/devices

I: Bus=0005 Vendor=2717 Product=32b2 Version=1026
N: Name="Xiaomi Remote"
P: Phys=00:15:83:CC:84:04
S: Sysfs=/devices/virtual/misc/uhid/input3
U: Uniq=08:EB:29:36:60:3C
H: Handlers=kbd event3
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff fff80f80 3c00f002
B: MSC=10
B: LED=1f

5) Xiaomi remote remapping is found here, use a Kodi debug log (enable in Kodi settings > System) to see KEY press events:
Code:
cat .kodi/temp/kodi.log

and custom edit them if needed:
Code:
nano .config/xiaomibtremote.evmap

CTRL-O to save CTRL-X to exit

6) Want to further custom remap remote buttons for particular individual areas of Kodi use ?

Kodi Settings > Addons > Install from Repository > Programs > Keymap Editor

Two suggested remote buttons that definitely need remapping to increase Kodi functionality:
KeyMap Editor:

Fullscreen Video > Playback > Stop > press Xiaomi remote Back button
Fullscreen Live TV > Playback > Stop > press Xiaomi remote Back button
Global > Navigation > Context Menu > press Xiaomi remote Context (hamburger) button




These Xiaomi BT remotes make an excellent addition to dual boot LibreELEC / Android TV ROM boxes like the WeTek Hub & Play2 that can now use the Bluetooth Xiaomi remotes with both Operating Systems Smile

The following Xiaomi BT remotes work as well because they all use the same 2717 VendorID.
Beware the dirt cheap ones with rubber keys and a Coin type battery, as they will not be as good or easy to use

Original Genuine Xiaomi Bluetooth Remote - $11.19

or

Xiaomi Bluetooth Remote Control 2 $11.50

W.

Reply
#26
wrxtasy,
Thank you very much for your guide and great work Big Grin
Reply
#27
Hi Wrxtasy,

I saw your posts today and thought, "Finally! A solution to my problem!"

But alas, no dice.

I'm not sure what it is. I have two each of two official Xiaomi BT remotes—one style uses a coin battery, the other AAAs. I have four Odroid C2s. I have tried both CSR 4.0 and IOGear GBU521 dongles. I have tried fresh installs of official LE 8. I cannot get these remotes to work properly with the C2s—at least not within LE. I pair the remotes just fine, and get the response beeps (on the coin cell versions) and they show as paired, but keypresses do nothing and in cat /proc/bus/input/devices, nada. The LE rules don't seemingly make a difference. They'll even pair fine with my iOS devices, and there are zero problems pairing any other BT devices (PS2 controllers, BT Keyboard) to LE. *Just* these remotes.

Code:
KodiLivingRoom:~ # cat /proc/bus/input/devices
I: Bus=0010 Vendor=0001 Product=0001 Version=0100
N: Name="adc_keypad"
P: Phys=adc_keypad/input0
S: Sysfs=/devices/adc_keypad.42/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=100003
B: KEY=800 c004000000000 2

I: Bus=0010 Vendor=0001 Product=0001 Version=0100
N: Name="gpio_keypad"
P: Phys=gpio_keypad/input0
S: Sysfs=/devices/gpio_keypad.41/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=100003
B: KEY=10000000000000 0

I: Bus=0010 Vendor=1b8e Product=0cec Version=0001
N: Name="cec_input"
P: Phys=
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=kbd event2
B: PROP=0
B: EV=3
B: KEY=2000000000000000 0 0 0 0 fc004 4c0000000000 1 400010300 51fa40000801 1e168000000000 10000010000ffc

I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="meson-ir"
P: Phys=meson-ir/input0
S: Sysfs=/devices/c8100580.meson-ir/rc/rc0/input3
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=100013
B: KEY=1000000 0 0
B: MSC=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="MCE IR Keyboard/Mouse (meson-ir)"
P: Phys=/input0
S: Sysfs=/devices/virtual/input/input4
U: Uniq=
H: Handlers=sysrq kbd mouse0 event4
B: PROP=0
B: EV=100017
B: KEY=30000 7 ff87207ac14057ff febeffdfffefffff fffffffffffffffe
B: REL=3
B: MSC=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="lircd-uinput"
P: Phys=
S: Sysfs=/devices/virtual/input/input6
U: Uniq=
H: Handlers=sysrq kbd event5
B: PROP=0
B: EV=100003
B: KEY=ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffffffe

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="eventlircd"
P: Phys=/dev/input/event5
S: Sysfs=/devices/virtual/input/input8
U: Uniq=
H: Handlers=event6
B: PROP=0
B: EV=3
B: KEY=ffffffffff 0 0 f00000000 0 0 3fdff 7fff8fff00ff03ff 0 0 0 0

But the kernel event line is correct:
Code:
KERNEL=="event3", ENV{eventlircd_enable}="true", ENV{eventlircd_evmap}="aftvsremote.evmap"

It makes me want to pull out my hair, given that they pair in Android AND Ubuntu on the C2, and with LE on my Pis. It's like the C2 build of LE has a hate on for them.
Reply
#28
There appears to be USB Hub errors in the Kernel Log on the C2 preventing BT Dongle device info from reading...

I've tried other S905X devices and they are fine. The issue on the C2 will have to be investigated. Sad

Code:
[    6.187039@0] Bluetooth: HCI device and connection manager initialized
[    6.187070@0] Bluetooth: HCI socket layer initialized
[    6.187079@0] Bluetooth: L2CAP socket layer initialized
[    6.187128@0] Bluetooth: SCO socket layer initialized
[    6.199666@0] meson-ir c8100580.meson-ir: receiver initialized
[    6.236178@3] usbcore: registered new interface driver btusb
[    6.334297@2] ERROR::handle_hc_nak_intr:1306: Can not read device info from hub.We take it error
[    6.334297@2]
[    6.350757@2] 8021q: 802.1Q VLAN Support v1.8

Reply
#29
Any help is appreciated.

I've had my first two MiTV remotes for almost a year hoping that each new version of LE would fix this issue, and have posted both here and the LE forums about it a few times. So to have someone who does LE development finally able to see the problem first-hand gives me hope that a resolution will come and these excellent remotes will be able to be used with my excellent C2s.
Reply
#30
My remotes came in. They are the exact same as in post#11.

I followed wrxtasy's instructions and placed the .rules files in /storage/.config/udev.rules.d, cross-referenced the eventid (mine is event5). No go unfortunately.

The BT device is recognized and paired. When pushing buttons i see the codes in dmesg. No effective responses to keypresses, though

I might add i am using kszaq's LE 7.0.12j community build, might have something to do with it.

Any hints ..?
Reply
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 12

Logout Mark Read Team Forum Stats Members Help
Connect Xiaomi Mi Box BT remotes to LibreELEC devices0