Odroid HC4 wakeup with remote control - how to?

Hi everybody,

yesterday I got a second-hand Odroid HC4, and after a lot of fiddling around with different µSD cards, repairing petitboot and an incompatible monitor, I got it up and running CoreElec.

There are two problems left:

1.)
I use a remote controller which originally was delivered with an X96 Air Android box. This remote works fine in amremote mode using a remote.conf for the X96 Air. Nevertheless I can’t wakeup the HC4 from standby mode. Could anybody please advise me how to setup the remote so I can wakeup the device from standby ?

2.)
The HC4 is equipped with a small fan, but the fan is not spinning. Could someone please give me a hint how to configure the fan ?

Thanks in advance, Nanobot

  1. coreelec:irwakeup [CoreELEC Wiki]

The section “power” on the page “settings / CoreElec / hardware” contains only one entry, which is “Wake-on-LAN”.

Perhabs the following additional informations may be helpful :
CoreElec is booted through petitboot ( after a 5 second timeout ). Is it neccessary to change this ?

Before i could use the HC4 I had to do a repair installation of petitboot, which also flashed the uboot partition with the default.

The remote control is configured as “amremote”. Maybe i have to change this to “meson-ir” ?

It’s because HC4 is not included in CE settings as it doesn’t have a IR receiver at all?

When you don’t have a standard remote from Hardkernel this is anyway no option. You need to edit config.ini and add your wake-up code manually.

The HC4 indead has a builtin IR-Receiver, with is marked as “J” on this picture:
Odroid-HC4

And by using the “amremote” configuration my remote (from the X96 Air) works within Kodi without any problems. But since I do not use the original remote from Hardkernel I will give the method to use my own wake-up code a try.

Concerning the question about the fan speed I found the needed commands in the odroid forum:

Odroid-HC4:~ # cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp
65000
Odroid-HC4:~ # cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_5_temp
75000

These two commands are showing the temperature limits for 50% and 100% fan speed. If the temperature drops is below 65°, the fan will be switched to 0% = off.

Using this commands

Odroid-HC4:~ # echo 30000 | tee /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp
30000
Odroid-HC4:~ # echo 40000 | tee /sys/devices/virtual/thermal/thermal_zone0/trip_point_5_temp
40000

the temperature limits can be adjusted to other values. Perhabs this information can be helpful to other HC4 owners.

One last question: In which file do I have to enter these two commands to execute them on every bootup ?

Thx for your help,

Nanobot

You will need to check GS King DTS for need changes to get a PWM running and define correct gpio as well.

I already tested the commands for the fan PWM on the HC4 and they work as intended. In the odroid forum they suggest to include these commands in /etc/rc.local, but this file does not exist in CoreElec. So my question is if I could/should create this file or where else these commands have to be included to be executed after each reboot.

You need to include this in the default HC4 DTB:

Ok, I found the solution for the fan speed. I created the file /storage/.config/autostart.sh containing

#!/bin/sh

# change temperature for  50% fan speed to 30°C
echo 30000 | tee /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp > /dev/null
# change temperature for 100% fan speed to 40°C
echo 40000 | tee /sys/devices/virtual/thermal/thermal_zone0/trip_point_5_temp > /dev/null

and after a reboot, the trigger temps for the fan PWM where adjusted like I would like to have them:

Odroid-HC4:~ # cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp
30000
Odroid-HC4:~ # cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_5_temp
40000
Odroid-HC4:~ # cat /sys/devices/virtual/thermal/thermal_zone*/temp
39000
40200
Odroid-HC4:~ #

So again thanks for your help, I will now start to fiddle around with the remote wakeup code.

Ok, here are my first steps (and failures) to edit the config.ini to make my HC4 wakeup with the X96 Air remote control. At first I need to inform you that I removed petitboot from my HC, so it is booting directly from the µSD card using the builtin “uboot” of the HC4.

My first step was to modify the config.ini like is is shown in the guide.

# IR setup
#   Setup a custom keycode to wake the N2/C4 from suspend or poweroff
#   You can stop kodi and eventlircd and use "ir-keytable -u" to obtain a compatible u-boot
#   IR keycode
#   This setting will require a injected bl301 blob.
#
remotewakeup='0xbf40fe01'
#
#   decode_type can be one of the following:
#   NEC='0x0', DUOKAN='0x1', TOSHIBA='0x2', RCA='0x3', RC5='0x4', RC6A='0x5', NEC_TOSHIBA_2IN1='0x6',
#   NEC_RCA_2IN1='0x7', RCMM='0x8', NEC_RC5_2IN1='0x9', NEC_RC5_2IN1='0xa', RC6='0xb'
#   This setting will require a injected bl301 blob.
#
decode_type='0x0'
#
#   remote power key mask:
#   Some IR protocols implement a toggle bit, this can be ignored by the "and" mask:
#   RC5='0x37ff', RC6='0x1effff', RC6A='0xffff7fff'
#   This setting will require a injected bl301 blob.
#
remotewakeupmask='0xffffffff'

After a reboot dmesg shows that these parameters are realised:

[    0.000000@0]d Kernel command line: BOOT_IMAGE=kernel.img boot=UUID=0904-1322 disk=UUID=cc9edc25-198b-43a4-b6a6-37b5a1e93de9 console=ttyS0,115200 console=tty0 no_console_suspend keymap=de     remotewakeup=0xbf40fe01 decode_type=0x0 remotewakeupmask=0xffffffff     vout=1080p60hz,en logo=osd0,loaded,0x3d800000 frac_rate_policy=1 native_4k_gui=0 hdr_policy=1 quiet ssh  systemd.show_status=auto

But when switching to suspend mode or power down something seems to be wrong since the seriell log shows the following error message:

customer pwrkeys for IR is NULL, use defaults!

but it also shows, that the IR receiver is operational and receiving the correct wakeup code

customer pwrkeys for IR is 0xbf40fe01

Do you have any idea was going wrong here ? If needed you will find the 3 complete logs as attachments.

Thx in advance for any hint, Nanobot

config.ini (6.0 KB)
dmesg.txt (72.3 KB)
serial_log.txt (11.0 KB)

I guess it’s not working as here is no hc4 included:

You can try to add this in autostart.sh:
echo 1 > /sys/class/bl30_manager/setup_bl30
Not sure if this path is correct. And then test if the dmesg include messages about bl30 and test if wake up is now working.

Hi,

the command

echo 1 > /sys/class/bl301_manager/setup_bl301

indeed does the trick. After issuing this command from ssh, the serial log shows:

pwr_key=bf40fe01
usr_ir_proto = 00000000
pwr_key_mask = ffffffff
system power = 00000000

The message

customer pwrkeys for IR is NULL, use defaults!

still appears, but the system is waking up from both suspend and power down state when receiving the code 0xbf40fe01.

So I thank you again for your help to get my HC4 up and running.

Now I will tackle the next task:

The devicetree in the CoreElec image for the Odroid HC4 is incorrect / incomplete regarding the possible speed of the µSD card reader.

It limits the speed to 25MByte/s, but the reader of this device is capable of running up to UHS-I mode SDR104. I am using the dtb file from the Ubuntu image released directly by Hardkernel. With this image, the reader actually runs at the fastest possible speed, so I will try to apply the necessary changes from the Ubuntu devicetree.

But if I need help or a tip for this, I will open a new thread.

C.U. Nanobot

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.