Odroid-N2 Wake Button

Hello,

I’m a new N2 user. I have CE setup and working fine. I have my IR remote working with the wake button feature. But I’d also like to have a case style power/wake button.

I’ve followed the Odroid wiki for the N2 wake button feature, connected to the GPIO pins. I added the env settings to the boot.ini file, as per the wiki, but no luck.

I was hoping someone here could share if they managed to get the GPIO wake button to work with CE. Or is this wake button feature currently not available with CE, and it’s still on the to-do list?

Thank you.

You can follow the instructions here:
https://wiki.odroid.com/odroid-n2/application_note/gpio/gpio_key_wakeup
I tried and it works.

@Pelican I think we should change boot.ini and add an option to config.ini. This is missing in ours.

I don’t have a button but good that it’s working for you.

We talked about this a few weeks ago in slack… :slight_smile:

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.