Skip to content

07. CoreELEC: IR Wakeup Code

betatester3016 edited this page Jan 4, 2022 · 5 revisions

ce_logo

The information contained within this document applies to CoreELEC ONLY!

This how-to applies to following devices:

  • Odroid N2
  • Odroid C4
  • Odroid HC4
  • Generic Amlogic Devices with bl301 injected

Index

  1. Using a predefined IR wakeup code
  2. Obtaining the power code via SSH
  3. Using a remotewakeup user file
  4. Error messages
  5. Editing config.ini

1. Using a predefined IR wakeup code

CoreELEC comes with a list of predefined IR power codes. There are codes are for:

  • Hardkernel
  • Minix
  • Beelink
  • Beelink 2
  • Khadas
  • Khadas VTV
  • MCE
  • ...

This option can be accessed by navigating to:

Settings → CoreELEC → Hardware → IR Remote Power Code

Untitled-1

2. Obtaining the power code via SSH

If there is no matching IR power code predefined, this option can be used to find the devices unique IR power code.

Since CoreELEC uses Meson_IR by default, it is possible to scan a device for the IR remote wakeup code and apply this code to the file config.ini

If a Meson_IR remote is used with the device, it is important to remove or rename any remote.conf located in:

  /flash/

and, or,

 /storage/.config/

After a reboot, the Meson_IR device will be active.

SSH into the device and stop the Kodi and eventlircd services:

 systemctl stop kodi
 systemctl stop eventlircd

Next run ir-keytable with option -u:

 ir-keytable -u

On the remote, press a preferred button to wake up the IR remote. If the decoded protocol is implemented a code similar to this one be shown:

 Received IRMP code: remotewakeup='0xbf40fe01', decode_type='0x0', remotewakeupmask='0xffffffff'

Enter these values to the config.ini file.

On the next suspend/power off, the device should now be able to wake up by pressing the preferred button with the previously scanned IR code.

3. Using a remotewakeup user file

Support for a remote wakeup user file was implemented into CoreELEC February 2021

Naming convention:

  (name).remotewakeup 
  eq: mytvbox.remotewakeup

Custom wakeup code file syntax:

  remotewakeup='0xaabbffff'
  decode_type='0x0'
  remotewakeupmask='0xaabbffff'

Location: /storage/.config/

The following example is for a H96Pro+ remote

 touch /storage/.config/H96ProPlus.remotewakeup
 vi /storage/.config/H96ProPlus.remotewakeup

insert:

 remotewakeup='0xbf40fe01'
 decode_type='0x0'
 remotewakeupmask='0xffffffff'

[ESC] :wq [ENTER]

reboot now

After reboot the IR wakeup code should be available in CoreELEC settings.

4. Error messages

When receiving:

   /sys/class/rc/: No such file or Directory 

force meson-ir modus first like this:

   touch /storage/.config/remote.force_meson_ir
   reboot now

After reboot the above command should work and the file remote.force_meson_ir can be deleted to re-enable the meson-ir protocol again.

If the decoded protocol is not implemented a message similar to this one will appear:

   Received IRMP code: scancode='0x00251001', IRMP protocol = 7, decode_type is undefined!

In this case an implementation/code mapping for u-boot would be needed.

If there is no message, the IR pulses need to be debugged to detect the correct IR protocol:

   echo 2 > /sys/module/rc_core/parameters/debug

The received IR pulses will be printed to the kernel console and can be read by entering

  dmesg

5. Editing config.ini

A. External via a computer

The easiest way to edit the config.ini file is to insert the eMMC/(m)SD card with CoreELEC into a computer and edit the values remotewakeup, decode_type and remotewakeupmask with a unix compatible file editor like vi, nano or vim

B. Internal via SSH

   SSH root@ip_address

Make /flash/ writable:

   mount -o rw,remount /flash

Edit config.ini with a unix compatible editor:

   vi /flash/config.ini

After saving type:

   sync && reboot

Source Portisch