Guide - using a Harmony with amlogic devices

  • The standard remote for my device (Beelink minimxiii) doesn't have a lot of buttons, so I was looking for something better.
    I ended up with a tweaked remote.conf for a pivos xios ds - loads of buttons, it's in the logitech database and it's fairly easy to set up. No LIRC on these things, so it's all about the remote.conf file.

    Outline:
    1. stick the remote.conf in storage/.config
    2. stick the pivos xios ds device on your Harmony
    3. learn the power-on command from your original remote, and add it to the device on the Harmony
    4. reboot amlogic thingumajig
    That's the meat of it - if you're comfortable playing with remote.confs and the Harmony you don't really need to read the rest...

    Now the detail.
    The remote.conf I use is this:


    Copy and paste that into a file called testremote.conf
    Copy that file onto your device - put it in the storage/.config folder ('Configfiles' if you're looking in Explorer).
    If you're unsure how to do that there's a guide on the wiki.
    That's now ready to try, so move across to your Harmony:

    • Install the 'pivos xios ds' device
    • using your original remote learn the 'power' command.
    • set the learned power command to 'power on' in the Harmony software
    • set the power command in the pivos profile to 'power off'


    After a bit of experimenting I ended up with the following delay settings for my Harmony:
    power on > 1000
    Inter-key, Inter-device and repeats (the last one accessed via 'troubleshooting') are all set to 0 (zero).
    Before that I had problems with multiple keypresses - it's what works for me / my device / my remote so use it as a starting point.

    Testing
    At this point your Harmony should be set up (at least as a device) and your remote.conf is in place, so you can try it out...
    SSH in (ie putty for windows) and run the following command:

    Code
    remotecfg /storage/.config/testremote.conf


    And it should work.
    If it does you can rename the existing remote.conf (assuming it's there - in case you want to go back to the original remote at some point) and make testremote.conf into remote.conf.
    After a reboot your Harmony should be working - now you just have to decide what to do with all the extra buttons.

    Tweaking buttons
    The easiest way is to use the keymap editor addon in the kodi repo. I dislike it, because the first thing it does when you enter is to disable all your existing custom keymaps - but it's a quick / easy way to set buttons to do what you want.

    Manually - if you enable debug logging and press a key then check the log you'll see what command / action was issued / performed and then use that to tweak your keymap.xml file.

    Changing remote.conf:
    Another option - you can change the code associated with a button by referencing the linux keycodes.
    The list I looked at is here:


    And finally, if you look at the box below, I've linked the Harmony commands for each button (last column). These are actually in my remote.conf, but sticking the whole thing in a code box made it too hard to follow...


    Anything not clear please fire away and I'll update this.

    Edited once, last by trogggy (December 2, 2016 at 11:40 PM).

  • That's great, I'll try it out this weekend. I just haven't figured out how to enter the internal storage of my box from my windows computer to put the remote.conf there.
    And also could you maybe post a list what button name of the original pivos xios ds remote resembles which key id? That way I wouldn't have to try out again and again putting a command to a specific button using myharmony.


  • That's great, I'll try it out this weekend. I just haven't figured out how to enter the internal storage of my box from my windows computer to put the remote.conf there.
    And also could you maybe post a list what button name of the original pivos xios ds remote resembles which key id? That way I wouldn't have to try out again and again putting a command to a specific button using myharmony.


    Easiest way to access the folder is via samba/smb:
    wiki video
    I've never seen a pivos - if you mean what buttons are set by default in the Harmony device I'll have a look - but it's pretty self-explanatory and you'll probably want to move some stuff around anyway when you come to make an Activity.
    I'll look at this tonight and see if I can make it clearer / add something useful. :)


  • That's great, I'll try it out this weekend. I just haven't figured out how to enter the internal storage of my box from my windows computer to put the remote.conf there.
    And also could you maybe post a list what button name of the original pivos xios ds remote resembles which key id? That way I wouldn't have to try out again and again putting a command to a specific button using myharmony.


    I use coreftp lite from my windows 10 to access libreelec


  • And also could you maybe post a list what button name of the original pivos xios ds remote resembles which key id? That way I wouldn't have to try out again and again putting a command to a specific button using myharmony.


    Here you go. Last column:


    I've added that to the end of the guide, thanks for the feedback.

    Edited once, last by trogggy (December 2, 2016 at 11:41 PM).

  • I think the backspace button is missing because now I have mapped every button in my harmony with one of pivos remote buttons but none of them allows me to move backwards in any KODI menu.
    One of them must be mapped with the key id "

    Code
    61448


    " for backspace and your description says it would be the button "Return", but it doesn't work.

    And further you say "

    Code
    Buttons with a * are not mapped to physical buttons on the harmony.


    " But at first addition of the pivos remote to myharmony the backspace-return button that in your list has no * wasn't mapped to a harmony button so I did that myselve but it is still not working.

    EDIT: weird is if I'm in my movie library and hold the return button for one second it goes back to main menu and when I hold it for one second in main menu the shut down menu comes up like pressing "s" on a keyboard.

    Edited once, last by honolulu1 (December 3, 2016 at 12:24 PM).


  • I think the backspace button is missing because now I have mapped every button in my harmony with one of pivos remote buttons but none of them allows me to move backwards in any KODI menu.
    One of them must be mapped with the key id "

    Code
    61448


    " for backspace and your description says it would be the button "Return", but it doesn't work.

    And further you say "

    Code
    Buttons with a * are not mapped to physical buttons on the harmony.


    " But at first addition of the pivos remote to myharmony the backspace-return button that in your list has no * wasn't mapped to a harmony button so I did that myselve but it is still not working.

    EDIT: weird is if I'm in my movie library and hold the return button for one second it goes back to main menu and when I hold it for one second in main menu the shut down menu comes up like pressing "s" on a keyboard.


    Something odd is happening. Maybe with your Harmony settings - did you set the suggested delays? If not try them / if you did maybe try the default settings?
    The exit button on the Harmony should 100% work. I use a Harmony one and 525, and on both that backspace/return is mapped to exit by default - maybe yours is different...? Anyway I've just tested it with a new Harmony profile and the file from post #1 and I'm going back as expected by pressing exit (Harmony in device mode).

    The shutdown menu appearing makes sense actually. That's a 'longpress' function (pain in the neck if you ask me!). When I first used the Harmony - before I started messing with settings in remote.conf and the Harmony software to adjust delays - I used to see them all the time.
    Effectively your default keymap is saying this for the Exit button on your Harmony:


    That's what you saw when you longpressed and at least (phew ;) ) it shows the remote.conf is doing its job correctly.
    You can disable that behaviour (if you want to!) by editing the text aboveand sticking it in your keymaps folder. Eg to disable the power menu appearing:

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <Home>
        <keyboard>
          <backspace mod="longpress">noop</pagedown>      
        </keyboard>
      </Home>
    </keymap>


    or to stop Exit taking you straight to the homescreen from your video library and video files:


    Did I mention I find editing keymap files a pain in the neck?
    Let me know how it goes, any problems keep shouting out here.

    Edited once, last by trogggy (December 3, 2016 at 2:33 PM).

  • Nope. Tried to to add the pivos again to my harmony devices and leave everything on default eccept I had to map the return command to my exit botton because it isn't mapped at all on default.
    All delays on default and even deleted the keymap editor addon in KODI to make shure it wasn't messing with any settings.
    Because I have a Harmony 350 for some devices I have to press the device button for 2 seconds to select it so put the pios on two device slots (short press and long press) to avoid any crossing commands.
    Still the same result. I don't know if I can maybe write a seperate keymap and map alle the buttons manualy. Could that work and if yes how do I do that? I already altered my keyboard.xml on the KODI run on my windows pc but I don't really know how to do that in Libreelec.

    Edited once, last by honolulu1 (December 3, 2016 at 2:03 PM).


  • Nope. Tried to to add the pivos again to my harmony devices and leave everything on default eccept I had to map the return command to my exit botton because it isn't mapped at all on default.
    All delays on default and even deleted the keymap editor addon in KODI to make shure it wasn't messing with any settings.
    Because I have a Harmony 350 for some devices I have to press the device button for 2 seconds to select it so put the pios on two device slots (short press and long press) to avoid any crossing commands.
    Still the same result. I don't know if I can maybe write a seperate keymap and map alle the buttons manualy. Could that work and if yes how do I do that? I already altered my keyboard.xml on the KODI run on my windows pc but I don't really know how to do that in Libreelec.


    This seems very odd - because it obviously worked when you went home from movielibrary and saw the power menu (ie kodi was detecting a 'longspace back' press).
    Can you do the following:
    1. Enable debug logging.
    2. restart kodi
    3. make a note of the time (on kodi homescreen).
    4. when the time switches to a new minute press Exit (return) a couple of times.
    5. when the kodi clock flips to the next minute press and hold Exit a couple of times (as earlier when you got the shutdown menu).
    6. upload the log to pastebin (or wherever) and let me know the time of the first keypress.
    Unless you're comfortable cutting and pasting from the log in which case just stick what you get in a post here.
    What I see in my log for a normal (short) press of Exit('return'):

    Quote


    Keyboard: scancode: 0x0e, sym: 0x0008, unicode: 0x0008, modifier: 0x0
    DEBUG: OnKey: backspace (0xf008) pressed, action is Back


    Edit: that 0xf008 is the 61448 in hex btw.

    Edited once, last by trogggy (December 3, 2016 at 3:04 PM).

  • Two ways:
    1. Use coreftplite, winscp, filezilla or similar and it's in /.storage/.kodi/.temp

    2.In explorer navigate to 'Configfiles' and open the samba.conf.sample in a text editor.
    Add the following entries:


    Save the file as samba.conf (make sure you don't make samba.conf.txt!!!). Reboot, and when you open it up in explorer again you'll see the 2 new entries (only the first is needed if you just want to see the log files).

    I use number 2.

  • OK, here is the pastebin debug.log of the last actions. I pressed at 16:47 and at 16:48

    Thread JobWorker 547901927648 terminating (autodelete) 16:46:34 T:548338131168 - Pastebin.com

    I thought it might have something to do with cec so I completely deactivated it and got following line without the error:

    DEBUG: Keyboard: scancode: 0x0e, sym: 0x0008, unicode: 0x0008, modifier: 0x0
    17:01:15 T:547827302400 DEBUG: OnKey: backspace (0xf008) pressed, action is fullscreen
    17:01:15 T:547827302400

    Still no backspace happend when pressing it. The difference to your DEBUG is "action is Back", so what does action is fullscreen mean and why does it do that instead of back?
    [hr]


    or to stop Exit taking you straight to the homescreen from your video library and video files:

    What file name and extension is needed for the file I create and paste the above code in? And where do I put that file? \\LIBREELEC\Storage\.config\rc_keymaps or \\LIBREELEC\Configfiles\rc_keymaps?

    Edited once, last by honolulu1 (December 3, 2016 at 4:23 PM).


  • Firstly the remore.conf and the Harmony are doing their job correctly. All they do is get that 'backspace (0xf008)' key into kodi; anything after that is down to how kodi deals with it.
    Q. Do you have any keymaps in /sorage/.kodi/userdata/keymaps? If you do can you post them up?
    If not it's either take a look at your default keymap (which means cranking up something like winscp) or looking at how your original remote deals with the back button and copying that.
    That (the keymaps folder) is where the file you're asking about goes btw - it's saved as *whateveryouwant*.xml and overrides the default keymap. The one you quoted won't work though, it's the 'backspace' command that needs to be mapped correctly.
    'Fullscreen' does pretty much what it says - takes you back to a full screen (if you're not already in one).

    Edit: It's possible 'Backspace' is correctly mapped to 'fullscreen' on the home page - 'cos there's nowhere to go back to IYSWIM. That's not mapped like that on my box, but it wouldn't be illogical.
    Maybe check the log when you press Exit in another window (eg movie library) and post the result...

    Edited once, last by trogggy (December 3, 2016 at 4:43 PM).

  • <keymap><home><keyboard><key id="61489">activatewindow(videos,tvshowtitles )</key></keyboard></home><global><keyboard><key id="61656">contextmenu</key><key id="61623">play</key><key id="61623">pause</key><key id="61623">playpause</key><key id="61660">stop</key><key id="61625">fastforward</key><key id="61624">rewind</key><key id="61585">osd</key><key id="61448">fullscreen</key><key id="61585">info</key></keyboard></global><osdvideosettings><keyboard><key id="61585">info</key></keyboard></osdvideosettings><fullscreenvideo><keyboard><key id="61585">info</key></keyboard></fullscreenvideo></keymap>


    Now do I just replace "61448">fullscreen< with "61448">back< or "61448>backspace< ?
    [hr]
    OK it was the first one and now it finally works.

    DEBUG: Keyboard: scancode: 0x0e, sym: 0x0008, unicode: 0x0008, modifier: 0x0 17:51:47 T:548261658624
    DEBUG: OnKey: backspace (0xf008) pressed, action is back

    Thanks for the help. And can I use the KODI keymap editor addon now to quickly remap some buttons or would it mess something up?

    Edited once, last by honolulu1 (December 3, 2016 at 4:55 PM).


  • <keymap><home><keyboard><key id="61489">activatewindow(videos,tvshowtitles )</key></keyboard></home><global><keyboard><key id="61656">contextmenu</key><key id="61623">play</key><key id="61623">pause</key><key id="61623">playpause</key><key id="61660">stop</key><key id="61625">fastforward</key><key id="61624">rewind</key><key id="61585">osd</key><key id="61448">fullscreen</key><key id="61585">info</key></keyboard></global><osdvideosettings><keyboard><key id="61585">info</key></keyboard></osdvideosettings><fullscreenvideo><keyboard><key id="61585">info</key></keyboard></fullscreenvideo></keymap>


    Now do I just replace "61448">fullscreen< with "61448">back< or "61448>backspace< ?


    I take it that's a file called gen.xml
    Bloody keymap editor - it's always unreadable.
    So what you've actually configured there is:


    Change <key id="61448">fullscreen</key> to
    <key id="61448">Back</key>
    and re-start.
    That should sort it.
    Actually just deleting that entry should do the same thing, as it should be mapped to 'Back' in the default keymap.

    User error - you broke it. ;)
    Let me know if it works / not - but it should be fine now. Phew.

    Edited once, last by trogggy (December 3, 2016 at 5:03 PM).

  • Yep everything is fine now. Thanks again.
    I just have some problems with mapping the home button, the equivalent to pressing "esc" on a keyboard. In your KODI map it resembles pressing "z" I think.
    How do I change the "z" to "esc"? Because I can't find a home screen command in the keymap editor addon.

    Edited once, last by honolulu1 (December 3, 2016 at 6:08 PM).