Remote Control

  • Hi, I'm looking for a bit of advise regarding a One 4 All streamer remote control and GPIO IR receiver, I followed the wiki on infared remotes and configured it the hard way and it is working as expected, excluding the occasional double button press when pressing up or down.


    Keymap file


    rc_maps.cfg

    Code
    LibreELEC:~/.config # cat rc_maps.cfg
    # Keymaps table
    * * streamer_remote


    Ideally I would like to remap a few of the buttons to run a few scripts but no matter what i have tried it doesn't seem to work, I tried to add a keymap.xml to kodi userdata folder but it doesn't seem to have any effect


    Code
    LibreELEC:~/.config # cat ../.kodi/userdata/keymaps/keymap.xml  
    <keymap>
     <global>
       <remote>
         <epg>System.Exec("/storage/cycle-source.sh")</epg>
       </remote>
     </global>
    </keymap>


    Am i doing something wrong or would it be better and easier to revert to the LIRC method?


    Also can a bash script be ran or would a python be more appropriate?


    any help or assistance would be appreciated :thumbup:

  • For running scripts / commands by IR remote I would recommend go this way, it's reliable and easy to (re)configure, especially if you can map buttons unused by Kodi (use search to find some more examples here):



    echo /usr/bin/irexec -d /storage/.config/lircrc >> /storage/.config/autostart.sh


    And some example of lircrc config file:


    /storage/.config/lircrc :


    begin

    prog = irexec

    button = KEY_A

    config = kodi-send --button=a

    end


    begin

    prog = irexec

    button = KEY_TITLE

    config = /storage/signalshow/sigshow.sh

    end


    begin

    prog = irexec

    button = KEY_POWER2

    config = /storage/relay/togglerelay.sh

    end


    begin

    prog = irexec

    button = KEY_PRINT

    config = kodi-send --action="TakeScreenshot"

    end


    begin

    prog = irexec

    button = KEY_MODE

    config = kodi-send --action="ActivateWindow(Settings)"

    end



    begin

    prog = irexec

    button = KEY_FAVORITES

    config = kodi-send --action="ContextMenu"

    end

    Edited 3 times, last by ghtester ().

  • Try with "guide" instead of "epg" in the keymap.xml file. The "KEY_EPG" code is mapped to the "guide" button in Lircmap.xml (see the devinput section).


    so long,


    Hias

  • Try with "guide" instead of "epg" in the keymap.xml file. The "KEY_EPG" code is mapped to the "guide" button in Lircmap.xml (see the devinput section).


    so long,


    Hias

    Wow, worked first time Hias, thanks - I feel like a bit of a tool tbh as out of all the things i could have chosen i picked that one and didn't look in the Lircmap.xml file :blush:


    Happy days tho i can reset the remote and map all the buttons.


    Thanks again


    You wouldn't happen to know where i can change the

    Code
    Repeat delay = 500 ms, repeat period = 125 ms



    Just to add: in case someone googles that remote at any point, by default there are 4 buttons that cannot be coded as they are reserved (netflix, Amazon buttons etc) by resetting the remote and not enabling CEC and using NEC protocol they can be remapped, despite what One for All say.

    Edited once, last by Veedub ().

  • in LE 9.2 you can change repeat settings via a udev rule, eg /storage/.config/udev.rules.d/99-my-repeat.rules with this content:

    Code
    ACTION=="add", SUBSYSTEM=="input", SUBSYSTEMS=="rc", KERNEL=="event[0-9]*", \
    RUN+="/usr/bin/ir-keytable --delay=750 --period=150 --device=$devnode"


    See also /usr/lib/udev/rules.d/70-input-repeat.rules (which applies to non-rc-core devices).


    so long,


    Hias