[Raspberry Pi] LibreELEC IR Remote 設定

OS:LibreELEC
Package:
ir-keytable
LibreELEC 官網

功能:用 IR 遙控器控制 Kodi

設定方法
  1. # 掛載為讀寫模式
  2. mount -o remount,rw /flash
  3. # 在 /flash/config.txt 最後一行加入,gpio 依需求設定
  4. dtoverlay=gpio-ir,gpio_pin=17
  5. # 掛載為唯讀模式
  6. mount -o remount,ro /flash
  7. # 重開機
  8. reboot
自製方法
可到內建 /usr/lib/udev/rc_keymaps/ 找看看是否已有 ok 的設定
  1. # 確認可設定的 Key
  2. irrecord -l | grep ^KEY
  3. # 確認遙控器的編碼
  4. ir-keytable -p all -t
根據上面測到的編碼,建立 /storage/.config/rc_keymaps/my_custom_remote,範例如下
第一行的註解不可省略,type 一定要是對的
  1. # table my_custom_remote, type: nec
  2. 0x445 KEY_UP
  3. 0x446 KEY_DOWN
  4. 0x447 KEY_LEFT
  5. 0x448 KEY_RIGHT
  6. 0x444 KEY_OK
  7. 0x44a KEY_BACK
  8. 0x44f KEY_MENU
暫時測試
  1. # 停止服務
  2. systemctl stop kodi
  3. systemctl stop eventlircd
  4. # 載入新的 keymaps
  5. ir-keytable -c -w /storage/.config/rc_keymaps/my_custom_remote
  6. # 若內建有找到合適的檔案,例:samsung
  7. ir-keytable -c -w /usr/lib/udev/rc_keymaps/samsung
  8.  
  9. # 測試,會看到顯示對應按鍵輸出
  10. ir-keytable -t
  11. # 開啟服務,進行 Kodi 測試
  12. systemctl start kodi
  13. systemctl start eventlircd
永久設定
建立 /storage/.config/rc_maps.cfg,範例如下
官方範例位置 /storage/.config/rc_maps.cfg.sample
* * my_custom_remote
* * samsung
# 確認是否載入 OK
ir-keytable -a /storage/.config/rc_maps.cfg
# 重新啟動
reboot
# 確認設定是否正確
ir-keytable -r

參考

在樹莓派3上使用紅外遙控器控制libreELEC
Infrared Remotes

留言