Wake up using IR Remote controller on ODROID-N2/C4

ODROID-N2/C4 boot loader supports various wake-up functions after power off
and IR Remote wakeup is also available.

There are various types of data formats even in case of same protocol, eg. code data bit length.
So if you need another types of protocols or data formats besides given formats,
please post your request on Hardkernel Forum.
https://forum.odroid.com/

Available Types

The available protocol types are as following and default protocol type is NEC.

  • NEC (default)
  • RC5
  • RC6 (37bit / 21bit)
  • DUOKAN
  • XMP

Setting via boot.ini

###
# "NEC"
# "RC5"
# "RC6"
# "RC6_21BIT
# "DUOKAN"
# "XMP_1" 
###
setenv irdecodetype "NEC"

setenv bootargs ${bootargs} irdecodetype=${irdecodetype}

If there is no setting of this parameter, default protocol type, NEC will work as wakeup remote ir protocol.


You can assign remote wakeup key through a kernel's command line parameter, remotewakeup.
Without setup of the parameter, KEY_POWER of Hardkernel remote controller will be activated as remote wakeup key.

1. NEC

Here is an example in case of Hardkernel remote controller those decode protocol is NEC.
If lirc setup is done, you can get full codes using irw command.

root@odroid:~# irw
000000004db2738c 00 KEY_ENTER odroid
000000004db201fe 00 KEY_VOLUMEUP odroid

Set the 4bytes code in boot.ini as following.

### example : KEY_OK of Hardkernel remote controller
setenv remotewakeup "4db2738c"

### example : KEY_VOLUMEUP of Hardkernel remote controller
setenv remotewakeup "4db201fe"

setenv bootargs ${bootargs} remotewakeup=${remotewakeup}

If you have a remote using NEC protocol like Tronsmart remote, you need to convert some bits like this.

Get the keycode.

odroid@odroid:~$ irw
0000000000ff18e7 00 KEY_POWER Tronsmart

The MSB 2byte(address 16bit) should be swapped. (0x00ff 0> 0xff00)

setenv remotewakeup "0xff0018e7"

Thanks to our forum member @Joe_90 https://forum.odroid.com/viewtopic.php?p=302560#p302560

2. RC6

Here is another example with PHILIPS DVD PLAYER remote controller.
Its protocol is RC6 and data length is 21bits.
In case of RC6, remote wakeup key value on bl301 should be bit-converted.

begin remote

  name  philipsdvd
  bits           21
  flags RC6|CONST_LENGTH
  eps            30
  aeps          100

  header       2622   919
  one           397   486
  zero          397   486
  gap          108200
  toggle_bit_mask 0x10000
  rc6_mask    0x10000
  frequency    38000

      begin codes
          KEY_POWER                0x0EFB38
          KEY_OK                   0x0EFBA3
          KEY_LEFT                 0x0EFBA5
          KEY_RIGHT                0x0EFBA4
          KEY_UP                   0x0EFBA7
          KEY_DOWN                 0x0EFBA6
          KEY_HOME                 0x0EFB6D
      end codes
      
end remote
### KEY_POWER case 0x0EFB38 -> 0x0104c7
setenv remotewakeup "0x0104c7"

### KEY_OK case 0x0EFBA3 -> 0x01045c
setenv remotewakeup "0x01045c"

3. And other cases

Limited cases of decode protocol and data formats have been tested so far,
so please make a thread on Hardkernel Forum page when you have another types of remote controller,
then let us check the feasibility and make updates.

2020/03/18 14:16 · luke.go