[solved] Odroid N2 power up behavior?

Dear MoojMidge,

You can adapt the script to your needs (remove echoes as I used them only for debug), also be aware that if you have problems with your script and setup, you will have to edit this script out of the box as otherwise the box will shutdown itself before you can access and modify autostart.sh with SSH.
Use it as base for your needs but be aware to what your are doing.
Also this script maybe needs to be modified in the future with new CE versions or Kernel…
Let me know if I can be of any help.

Best Regards.

Autostart.sh:
CURSCREENWIDTH=cat /sys/class/display/vinfo | grep screen_real_width | awk '{print $2}'
echo “Current Screen Real Width is $CURSCREENWIDTH”
if [ “$CURSCREENWIDTH” = “0” ]; then
echo “No Real Screen connected, will poweroff now!”
sleep 5
poweroff
else
echo “Real Screen Size detected, continue booting…”
fi

Thanks John.

Unfortunately that approach has never worked reliably for me.

When checking vinfo, screen_real_width never gets set to 0. When the TV is in standby or on, the real dimensions are always reported as 160 x 90. When the TV is off, or the HDMI cable is unplugged, the real dimensions are reported as 16 x 9.

Haven’t yet been able to find a way to detect this properly, that works for my N2. Not sure what would be effecting the information reported in vinfo.

The only thing that semi-works is checking /sys/class/amhdmitx/amhdmitx0/hpd_state, it toggles from 1 to 0, then back to 1, when the TV turns off/on for a short period of time.

Dear MoojMidge,

I have more luck than you on this because when devices are turned off, the real_width allows me to detect power state indirectly but in your case this not an option.
In an other system with a similar problem as yours, the real_width was as yours but I was able to detect the situation with resolution set at 640x480 when A/V Receiver + TV are turned off on boot, so in this case I was able to detect this resolution and poweroff device.

Have a nice day, Best Regards.

I put mine in full shutdown with wol disabled since I don’t use my N2 all that much and I actually have a reason I want the ethernet port inactive when I’m not using it. Though if I had a reason to leave my CE box on full time (like running a TVH server) I wouldn’t have a real problem with it.

I do have less trouble doing a full shutdown and startup. When resuming out of suspend I get login issues with my Netflix add-on so my options are either fully on or fully off.

It’s a bit of a nuisance that my N2 always powers up upon application of power, but I rarely pull the power plug and it’s really not a big deal anyway. I’m not going to sweat it if the box turns itself on after a power failure. I can’t rely on CEC since I have a TV that is rather old and is not very CEC friendly. The TV just confuses the hell out of my new mid-range AVR. So CEC is disabled everywhere. That will get resolved when I get a new TV, hopefully sooner than later.

In terms of power consumption, my entertainment center is probably pulling more wattage with everything off than the N2 draws when it’s on. These SBCs are really power friendly devices. I guess people can get picky about pulling a few watts with devices in standby, but I leave lights on all the time that draw more power. I’m just not going to worry about power consumption that small. It’s sure a lot better than a couple decades ago where even lights drew hundreds of Watts.

1 Like