Skip to content

Instantly share code, notes, and snippets.

@alexrashed
Created February 5, 2021 19:10
Show Gist options
  • Save alexrashed/2c241d43eaf7f8a16d0160c5cd9f8afa to your computer and use it in GitHub Desktop.
Save alexrashed/2c241d43eaf7f8a16d0160c5cd9f8afa to your computer and use it in GitHub Desktop.
IR Remote on LibreElec
  • Enable gpio-ir on GPIO port 18
    mount -o remount,rw /flash
    echo "dtoverlay=gpio-ir,gpio_pin=18" >> /flash/config.txt
    
  • Get codes sent by IR remote
    ir-keytable -p all -t
    
  • Create keymap in /storage/.config/rc_keymaps/
    cat /storage/.config/rc_keymaps/one-for-all 
    # table one-for-all-remote, type: NEC
    0x860509 KEY_NUMERIC_0
    0x860500 KEY_NUMERIC_1
    0x860501 KEY_NUMERIC_2
    0x860502 KEY_NUMERIC_3
    0x860503 KEY_NUMERIC_4
    0x860504 KEY_NUMERIC_5
    0x860505 KEY_NUMERIC_6
    0x860506 KEY_NUMERIC_7
    0x860507 KEY_NUMERIC_8
    0x860508 KEY_NUMERIC_9
    0x860518 KEY_ENTER
    0x860518 KEY_EPG
    0x86051b KEY_INFO
    0x86050c KEY_VOLUMEUP
    0x86050d KEY_VOLUMEDOWN
    0x860547 KEY_FASTFORWARD
    0x860540 KEY_REWIND
    0x86051d KEY_PAUSE
    0x86051d KEY_PLAY
    0x86051e KEY_STOP
    0x860515 KEY_UP
    0x860516 KEY_DOWN
    0x860542 KEY_LEFT
    0x860543 KEY_RIGHT
    0x860514 KEY_MENU
    0x860517 KEY_EXIT
    0x860555 KEY_ZOOM
    0x860554 KEY_SUBTITLE
    0x860510 KEY_BACK
    0x860556 KEY_HOME
    0x860557 KEY_BLUE
    
  • Configure keymap to be used persistently
    cat /storage/.config/rc_maps.cfg
    * * custom_remote
    
  • Configure irexec
    cat /storage/.lircrc 
    begin
      prog = irexec
      button = KEY_BLUE
      config = kodi-send --action='RunScript("/storage/scripts/toggle-lifx.py")'
    end
    
  • Add irexec to autostart.sh
    cat /storage/.config/autostart.sh
    /usr/bin/irexec -d
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment