Wake from suspend, AM6B+

Just received/setup the AM6B+, following the guide:

Did the eMMC-install (CoreELEC-Amlogic-ng.arm-21.2-Omega_nightly_20250205-Generic), and changed to HS400. Managed to get the included (UR-01?) remote to work. Also managed to get my Logitech Harmony to work (MCE).
I can power-off/suspend with the MCE and with the UR-01 (red button), but none of them will power-on/resume. Works with button on the box though.

Have been searching, and it seems it might not be able to power-on/resume using MCE? But should be possible with the UR-01? Am I doing something wrong?

If anyone knows how to fix this, it would be great! Having it running 24/7 seems less than ideal, and having to use the button on the box is an inconvenience.

Found this thread:

But it does not seem to make any difference for me, still no wake-up!
Specifically ran this script: Alternative suspend option for IR wakeup, when bl301 tool not possible - #21 by YadaYada

I can however see that it throws some errors:

○ systemd-suspend.service - System Suspend
     Loaded: loaded (/storage/.config/system.d/systemd-suspend.service; static)
     Active: inactive (dead)

Feb 07 12:06:16 Ugoos-media systemd[1]: /storage/.config/system.d/systemd-suspend.service:12: Unbalanced quoting, ignoring: "/bin/sh -c "     systemctl mask suspend.target;"
Feb 07 12:06:16 Ugoos-media systemd[1]: systemd-suspend.service: Unit configuration has fatal error, unit will not be started.
Feb 07 12:06:41 Ugoos-media systemd[1]: /storage/.config/system.d/systemd-suspend.service:12: Unbalanced quoting, ignoring: "/bin/sh -c "     systemctl mask suspend.target;"
Feb 07 12:06:41 Ugoos-media systemd[1]: systemd-suspend.service: Unit configuration has fatal error, unit will not be started.
Feb 07 12:07:44 Ugoos-media systemd[1]: Starting systemd-suspend.service...
Feb 07 12:07:44 Ugoos-media systemctl[4490]: Created symlink /storage/.config/system.d/suspend.target → /dev/null.
Feb 07 12:09:11 Ugoos-media sh[4587]: Can't open /dev/amremote .
Feb 07 12:09:12 Ugoos-media systemctl[4489]: Removed "/storage/.config/system.d/suspend.target".
Feb 07 12:09:12 Ugoos-media systemd[1]: systemd-suspend.service: Deactivated successfully.
Feb 07 12:09:12 Ugoos-media systemd[1]: Finished systemd-suspend.service.

So I ran the command to detect HW at wakeup:

Ugoos-media:~ # find /sys -name wakeup -exec grep -H . {} \; | paste
https://paste.coreelec.org/SquareChest

Anyone got this working using IR and the MCE-remote?

The error indicates there’s a problem with the formatting. Use this as a reference example:

[Unit]
Description=System Suspend

[Service]
Type=oneshot
ExecStart=/bin/sh -c "\
    systemctl mask suspend.target; \
    \
    # Disable anything that might wake from suspend early \
    # echo disabled > /sys/devices/platform/bt-dev/power/wakeup \
    # echo disabled > /sys/devices/platform/ff80023c.aocec/power/wakeup \
    echo disabled > /sys/devices/platform/rtc/power/wakeup; \
    echo disabled > /sys/devices/platform/rtc/input/input1/power/wakeup; \
    echo disabled > /sys/devices/platform/ff3f0000.ethernet/power/wakeup; \
    \
    # Turn off TV \
    printf '\x20\x36' > /dev/aocec; \
    \
    # Pause Kodi \
    pkill -STOP kodi.bin; \
    \
    # Suspend-to-idle \
    echo freeze > /sys/power/state; \
    \
    # Wakeup \
    # Turn on TV \
    printf '\x20\x04' > /dev/aocec & \
    \
    # Reset meson_remote \
    modprobe -r meson_remote && modprobe meson_remote; \
    remotecfg /storage/.config/remote.conf; \
    \
    # Unpause Kodi \
    pkill -CONT kodi.bin; \
    \
    systemctl unmask suspend.target; \
    "

Specifically pay attention to the script following ExecStart=/bin/sh -c. It starts with a quote " and then even line ends with a backslash . Make sure that each line, even empty lines ends with a backslash, and that there is a close quote at the very end of the script.

The backslashes are line breaks to make the script more readable.

If you still get an error after that, post your suspend service file

You shouldn’t need to do anything with script or bl301 injection - mine wakes from suspend via a Harmony fine.

If you’re using a Harmony, you don’t want to bother with step 7 in that guide - i.e. you don’t need the remote.conf

Here is the daemon status and the service file.
Still does not work.
Do I need to run the “Inject BL301 Blob” to get this working? Searches tell me that comes with the risk it might brick the device, so to be prepared to perform full restore…

○ systemd-suspend.service - System Suspend
     Loaded: loaded (/storage/.config/system.d/systemd-suspend.service; static)
     Active: inactive (dead)

Feb 09 12:26:35 Ugoos-media sh[4361]: /bin/sh: line 1: printf: write error: Operation not permitted
Feb 09 12:26:36 Ugoos-media systemd[1]: systemd-suspend.service: Deactivated successfully.
Feb 09 12:26:36 Ugoos-media systemd[1]: Finished systemd-suspend.service.
Feb 09 12:26:51 Ugoos-media systemd[1]: Starting systemd-suspend.service...
Feb 09 12:26:51 Ugoos-media systemctl[4448]: Created symlink /storage/.config/system.d/suspend.target → /dev/null.
Feb 09 12:26:51 Ugoos-media sh[4447]: /bin/sh: line 1: printf: write error: Operation not permitted
Feb 09 12:27:46 Ugoos-media sh[4514]: Can't open /dev/amremote .
Feb 09 12:27:46 Ugoos-media systemctl[4447]: Removed "/storage/.config/system.d/suspend.target".
Feb 09 12:27:51 Ugoos-media systemd[1]: systemd-suspend.service: Deactivated successfully.
Feb 09 12:27:51 Ugoos-media systemd[1]: Finished systemd-suspend.service.

~
~
~
~
~
~
~
~
~
Ugoos-media:~/.config/system.d # cat systemd-suspend.service
[Unit]
Description=System Suspend

[Service]
Type=oneshot
ExecStart=/bin/sh -c "\
    systemctl mask suspend.target; \
    \
    # Disable anything that might wake from suspend early \
    # echo disabled > /sys/devices/platform/bt-dev/power/wakeup \
    # echo disabled > /sys/devices/platform/ff80023c.aocec/power/wakeup \
    echo disabled > /sys/devices/platform/rtc/power/wakeup; \
    echo disabled > /sys/devices/platform/rtc/input/input1/power/wakeup; \
    echo disabled > /sys/devices/platform/ff3f0000.ethernet/power/wakeup; \
    \
    # Turn off TV \
    printf '\x20\x36' > /dev/aocec; \
    \
    # Pause Kodi \
    pkill -STOP kodi.bin; \
    \
    # Suspend-to-idle \
    echo freeze > /sys/power/state; \
    \
    # Wakeup \
    # Turn on TV \
    printf '\x20\x04' > /dev/aocec & \
    \
    # Reset meson_remote \
    modprobe -r meson_remote && modprobe meson_remote; \
    remotecfg /storage/.config/remote.conf; \
    \
    # Unpause Kodi \
    pkill -CONT kodi.bin; \
    \
    systemctl unmask suspend.target; \
    "
Ugoos-media:~/.config/system.d #
Broadcast message from root@Ugoos-media (Sun 2025-02-09 12:00:14 CST):

The system will suspend now!

Have not run the “Inject BL301 Blob” since searches tell me: “Some firmware updates for the Ugoos AM6b+ have included encryption on the bootloader, making BL301 injection impossible on those versions. For instance, firmware versions like 0.3.9 and later have this issue, as mentioned in discussions on forums like CoreELEC and Ugoos’s official communications.”

Any changes needed in CoreELEC -Hardware page? The only one I changed was the “eMMC speed Mode” which was changed to “HS200,HS400”.

For the “step 7”, I initially did add it, but the Harmony MCE IR would not work at all, as soon as I removed it, everything except for wake-up seems to work fine from IR.

What MCE device do you have on your harmony?
I have tried these 2:
Microsoft MCE-1039
Asrock ION 330HT

The Asrock one since searches tell me thart one can work better for some finicky devices.

The bl301 injection tool isn’t needed or used for the suspend service script. Like you said, the AM6+ bootloader has been encrypted for quite some time now, that tool can’t be used.

Even though IR wake doesn’t work for the AM6+, CEC wake still does. I think it’s common for AM6+ owners to rely on CEC wakeup instead. You may even be able to program the power button on your remote to power your TV on/off. Then setup CE to suspend when TV power is off, and it will wake when you power the TV on (via CEC).

Regarding the suspend service script, is the AM6+ going to sleep and not waking, or is it not going to sleep? Waking from suspend requires using a remote.conf (amremote driver) file, and assigning 116 (power) to one of the remote buttons. The shutdown function should also be changed to suspend if you want to use the same power button to also suspend CE
Settings > System > Power saving > Shutdown function > Suspend

IR power off and resume, via a Harmony, definitely works for the AM6B+ here, multiple times every day…with a completely vanilla CE 21.2 install. Before I bought one, I asked about Harmony and wake up over in the Kodi forums and others reported it works fine for them too. (I would not have bought it otherwise as I find CEC to be far too unreliable!).

I use ‘Microsoft Media Extender’ as the device in MyHarmony. As a first step, I did boot the Ugoos into Android, and: Device Settings → Power → Disable Auto Power On (to stop it auto booting when first plugged in, so the power switch actually behaves much like a real power switch…).

A while ago I wrote up my Harmony Remote set up here -

That includes the appropriate codes for wake-up etc. in config.ini that I used with Odroid N2/+ machines - however I did not need to do this on the Ugoos - the only change to the vanilla config.ini I have is hdmi_cec='0' actually.

For CEC and the Harmony, it is just too flaky for everyday use, you never know what is on or off!
With kodi set to suspend or shutdown in power ssaving, it does suspend or power off when asked to via IR and Harmony, has worked reliable. It is the wake or power-on that is not working for me.

Will try the trix from bossanova808. Appreciate your suggestions though! Thanks!

Ok, tried to follow your guide!

Removed the “systemd-suspend.service” from “/storage/.config/system.d”.

Boot the Ugoos AM6B+ into Android and in “Device Settings” > “Power” > “Disable Auto Power On”.
Expected behavior of not powering on when plugging in verified.

Added the “hdmi_cec=‘0’” to the “HDMI CEC OSD Name” section:

# HDMI CEC OSD Name
#   Set by CoreELEC Settings
#
cec_osd_name='CoreELEC'
hdmi_cec='0'

For the “make sure ALL CEC stuff is turned off/disabled in Kodi and CoreElec settings”, I went to “Settings” > “System” > “Input” > “Peripherals” > “Status: Disabled”.
Any other places I missed?

Setup my Harmony with the device “Microsoft Media Centre Extender”, and changed settings for the device to: “repeats and inter-device delays to 0”.

I did NOT add the “remote-repeat.rules”, since his is the Ugoos.

Added the “keymap.xml” file to the “/storage/.kodi/userdata/keymaps” folder.

Changed “Power Saving” in KODI to ‘Shutdown’, not ‘suspend’.

Rebooted, and still does not power on!
Poweroff works from Harmony.

Very, very odd.

In the MyHarmony software, what command do you have set for the power on - I am not at home right now, but I think it should be ‘PowerToggle’ from memory.

(Also, what Harmony are you actually using? I use 650s)

Yup, it is “PowerToggle”, but set to 0s. seems to be the default, did not change. Also, it powers off just fine everytime via IR.

Yeah beginning to think you must have a hardware issue - the included remote should also definitely work. If neither will, something is definitely not normal.

I have two more AM6B+ machines to set up in a week or two when I have some time for family…I am not crossing my fingers about those!!

config.ini edit from referenced link:

hdmi_cec='0'
cec_func_config='0'
remotewakeup='0x800f040c'
remotewakeupmask='0xffff7fff'
decode_type='0x5'

remotewakeup='0x800f040c' relies on the bl301 injection tool to be applied. Only possible if the bootloader is not encrypted.

At one point the Am6+ did ship with an unencrypted bootloader, but chances are low of finding one of those now.

1 Like

Yeah, but it is only the first part of that (hdmi_cec=‘0’) which is used, so should still be OK.
Will see if I can get time to do a “factory reset/Re-image” later this week, and try again.
Thanks for input so far!

Ok this is what I did:
Use the OTA firmware upgrade method:
Download the firmware OTA update package (currently 0.4.1) (full OTA and in zip format) and place it on a USB flash drive (FAT32 and MBR needed).
https://ugoos.com/downloads

Insert the USB drive into the AM6B+, hold the recovery button and insert the power-plug. Hold recovery button for 5-10 seconds.
In the recovery menu, choose “update from ext” and select the update zip file from the USB drive.
Remember to back up your data before re-flashing, as this process will erase all user data and settings on the device.

After recovery is done, go through checking for updates and reboot cycle until it is on latest version (currently 0.5.4).
Here I verified that the included remote now works for powering both on and off!
It did not work for power-on, only power-off previously!

I also made sure while booted into Android, that Auto Power On is disabled: “Device Settings” > “Power” > “Disable Auto Power On”.

Now follow installation guide as usual:

But skip the remote.conf, since we will use IR with MCE.

After booted into CoreELEC, enable SSH and run the command “ceemmc -x”.

Reboot without external USB inserted.

Setup Harmony Remote:

In Harmony for the device, I use ‘Microsoft Media Extender’.
It is setup with changed settings for the device to “repeats" and “inter-device delays” to 0 for both.

Added the “hdmi_cec=‘0’” to the “HDMI CEC OSD Name” section:

# mount -o remount,rw /flash
# vi /flash/config.ini

Added the keymap.xml file to /storage/.kodi/userdata/keymaps folder.

For the “make sure ALL CEC stuff is turned off/disabled in Kodi and CoreElec settings” step, in KODI I went to “Settings” > “System” > “Input” > “Peripherals” > “Status: Disabled”.
Disabled all items to get it to state Disabled.

Rebooted into Android.

In Ugoos Android, I went to “Settings” > “Device Preferences” > “Display” > “HDMI CEC” > “CEC Control” to Off.
Then restarted back to KODI.

Power-off works, but not Power-on.

Implemented workaround, in Android there is an option to add a secondary IR-code to power-on (Needs to be NEC compliant IR code).
“Settings” > “Device Preferences” > “Power” > “Additional IR power-on button”. Here I added power-on from an HDMI-switch I no longer use (Amazon.com).
I then configured Harmony to have 2 different buttons for the ‘Microsoft Media Extender’ Device. One is the current default for Power-off, and then the new code learned from the HDMI-switch remote for the Power-on.
Now both power-off and Power-on works with the Harmony MCE remote! Suspend also work.

Then configured from recommendations, with my own tweaks:

Add plugins.

Done!

That seems, in all, awfully complicated really, but glad it is now basically working for you.

Did you buy it a long time ago? I bought mine around November 24 and it came with 0.5.4n installed, it seems. I’ve never connected the Ugoos side of things to Wi-Fi or done any updates, basically only that adjustment to the power switch and that’s it. At all times both MCE and Ugoos have worked to power off/resume the system, so I still think it’s definitely odd that you needed all this…

Yeah, not sure why all this was needed. Bought it Jan 27th this year from the Ugoos store.
Not sure if it came with 0.5.4n or just 0.5.4, however, it is 0.5.4 now, without the “n”.
Never used Wifi on it, only wired.

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