[SOLVED] MELE F10 Pro remote

  • Hi! Complete newbie on linux here...

    I've been using KODI on windows with MELE F10 Pro for years and now that I need to run Kodi off of RPi3 it does not work properly.
    Apart from the AirMouse not working, there are keys that are not recognized by LibreElec that I'm used to and now they don't work.
    ( Mele F10-Pro 2.4GHz Remote Control Air Mouse w/ Keyboard - Black - Free Shipping - DealExtreme )

    I've tried to use system-tools addon which has HID_Mapper in it, but while it recognizes the HID device, it won't enter the learning mode and does not recognize the HID device if I build the map file myself...
    HID_Mapper: [LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live)

    The HID Mapper shows the device, and as opposed to the how-to, I didn't disable the remote in Xorg conf.file as I didn't find it. I presume LibreElec uses another service/daemon to manage HIDs that would need the remote disabled? But I have no idea what it is and if so, how to disable it...
    I've attached screen from Putty, this is what I get.

    I know the scan codes of the remote from a colleague of mine who found out somehow in linux:
    SMART ASSISTANT: 02 4B 03 02 00 00
    PICK-UP: 02 49 03 02 00 00
    HANG-UP: 02 4A 03 02 00 00
    SOUND SWITCH: 02 48 03 03 00 00

    Can anyone help me? As I am a complete newbie in Linux/LibreElec, I'd need a little more help than your average Linux user...
    Just to be clear, I'd like to somehow make the four buttons work and let the rest be as they are, but if I'll end up re-mapping every key, I'd be OK with that.

    Thank you! :blush:

  • So after a ton of struggle and thanks to Gaudi I was able to map the buttons using the hwdb.d.

    What I did:

    1.) Stopped kodi using "systemctl stop kodi" (using Putty for windows)
    2.) Using evtest from kodi package I got the scancodes:

    Code
    OpenELEC:~ # evtest
    No device specified, trying to scan all of /dev/input/event*
    Available devices:
    /dev/input/event0:      058F312D81A Modiotek USB Headset
    /dev/input/event1:      058F312D81A Modiotek USB Headset
    /dev/input/event2:      058F312D81A Modiotek USB Headset
    Select the device event number [0-2]:

    By selecting "0" and then pressing the buttons I wanted to map I found the codes to be:

    3.) After this I created a file that I named 99-mele.hwdb which apart from the header contains:

    4.) The file then needs to be put in: /storage/.config/hwdb.d/ (I've used WinSCP to do this)

    5.) Then I updated the database and unplugged and plugged the receiver in:

    Code
    udevadm hwdb --update

    After this all works just fine and I have two more buttons to map if needed.

    I've also learned that using Windows text editor to update the file will make the file not work as the enter character is different. So I've used VIM text editor to edit this file. Even Notepad++ did not manage to make the file work.

    udevadm has no output to verify that the database was updated succesfully, so it is a trial&error process that will probably take some time.

  • Hi, I wonder if you could help me. I have LibreELEC running on a Beelink MXmini III. I have a Mele F10 Pro

    I have read the above post & the one on the Openelec forum.

    I copied


    Code:

  • Hi!

    I've had similar issues. Most probably you have the file starting like so in vim:

    Code
    ..###

    So get rid of the dots and you should be fine. These dots are due to BOM used in formatting the file. There is UTF-8 and UTF-8 with BOM.
    More on that here: Byte order mark - Wikipedia
    While in vim (or nano which looks better and is easier to work with) try also to delete all the enters and make new ones from vim/nano just to be sure.

    If Vim shows no dots at the start of the file, try a different text eritor. Frankly I was tired of vim and nano, so I've installed raspbian on one of my RPi3 modules and work there :)

  • Thanks, there were no dots, so I opened Vim & typed manually, then saved. I notice there was a file call 99-mele.hwdb~ it also created a ++notepad file. I copied the one with ~ to the .config/hwdb.d

    Then ran the update in putty, this time there was no error message, so I thought that looks good.

    rebooted, removed adapter, but still not working.

    I will be going out soon, so I'll give it another go later.

    Thanks

  • Well, looking back at the Openelec forum, I copied the 99-mele file to /etc/udev/hwdb.d & ran the below updates

    Based on these values I've created a file in attachment (with .hwdb instead of.txt) and inserted it in: /etc/udev/hwdb.d which I believe is the same as /storage/.config/hwdb.d
    After that I ran two commands:udevadm hwdb --update
    udevadm trigger /dev/input/event0

    It's still not working, I'm beginning to regret buying this, I was hoping the get voice search working in SPMC. But I'm having no luck with that either.

    If I could at least get the stop play pause buttons working in Libreelec I could live with that.
    [hr]


    Try the enters, those did it for me...

    Try the enters? I wrote the code directly in Vim.

    What do you mean?

    Edited once, last by bubblegum57 (October 5, 2016 at 9:21 PM).

  • Dr.Romca, I am not sure what I am doing wrong, would it be possible for you to post YOUR 99-mele.hwdb file as an attachment on this forum?

    If not, if I sent you a private message with my email address, could you send it there?

    That way if it still doesn't work, then it must be something else.

    Thanks

  • I've put the file in my old mediafire account:

    99-mele

    I hope that helps...

    You might want to re-connect the receiver in the USB port as well, some even reported they had to re-boot.

    Edited once, last by Dr.Romca (October 6, 2016 at 7:18 PM).


  • What do you get if you stop kodi and do evtest and select the event0 upon the button presses? Are those identical to the file I've uploaded?

    I haven't done that, I was hoping this was going to be easy. I'll give it a go later.

    Thanks for your patience.

  • I have now used evtest,

    By pressing the small keyboard symbol on the keyboard, kodi goes back. That has been happening since I got the remote.

    Pressing this key I get a code of 70029. but by putting that key code into the file you send me doesn't get the Smart Assistant button to go back.

    I'm confused, I assume you are pressing a keyboard key to get the code? So in your 99-mele file you have f11. So are you pressing f11 on your keyboard, because I don't have f11 or play/pause on the keyboard, or mute.

    Any idea? Do I need to map a keyboard?

  • I think you got it backwards. The keys playpause & f11 and so on are the keys I want the buttons to be mapped to - the desired buttons.
    The hardware does not send these keys, but rather a scancodes, those are the "0c034b" before the equal sign. Using evtest, you can see what scancodes your remote actually sends like I did...

    The small keyboard button does actually work as Esc, so it does what the Esc on a regular keyboard does in Kodi...

    The file I've created re-maps buttons on the remote side of the device, not the keyboard side, but I guess you've got that.

    Confirm that you have the same scancodes (of those buttons that don't normally work) first and then we'll try to figure out the rest...


  • I think you got it backwards. The keys playpause & f11 and so on are the keys I want the buttons to be mapped to - the desired buttons.
    The hardware does not send these keys, but rather a scancodes, those are the "0c034b" before the equal sign. Using evtest, you can see what scancodes your remote actually sends like I did...

    The small keyboard button does actually work as Esc, so it does what the Esc on a regular keyboard does in Kodi...

    The file I've created re-maps buttons on the remote side of the device, not the keyboard side, but I guess you've got that.

    Confirm that you have the same scancodes (of those buttons that don't normally work) first and then we'll try to figure out the rest...

    ok, the skip backwards next to the phone pick up button has c00b6 the skip forwards is c00b5

    phone pickup no scancode
    phone down no scancode
    home button 7004a
    context next to home button c0040
    smart button? top right of remote, no scanscode
    gamepad, mouse, remote & speaker no scancode
    centre 70028
    up 70052
    down 70051
    right 7004f
    left 70050

  • Well it looks like the kernel you are using won't recognize these, I would try hid_mapper if you have any luck with that, but this method will probably not work for you...