How to add a power button to your N2

Post Reply
User avatar
odroid
Site Admin
Posts: 33582
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 485 times
Been thanked: 497 times
Contact:

How to add a power button to your N2

Unread post by odroid » Mon Feb 25, 2019 5:33 pm

You can add a power button with a few wires soldering.
We've written a guide on this WiKi page.
https://wiki.odroid.com/odroid-n2/appli ... key_wakeup

The blue LED in the button flashes like heartbeat action, if you edit the device-tree file.
You may like this GIF animated image. ;)
Image
These users thanked the author odroid for the post (total 2):
istanbulls (Sun May 19, 2019 7:02 am) • Kernel (Wed May 29, 2019 5:42 am)

User avatar
rooted
Posts: 7330
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 493 times
Been thanked: 136 times
Contact:

Re: How to add a power button to your N2

Unread post by rooted » Mon Feb 25, 2019 6:41 pm

Very nice, thanks for the how-to.

User avatar
mad_ady
Posts: 7529
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 381 times
Been thanked: 293 times
Contact:

Re: How to add a power button to your N2

Unread post by mad_ady » Mon Feb 25, 2019 8:15 pm

Nice case adjustment. You can leave an opening and it could be used for serial.
Would the power button sold with the h2 work as well?

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Mon Feb 25, 2019 9:44 pm

mad_ady wrote:
Mon Feb 25, 2019 8:15 pm
Nice case adjustment. You can leave an opening and it could be used for serial.
Would the power button sold with the h2 work as well?
Technically it is, the problem is the size. In terms of hardware, it would work.

hominoid
Posts: 350
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1, N2
Location: Lake Superior Basin, USA
Has thanked: 19 times
Been thanked: 44 times
Contact:

Re: How to add a power button to your N2

Unread post by hominoid » Mon Feb 25, 2019 11:24 pm

Thanks, much appreciated!

User avatar
mad_ady
Posts: 7529
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 381 times
Been thanked: 293 times
Contact:

Re: How to add a power button to your N2

Unread post by mad_ady » Tue Feb 26, 2019 12:45 am

Out of curiosity, how did you cut through the case evenly?

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Tue Feb 26, 2019 4:57 am

mad_ady wrote:
Tue Feb 26, 2019 12:45 am
Out of curiosity, how did you cut through the case evenly?
Simple, cut the surface with a drill and a cutter to make a hole and file until you have an 8 x 8.5mm square.

wallyz21
Posts: 116
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 13 times
Contact:

Re: How to add a power button to your N2

Unread post by wallyz21 » Thu Apr 11, 2019 12:14 pm

Momentary or latched switch?

And the button diameter of the specific switch that you used is what, please?

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Thu Apr 11, 2019 12:39 pm

wallyz21 wrote:
Thu Apr 11, 2019 12:14 pm
Momentary or latched switch?

And the button diameter of the specific switch that you used is what, please?
Momentary if you follow up the Wiki. Latched switch if you like to control the power at DC jack.
The hole for the switch in the Wiki is about 6-7mm.
https://www.aliexpress.com/item/Led-Lig ... 52543.html

sanangel
Posts: 4
Joined: Wed Apr 24, 2019 7:53 pm
languages_spoken: english, spanish
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by sanangel » Sun Apr 28, 2019 2:20 am

@odroide Thanks for the tutorial

istanbulls
Posts: 162
Joined: Tue May 14, 2019 10:18 pm
languages_spoken: Turkish
ODROIDs: ODROID N2
Has thanked: 59 times
Been thanked: 8 times
Contact:

Re: How to add a power button to your N2

Unread post by istanbulls » Sun May 19, 2019 7:01 am

Hi,
How to do Simple On/Off Odroid N2 Power button/switch.
I'm a beginner, can you teach it simply?
The led heartbeat do not want to led do not want, just power button.

Thank
Edit: I put a button on 9 and 11 GPIO pins, it works.

User avatar
mad_ady
Posts: 7529
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 381 times
Been thanked: 293 times
Contact:

Re: How to add a power button to your N2

Unread post by mad_ady » Sun May 19, 2019 1:35 pm

For heartbeat led try:

Code: Select all

echo none > /sys/class/leds/blue\:heartbeat/trigger

pillemats
Posts: 8
Joined: Mon Apr 03, 2017 2:19 am
languages_spoken: german, english
ODROIDs: xu4 + cloudshell
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by pillemats » Sat Jun 15, 2019 3:39 am

Hey

How does it works ?

Only Plug the button cables to gpio and it works ?
I dont Unterstand the tut because my English is Not the best.

I use my n2 with Batocera Linux for emulation!

Should i put the Button to gpio an thats it ?

Thx

pillemats
Posts: 8
Joined: Mon Apr 03, 2017 2:19 am
languages_spoken: german, english
ODROIDs: xu4 + cloudshell
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by pillemats » Sat Jun 15, 2019 4:00 am

kardanadm wrote:
Sun May 19, 2019 7:01 am
Hi,
How to do Simple On/Off Odroid N2 Power button/switch.
I'm a beginner, can you teach it simply?
The led heartbeat do not want to led do not want, just power button.

Thank
Edit: I put a button on 9 and 11 GPIO pins, it works.
Which Switch did you use ?

In my case it wont works

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Sat Jun 15, 2019 5:30 pm

pillemats wrote:
Sat Jun 15, 2019 4:00 am
kardanadm wrote:
Sun May 19, 2019 7:01 am
Hi,
How to do Simple On/Off Odroid N2 Power button/switch.
I'm a beginner, can you teach it simply?
The led heartbeat do not want to led do not want, just power button.

Thank
Edit: I put a button on 9 and 11 GPIO pins, it works.
Which Switch did you use ?

In my case it wont works
How did you connect the switch? And what's the switch you use?

pillemats
Posts: 8
Joined: Mon Apr 03, 2017 2:19 am
languages_spoken: german, english
ODROIDs: xu4 + cloudshell
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by pillemats » Sat Jun 15, 2019 7:11 pm

This one for testing on Pin 9 + 11
Attachments
C4667522-5C26-48B4-A13C-75AD702012DD.jpeg
C4667522-5C26-48B4-A13C-75AD702012DD.jpeg (1.3 MiB) Viewed 7506 times

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Sun Jun 16, 2019 4:42 am

@pillemats, the switch would work if you wire properly. Also, please double check your boot.ini.
https://wiki.odroid.com/odroid-n2/appli ... ng_bootini

pillemats
Posts: 8
Joined: Mon Apr 03, 2017 2:19 am
languages_spoken: german, english
ODROIDs: xu4 + cloudshell
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by pillemats » Sun Jun 16, 2019 5:53 am

How do i wired propably?

I think i Need a pic with the connections

Do you have it?

democles
Posts: 1
Joined: Thu Jul 11, 2019 10:33 pm
languages_spoken: english
ODROIDs: N2/U3/ C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by democles » Thu Jul 11, 2019 10:45 pm

Here is a picture with wat jou have to copy and past in the boot.ini file.
Works great :D
I edit it with WEBMIN.

aangepast.jpg
aangepast.jpg (155.76 KiB) Viewed 6884 times

joy
Posts: 1137
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 80 times
Been thanked: 128 times
Contact:

Re: How to add a power button to your N2

Unread post by joy » Fri Jul 12, 2019 3:03 pm

pillemats wrote:
Sun Jun 16, 2019 5:53 am
How do i wired propably?

I think i Need a pic with the connections

Do you have it?
Do you have a PCB layout and circuit description of your button part?

Please refer to this wiki page for the wire connections.
https://wiki.odroid.com/odroid-n2/appli ... are_set-up
https://wiki.odroid.com/odroid-c2/appli ... are_set-up

superpowter77
Posts: 64
Joined: Mon Sep 09, 2019 9:14 pm
languages_spoken: english,french,spanish
ODROIDs: ODROID-N2 4GB CoreELEC Edition
Has thanked: 5 times
Been thanked: 3 times
Contact:

Re: How to add a power button to your N2

Unread post by superpowter77 » Sun Sep 15, 2019 9:54 pm

Very nice solution. Alternately, if you just want to play "safe" without getting your hands "dirty", you can just spend $12 USD bucks and get a "Smart Plug Mini WiFi Outlet" just for the Odroid-N2 with an On/Off switch controlled from any Android phone. Also, 100% compatible with Alexa and Google Home where a simply vocal command will suffice.

istanbulls
Posts: 162
Joined: Tue May 14, 2019 10:18 pm
languages_spoken: Turkish
ODROIDs: ODROID N2
Has thanked: 59 times
Been thanked: 8 times
Contact:

Re: How to add a power button to your N2

Unread post by istanbulls » Wed Sep 18, 2019 2:11 am

Boot.ini does not work when you change boot.ini for Ubuntu Mate

setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}" Do not paste this code. Protect your existing code.

Code: Select all

 
setenv gpiopower "479"
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} logo=osd0,loaded ${cec_enable}"
setenv bootargs ${bootargs} gpiopower=${gpiopower}

User avatar
odroid
Site Admin
Posts: 33582
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 485 times
Been thanked: 497 times
Contact:

Re: How to add a power button to your N2

Unread post by odroid » Wed Sep 18, 2019 8:30 am

Sorry for the inconvenience caused.
I've updated the wiki page.
https://wiki.odroid.com/odroid-n2/appli ... ng_bootini
These users thanked the author odroid for the post:
istanbulls (Wed Sep 18, 2019 5:05 pm)

superpowter77
Posts: 64
Joined: Mon Sep 09, 2019 9:14 pm
languages_spoken: english,french,spanish
ODROIDs: ODROID-N2 4GB CoreELEC Edition
Has thanked: 5 times
Been thanked: 3 times
Contact:

Re: How to add a power button to your N2

Unread post by superpowter77 » Wed Sep 18, 2019 10:22 pm

Excellent job. Finally,we have a well written and Visual documented guide to DIY.

vayd3r
Posts: 5
Joined: Tue Nov 26, 2019 1:13 am
languages_spoken: english
ODROIDs: N2, HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by vayd3r » Thu Nov 28, 2019 12:01 am

I'm also trying to get this to work for Batocera linux. I have a momentary switch on pins 9 and 11. However, my kernel bootargs are different so I don't want to just paste in what's in the wiki. Is there a specific parameter on the bootargs line I should be looking for, or add?

Code: Select all

setenv bootargs "label=BATOCERA console=tty3 quiet loglevel=0 consoleblank=0 vt.global_cursor_default=0 hdmimode=${hdmimode} max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}"

### wake stuff
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}
I know the button works because I was using it for GPIO wake on a Raspberry Pi 3.

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Thu Nov 28, 2019 12:29 am

vayd3r wrote:
Thu Nov 28, 2019 12:01 am
I'm also trying to get this to work for Batocera linux. I have a momentary switch on pins 9 and 11. However, my kernel bootargs are different so I don't want to just paste in what's in the wiki. Is there a specific parameter on the bootargs line I should be looking for, or add?

Code: Select all

setenv bootargs "label=BATOCERA console=tty3 quiet loglevel=0 consoleblank=0 vt.global_cursor_default=0 hdmimode=${hdmimode} max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}"

### wake stuff
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}
I know the button works because I was using it for GPIO wake on a Raspberry Pi 3.
I think the last two lines are fair enough to enable GPIO switch, it just adds gpiopower=479 right after disablehpd=${disablehpd} in the command line.

vayd3r
Posts: 5
Joined: Tue Nov 26, 2019 1:13 am
languages_spoken: english
ODROIDs: N2, HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by vayd3r » Thu Nov 28, 2019 2:03 am

Right, that's what I originally thought. But since it wasn't working I figured there must be a necessary kernel parameter also.

So does pressing the button just cut power to the N2 while it's on? And when it's off you hold the button for 2 seconds to wake it? That's what I gathered from the wiki. Really confused as to why this isn't working.

User avatar
tobetter
Posts: 4654
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 87 times
Been thanked: 335 times
Contact:

Re: How to add a power button to your N2

Unread post by tobetter » Thu Nov 28, 2019 2:19 am

vayd3r wrote:
Thu Nov 28, 2019 2:03 am
Right, that's what I originally thought. But since it wasn't working I figured there must be a necessary kernel parameter also.

So does pressing the button just cut power to the N2 while it's on? And when it's off you hold the button for 2 seconds to wake it? That's what I gathered from the wiki. Really confused as to why this isn't working.
I am not sure if the Linux kernel for BATOCERA enables GPIO input driver or not when I had tried to run it last week for some other issue, even it does not give a kernel message or shell prompt. Then I've not looked into yet. Any idea if you can get a shell problem on it?

vayd3r
Posts: 5
Joined: Tue Nov 26, 2019 1:13 am
languages_spoken: english
ODROIDs: N2, HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by vayd3r » Fri Nov 29, 2019 9:46 pm

Yep I can get a shell on Batocera. Should I be seeing something in the kernel ring buffer (dmesg output) when I press the button? For the driver, is the kernel config option you’re talking about CONFIG_GPIO_GENERIC or is there another option that is needed? I can try to see if the kernel config is available through /proc/config.

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Sat Jan 25, 2020 4:06 am

Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

User avatar
cdu13a
Posts: 261
Joined: Tue Jan 20, 2015 3:33 pm
languages_spoken: english
ODROIDs: C1, C2, XU4, HC1, N2
Has thanked: 5 times
Been thanked: 54 times
Contact:

Re: How to add a power button to your N2

Unread post by cdu13a » Sat Jan 25, 2020 9:09 am

Cosmicbase wrote:
Sat Jan 25, 2020 4:06 am
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
For the switch did you set gpiopower=479 in your config.ini file? This is required for the switch to work as a power switch. (479 = pin 11 for other pin numbers see https://wiki.odroid.com/odroid-n2/hardw ... connectors)

As for the LED, what did you intend the LED to indicate? Having it connected between the pin 1 (3.3v) and pin 6 (ground) means that it's will always have power.

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Sat Jan 25, 2020 9:22 am

cdu13a wrote:
Sat Jan 25, 2020 9:09 am
Cosmicbase wrote:
Sat Jan 25, 2020 4:06 am
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
For the switch did you set gpiopower=479 in your config.ini file? This is required for the switch to work as a power switch. (479 = pin 11 for other pin numbers see https://wiki.odroid.com/odroid-n2/hardw ... connectors)

As for the LED, what did you intend the LED to indicate? Having it connected between the pin 1 (3.3v) and pin 6 (ground) means that it's will always have power.
Thank you for your answer.
I don't want the LED to be on all the time. I loved the heartbeat.
The best way to get the LED off is when the N2 is off.

Only this 2 lines in config.ini?
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}

For heartbeat Do I seem to have to use #6 and #8?
What exactly do I have to write in .dtsi?
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

User avatar
cdu13a
Posts: 261
Joined: Tue Jan 20, 2015 3:33 pm
languages_spoken: english
ODROIDs: C1, C2, XU4, HC1, N2
Has thanked: 5 times
Been thanked: 54 times
Contact:

Re: How to add a power button to your N2

Unread post by cdu13a » Sat Jan 25, 2020 10:34 am

Cosmicbase wrote:
Sat Jan 25, 2020 9:22 am
cdu13a wrote:
Sat Jan 25, 2020 9:09 am
Cosmicbase wrote:
Sat Jan 25, 2020 4:06 am
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
For the switch did you set gpiopower=479 in your config.ini file? This is required for the switch to work as a power switch. (479 = pin 11 for other pin numbers see https://wiki.odroid.com/odroid-n2/hardw ... connectors)

As for the LED, what did you intend the LED to indicate? Having it connected between the pin 1 (3.3v) and pin 6 (ground) means that it's will always have power.
Thank you for your answer.
I don't want the LED to be on all the time. I loved the heartbeat.
The best way to get the LED off is when the N2 is off.

Only this 2 lines in config.ini?
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}

For heartbeat Do I seem to have to use #6 and #8?
What exactly do I have to write in .dtsi?
The setenv lines are for if you are changing the boot.ini file if you are using ubuntu or another similar os.

If you are using CoreELEC you just need to add just the the following line to the /flash/config.ini file.

Code: Select all

gpiopower=479
Also I should note that the /flash partition is mounted read only. So you will have to remount it to make it writable with the following command before you can edit the /flash/config.ini file

Code: Select all

mount -o remount,rw /flash

User avatar
cdu13a
Posts: 261
Joined: Tue Jan 20, 2015 3:33 pm
languages_spoken: english
ODROIDs: C1, C2, XU4, HC1, N2
Has thanked: 5 times
Been thanked: 54 times
Contact:

Re: How to add a power button to your N2

Unread post by cdu13a » Sat Jan 25, 2020 11:14 am

Cosmicbase wrote:
Sat Jan 25, 2020 9:22 am

For heartbeat Do I seem to have to use #6 and #8?
What exactly do I have to write in .dtsi?
Yes pins #6(GND) and #8 (GPIOX.12) if you want to be able to control the LED.

However the following instructions on the wiki has a few problems.
Odroid Wiki - https://wiki.odroid.com/odroid-n2/application_note/gpio/gpio_key_wakeup#heartbeat_led_action_on_the_power_button_led wrote:
For LED heartbeat action, you need to modify this dtsi file, build dtb image again and replace meson64_odroidn2.dtb in /media/boot.
There are a few problems here if you want this to work with CoreELEC.
1. You would need to build a dtb file using the CoreELEC kernel source not the hardkernel source. Because CoreELEC uses a different kernel that is more optimized for media playback then the one that is used by hardkernel.
2. CoreELEC has a different name and location for it's dtb files.
3. CoreELEC updates it's dtb files when you update CoreELEC, which would overwrite any custom dtb file that you used.

I can solve the first two for you by making a dtb file with the required changes, and give you instructions on where it needs to be put. Which will get it working for you for now.
As for the last one I can talk with the other CoreELEC developers and see if we can work out a way of handling this type of LED mod better.

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Sat Jan 25, 2020 7:01 pm

OK that would be really great if you could help me with that.
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Sat Jan 25, 2020 11:50 pm

So I don't need to change anything in Boot.ini?
Add "gpiopower = 479" only in config.ini?

setenv gpiopower "479"
setenv bootargs “$ {initargs} $ {displayopt} $ {coreelec} gpiopower = $ {gpiopower}”
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

User avatar
cdu13a
Posts: 261
Joined: Tue Jan 20, 2015 3:33 pm
languages_spoken: english
ODROIDs: C1, C2, XU4, HC1, N2
Has thanked: 5 times
Been thanked: 54 times
Contact:

Re: How to add a power button to your N2

Unread post by cdu13a » Sun Jan 26, 2020 1:25 am

Cosmicbase wrote:
Sat Jan 25, 2020 11:50 pm
So I don't need to change anything in Boot.ini?
Add "gpiopower = 479" only in config.ini?

setenv gpiopower "479"
setenv bootargs “$ {initargs} $ {displayopt} $ {coreelec} gpiopower = $ {gpiopower}”

The part that needs to be in the boot.ini to handle the gpiopower setting is already there on CoreELEC. You just need to add the gpiopower=479 line to the config.ini file so that it knows which gpio pin your switch is attached to.

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Sun Jan 26, 2020 6:14 am

@cdu13a
I've followed your steps and it works.
There are still ways to change the heartbeat.
For example, slower or faster or a soft fade-in and hide.

Thank you very much.
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

mxmilkb
Posts: 61
Joined: Fri Apr 26, 2019 9:28 am
languages_spoken: English
ODROIDs: N2
Has thanked: 20 times
Been thanked: 19 times
Contact:

Re: How to add a power button to your N2

Unread post by mxmilkb » Thu Jan 30, 2020 2:20 pm

I got this, works well for me.
These users thanked the author mxmilkb for the post:
jgmdev (Thu Feb 06, 2020 6:18 am)

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Fri Jan 31, 2020 12:44 am

Hello, is there a way to control the LED in the power button brighter or darker?
I have disabled heartbeat. The power button works very well.
I just want to change the brightness of the LED.
Maybe there is also a smooth soft effect from light to dark ad return?
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

Cosmicbase
Posts: 54
Joined: Tue Nov 26, 2019 2:31 am
languages_spoken: german
ODROIDs: Odroid N2
Has thanked: 7 times
Been thanked: 0
Contact:

Re: How to add a power button to your N2

Unread post by Cosmicbase » Fri Mar 06, 2020 10:51 pm

@cdu13a

Hello I use CoreElec up to date.
Heartbeat is not working.
I tried all but nothing helps.

Do I need to replace a .dtb or anything?
Gruß / Greatings Cosmicbase
Ich bin nicht blöd, auch wenn ich nur so tue! :lol:

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 2 guests