Odroid-N2 Wake Button

We did? Let’s talk again then lol.

Hi!
As I received my buttons and stuff today … how can this be made possible within CE?
Any ideas/suggestions?
THANKS!!!

It requires changes to boot.ini and config.ini. @Pelican will add it to our codebase.

Thanks for the reply. That is the wiki that I was following.

My error was that you have to make sure you know where to edit “boot.ini” and place the env var and update the bootargs. I placed it in a hurry to high up in the file and changes were over written. So you can’t really follow the wiki and simply add the suggested lines without studying and understanding how the boot.ini file works.

I think it would ideal if CE already had the changes to the “boot.ini”, so all someone has to do is wire up the button. I can’t see any harm done by the edits already being in place. I know when I purchased the Odroid-H2, all I had to do was wire in a button to the GPIO and it worked. I know it isn’t set up the same way, but the end result would be the same, all someone has to do is add the button.

For anyone else fumbling around with having to edit the boot.ini to add the wake/power button, here are my notes I made for myself if I have to do it again, to save me the time and hassle.

Wake/Power Button

Hook up a momentary switch with LED to the 40 pin GPIO header:
LED + > Pin 1 (3.3V)
LED - > Pin 6 (Gnd)
Switch > Pin 9 (Gnd)
Switch > Pin 11 (GPIO#479)

Use one of the two methods of editing the files in the boot partition.
Either make the card writable via SSH, or removing the card and editing the boot FAT partition in another computer.

Method #1:
Edit /flash/boot.ini

Method #2
Edit /boot.ini

Add Line 23:
setenv gpiopower “479”

Edit Line 40:
setenv bootargs “${initargs} ${displayopt} ${coreelec}”
Change to:
setenv bootargs “${initargs} ${displayopt} ${coreelec} gpiopower=${gpiopower}”

Sorry I thought you haven’t seen the wiki.
I’ve made a commit so from the next build you don’t need anything but edit your config.ini with the desired gpio number. The default value is 476 (pin 16, GPIOX_0) because it is a simple gpio pin without alternate function and it has a GND neighbour so with a two pin connector you can wire your button to it.

that’s neat :slight_smile:
When modifying boot.ini it already works; with your change I don’t have to “fear” the updates :wink:

Only missing thing (for me - and that is really minor) would then be the Power-LED flashing like heartbeat …

We can add this dtb changes. Either add it by default or add an additional dtb.

Would it hurt to add it by default, instead of having 2 dtb? Less confusing in the end…
I also plan to add such a button, just need to find a small one :slight_smile:

If it doesn’t hurt non button users sure

that would be great :slight_smile:

It is in the current nightly

wow … will try it out asap :slight_smile:

power on/off is working now yeah!!
LED isn’t imlpemented yet (I suppose it’s in the upcoming nightly) …

Red LED cannot be software manipulated.

Ahh sure the dtb changes are not in there.

@Pelican

That works well. Thanks very much.

With the new boot-fix (https://test.coreelec.org/ray/CoreELEC-Amlogic-ng.arm-9.0-devel-1559544003.tar), the power button isn’t working anymore.
I hope, that the power-button feature was not the reason for the “no-boot” problem!
Anyways: to boot ot not to boot => bootable device trumps powerbutton :slight_smile:

Maybe that change wasn’t in there. Wait for the next nightly. The fix should be there.

ok, great!!

do you see any way how I could use this (Power button LED acting like the blue LED) within CE for the N2 (another tree…)?