Question about installing power buttons ON/OFF on C2

Moderators: mdrjr, odroid

Question about installing power buttons ON/OFF on C2

Unread postby Soulsavior » Wed May 11, 2016 7:58 am

Hi!
Is there a way to install two power buttons, one for a clean shutdown and one for powering it back, using the GPIO on the Odroid C2?
I've read this topic on the forum concerning the Odroid W:
viewtopic.php?f=105&t=11878&p=139016#p139016
Macemoneta's solution would be for me installing two momentary ON buttons for that, but franckly i'm new to the Odroid world and i don't know how to do that on the C2 (or if it's even possible on the C2). Can someone explain to me in details how to do that (with diagrams if possible as it's simpler for someone like me who english isn't his native tongue...)? Thanks!
I would also like to know how to wire an extra activity LED using the GPIO.
Thanks again, guys! ;)
Soulsavior
 
Posts: 11
Joined: Sun May 01, 2016 1:55 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby odroid » Wed May 11, 2016 11:54 am

Refer this link to implement the shutdown with a button. There is an example script.
http://odroid.com/dokuwiki/doku.php?id=en:odroid-ups3

But, the power-on trigger need a latch circuit or small MCU.
But the locker or slide switch is quite simple. Just add a switch on J4.
http://odroid.com/dokuwiki/doku.php?id= ... arehacking
User avatar
odroid
Site Admin
 
Posts: 28703
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Question about installing power buttons ON/OFF on C2

Unread postby Soulsavior » Tue May 17, 2016 6:34 pm

Hi!
Thanks for the answer. After taking a look at your links, i must say that i don't understand most of that... I finished reading the code in your link for the shutdown, but isn't that to be used with the U3 only? what about Macemoneta's script in my previous link:
Code: Select all
#!/bin/bash
gpio wfi 27 rising
# We fall through when triggered
shutdown -h now


Isn't that more appropriate if i connect my MOM switch to GPIO 27 using this code? I don't know anything about coding, only soldering, so if anybody can write me a script for a clean C2 shutdown, using GPIO and the script in your link, that would be great!

odroid wrote:But, the power-on trigger need a latch circuit or small MCU.
But the locker or slide switch is quite simple. Just add a switch on J4.


I'll use the J4 switch then... Thanks!
And what about the status LED on the GPIO? Can you help me with that or do i have to desolder the actual SMD status Led and solder a wire and my LED? iI would prefer not desoldering it in order to do not void the warranty, and use the GPIO pin instead, for i won't be using it for anything else that that and the OFF switch...

Again many thanks for the help you're providing me with! :D
Soulsavior
 
Posts: 11
Joined: Sun May 01, 2016 1:55 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby odroid » Tue May 17, 2016 6:41 pm

Look into the BAT_OK_GPIO path. You can attach a power-off button on that.

Activity LED should be hard-coded in the Kernel driver.
So you need to build your own kernel.
User avatar
odroid
Site Admin
 
Posts: 28703
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Wed May 18, 2016 4:48 pm

Hi,

i personally would go a slightly other way then @odroid:

I would use one press-button on a GPIO to trigger the clean shutdown and another press-button to re-trigger the PMIC (which is generally what is described in the wiki, but not with a switch, but with a button).
For the activity LED I would try to keep it more simple in the first step -> maybe it is enough to just light up an LED, if the C2 is on? Then you can just hook it up to a GPIO and switch it on by a autostart-script at startup. Then you know that your system booted up, when the LED light up.

This is what I did lately for my Ambilight project: one LED that light up, when my script starts (goes off, when the script ends -> shutdown), one LED that shows Ambilight activity and a button (in my case two buttons, which need to be pressed simultaniousely for tree seconds) to shutdown the system.

All this is really not very difficult and you should really try to program it by yourself. I personally wrote a C program for that (not a shell script), but its up to you.
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby Fotonic » Wed May 18, 2016 11:24 pm

What happens if system is shut down and the power-on switch is still on active state? System restarts immediately?
Fotonic
 
Posts: 17
Joined: Sun May 15, 2016 12:10 am
languages_spoken: english

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Wed May 18, 2016 11:40 pm

Fotonic wrote:What happens if system is shut down and the power-on switch is still on active state? System restarts immediately?

No. Look, it does not matter of you put the PMIC into active state by the onboard-jumper (default) or by a switch. Once shut down, the systems stays shut down until next power cycle.
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby Fotonic » Thu May 19, 2016 12:14 am

Jojo wrote:
Fotonic wrote:What happens if system is shut down and the power-on switch is still on active state? System restarts immediately?

No. Look, it does not matter of you put the PMIC into active state by the onboard-jumper (default) or by a switch. Once shut down, the systems stays shut down until next power cycle.


Ok, I read the datasheet of NCP372, now it's more clear.
So to keep system off J4 needs to be closed, applying an high level at EN pin of NCP372. As J4 opens and EN goes low the NPC372 cuts the power voltage and system is brutally interrupted.
Once the system has been correctly shut down and is still powered on the system stays in shut down mode.

A little microcontroller can do the trick then, magaging power up and shutdown by means of 1 or 2 push buttons:
- First press or power on button -> apply logic high to J4 pin 1 (connected to NCP327 EN pin), turn on a led to indicate power has been applyed to system, can be a bi-color led set on blinking green.

- As OS finishes loading a GPIO pin is set to high, microcontroller reads pin state and knows that the system is up&running so it turns the led to steady green.

- Second press or power off button -> microcontroller sends shutdown signal on a GPIO pin, sets the led to blinking red to indicate shutdwodn in progress

- System goes in shut down state, GPIO pin is reset and microcontroller knows that sequence has been correctly executed, turns led to steady red and sends a logic 0 to J4.


My only concern at this point is how to detect the end of the shutdown, is there a way to set the GPIO pin on the very last moment of the shutdown sequence? In tnat case microcontroller can start a safety timer of 5-10 seconds and then consider the system safetly shutted down. Or are there better ways to implement this detection?
Fotonic
 
Posts: 17
Joined: Sun May 15, 2016 12:10 am
languages_spoken: english

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Thu May 19, 2016 12:42 am

@Fotonic
I think what you describe is mainly done by a device called "mausberry", refere here:
viewtopic.php?f=115&t=15959#p104832

The interesting thing would be, where the microcontroller gets its supply from.

About shutdown detection: I would think that most of the GPIOs are hi-z, when unconfigured/initial state. If this is right, the shutdown detection could work with a simple pull-up resistor. As you said, the ODROID could actively pull the GPIO low to show "Hey, I am on!". If it is shut down, the GPIO will fall back to hi-z state, where it will be pulled high by the resistor, which tells the µC "Oh, ODROID seems to be off now."

[edit 1]
The interesting thing would be, where the microcontroller gets its supply from.

I think I've got it. But it requires additional soldering on the ODROID:
- remove the PMIC-enable pull-down resistor (R11)
- add a button to the enable pin, that pulls the pin low when pressed (power on)
- let the µC be powered by the PMIC, like the rest of the system
- now the µC needs to pull the enable pin low as well (PMIC stays active if button is released)
- if the ODROID reports to the µC that a clean shutdown is finished, the µC releases the enable-pin, which will be pulled high be the resistor and everything will switch off (including µC)

Not very hard to do. But it requires additional components, programming and soldering. I think I will do it :lol: .
[/edit 1]

[edit 2]
Correction: R11 does not need to be removed. Just add another resistor between EN-pin and 5V_in. The threshold for EN is 1,2V
[/edit 2]
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby Fotonic » Thu May 19, 2016 9:13 am

Jojo wrote:@Fotonic
I think what you describe is mainly done by a device called "mausberry", refere here:
viewtopic.php?f=115&t=15959#p104832


LOL, almost. :)

Jojo wrote:The interesting thing would be, where the microcontroller gets its supply from.


For me it would be preferred to have uC Always powered. Power consumption should be enough low to not worry about.
If a total power off is desired I prefer to usially add a 2 way switch at the beginning of all the circuitry.

Jojo wrote:About shutdown detection: I would think that most of the GPIOs are hi-z, when unconfigured/initial state. If this is right, the shutdown detection could work with a simple pull-up resistor. As you said, the ODROID could actively pull the GPIO low to show "Hey, I am on!". If it is shut down, the GPIO will fall back to hi-z state, where it will be pulled high by the resistor, which tells the µC "Oh, ODROID seems to be off now."


This is a good idea, but since the confirm on system shutdown would also reset the state on J4 it must be 100% sure that GPIO hasn't got transition states during normal operation.
I'll have a look at the schematics of C2 and the dedicated UPS tomorrow to see if there is some source of inspiration.
Fotonic
 
Posts: 17
Joined: Sun May 15, 2016 12:10 am
languages_spoken: english

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Thu May 19, 2016 4:18 pm

Fotonic wrote:
Jojo wrote:About shutdown detection: I would think that most of the GPIOs are hi-z, when unconfigured/initial state. If this is right, the shutdown detection could work with a simple pull-up resistor. As you said, the ODROID could actively pull the GPIO low to show "Hey, I am on!". If it is shut down, the GPIO will fall back to hi-z state, where it will be pulled high by the resistor, which tells the µC "Oh, ODROID seems to be off now."


This is a good idea, but since the confirm on system shutdown would also reset the state on J4 it must be 100% sure that GPIO hasn't got transition states during normal operation.
I'll have a look at the schematics of C2 and the dedicated UPS tomorrow to see if there is some source of inspiration.


I don't think this will be a problem. On none of my SBCs I have ever observed "sporadic" transitions during normal operation on a GPIO. In addition, even if there were sporadic transistions, it is up to the programmer of the µC to do some kind of verification, for example by measuring the duration of the current GPIO state. So faulty edges (if there were any) could filtered out easily.
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby Fotonic » Fri May 20, 2016 12:37 am

Jojo wrote:I don't think this will be a problem. On none of my SBCs I have ever observed "sporadic" transitions during normal operation on a GPIO. In addition, even if there were sporadic transistions, it is up to the programmer of the µC to do some kind of verification, for example by measuring the duration of the current GPIO state. So faulty edges (if there were any) could filtered out easily.


Exactly, like a sort of debounce with timings longer than usual. GPIO high for more that 1 second? --> Powerdown. :)

And we can add another function, to hold the button for some seconds to force the powerdown if for example the system gets stuck and cannot complete normal safe shutdown.
Fotonic
 
Posts: 17
Joined: Sun May 15, 2016 12:10 am
languages_spoken: english

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Fri May 20, 2016 4:14 pm

@Soulsavior
Whats the status? Are you stuck somewhere?
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby Soulsavior » Fri May 20, 2016 10:56 pm

Hi Jojo! First, thanks for asking about the status...
I didn't had much time to really get into it recently, mostly because of personnal problems. But i did take a look at what you all says, and i must admit that, while it seem all simple and easy for you, it definitively is not for me, knowing that english is not my native tongue...

As for the Led problem:
Jojo wrote:For the activity LED I would try to keep it more simple in the first step -> maybe it is enough to just light up an LED, if the C2 is on? Then you can just hook it up to a GPIO and switch it on by a autostart-script at startup. Then you know that your system booted up, when the LED light up.


Yup, that's what i would like to do, can i ask you to write me this autostart-script at startup? Wiring the LED to the GPIO won't be a problem, but can you tell me which resistor i should install there? I don't know the output of the C2 GPIO...

And as for the power buttons:
I've read all the recent posts, understood the general concept and idea, but definitively don't know how to do that, maybe that's because english is not my native tongue, but it was quite hard to follow... I don't know how to write the code for that, and even if you say to start learning how to code, i just can't do that (mostly because of these personnal problems and other full time activity that i already have).
Can you devellop the code and explain the wiring for it? Thanks!

Again thanks you all for the help you're providing, i'm really thanksfull for that!
Soulsavior
 
Posts: 11
Joined: Sun May 01, 2016 1:55 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Sat May 21, 2016 12:42 am

@Soulsavior:
I understand, that you don't have much time and that english is not your primary language. I also have a family, a job and I am not nativ english.

I generally understand and agree, that people don't want to invent the wheel one more time by themselves. BUT: I think they should basically know how it works. Because if they don't understand how a wheel works, they won't be able to drive a car (at least it would be not a good idea :roll: ).

I think it will be much more sustainable, if you learn a little bit by yourself and ask questions, if you have problems ("I have learned, that a wheel needs to be round on the outside. But what do I put in the middle?").

About the LED resistor: well, the GPIO output voltage is definitely findable. When you've got that, you need to find out the forward voltage for your LED and it's working current. The difference between the GPIO voltage and the LED forward voltage needs to be "wasted" on your resistor. Taking Ohms Law (R = U/I) makes it easy to calculate the resistance.

About the buttons:

we've got two ideas here around:
1 (more easy). two buttons, one for shutdown, and one for reset/restart after shutdown
2 (advanced). one button for both shutdown and restart. This requires a microcontroller and some additional programming skills

I guess you prefere the first variant, right? Then you should try to find out how to hook up a button to your C2's GPIO header. Always remember: you are not the first one with this ideas, so all the information are already out there! It also helps, if you look for RPi stuff, because these GPIO things are mainly identical on the C2.

If you like, make a wiring diagram and let us check it together.

Your task is really not hard. Indeed, it will be just copy/paste from several websites ;) . If you show some self-initiative, you will definitely get the help that you need!
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby Soulsavior » Sat May 21, 2016 2:20 am

Hi, Jojo!
Thanks for the advice, i'll take a look to understand the basics, but i won't go as far as to write the codes myself (nor enough confidence to do so), don't have time for go that far in learning ...

As for the Led, if i have the correct code for the GPIO, i can simply implement it and test the output on the GPIO directly via a multimeter. After that calculating the resistor is a piece of cake, i already had done so on various custom consoles in the past... Asking for the output was simply to make things faster :lol:

As for the buttons, i understood the two ideas, i even already have the pic programmer for the second (i used to program them to mod psx, saturns, dreamcast and ps2 and install them back in the days). But again i lack the skill to write the programming myself...
But you're right, i'd prefer the first and simpliest solution with the 2 buttons.

As for how far i'm actually into my project, i currently have not even begun to do anything, as i actually am doing a custom case that take already the little time i manage to have left... I'll try to post pics of what i have done already later (it's a custom from a non-working xbox 360 hd dvd case).

I'll try to do the wiring diagram when i can, and post it here, can you try and start doing the coding for the Led so i can implement it? Thanks!
Soulsavior
 
Posts: 11
Joined: Sun May 01, 2016 1:55 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Sat May 21, 2016 5:34 am

About the button:
don't forget the series resistor for the button that goes to a GPIO. In the final application, it should not be necessary, but better to have it and not to need it, than to need it and don't have it :) .

About the LED:
What shall I implement?! It is three commands on the console (export the GPIO, set direction, set logic level). Write them into a script and you are done. A script is nothing more but console commands in a file :) . Then call this script at startup/x-login/whenever.

You need something like a script to poll the button anyway. So you can also use that to set/clear the LED, like this (pseudo code)
Code: Select all
export_LED_gpio
LED_gpio_direction = output
LED_gpio_level = high

export_button_gpio
button_gpio_direction = input
(maybe activate internal pullup/down, or use external)

while(button_gpio_level == high) <- however "not pressed" is defined
{
sleep 1
}
LED_gpio_level = low
shutdown


Thats it :)
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby crashoverride » Sat May 21, 2016 9:35 pm

You could use something like this:
http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch#press-on-hold-off-latching-circuits

The timing part is done with a resistor and capacitor. The resistor "slows" the charging of the capacitor. When the capacitor reaches a certain level of charge, its interpreted as a different digital logic level. The output of that circuit can be connected to the /EN (not enable) line that should be exposed on J4 (check schematics to be certain). This solves the "on/off" problem since its a latching circuit.

Next you need to attach a GPIO to "sense" the button press. When activated, you should initiate the shutdown command on linux. This gets you past the next problem of clean shutdown.

Finally, you need to attach a GPIO to act in parallel with the button. When the shutdown script is activated, you add a "service" to systemd that is triggered when the system reaches shutdown state. The script would then activate the GPIO simulating the button being pressed. Three seconds later (depending on your resistor/capacitor) the circuit triggers power off. This solves the final problem of power off after shutdown.

If the system gets locked up. Pressing the button for 3 seconds will turn it off regardless. Pressing again, will turn it on.


Of course there is a catch ...

Any circuit needs power to work. When the power enable of the protector IC is disabled, the circuit will no longer have power to function. This means you need to supply a "trusted" source of power to the circuit. Ironically, this means you will likely need an additional power protector IC that is always on. While you could directly attach it to the DC input, doing so risks damage (thats why the protector IC is there to begin with).

[edit]
Don't forget the GPIO lines are only 3.3V tolerant and they can not source/sink very much current. Its implied that everything is done at your own risk. Do not attempt unless you have the necessary skills.
crashoverride
 
Posts: 3989
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Question about installing power buttons ON/OFF on C2

Unread postby Soulsavior » Tue Jun 21, 2016 9:29 am

Hi!
I wanted to update my post, and comment on my status...
First, i've soldered perfectly the J4 with a momentary on button, it work perfectly fine for powering on my C2...
As for doing a clean shutdown, i finally choose to use the app found in this topic as i'm using Android:
viewtopic.php?f=137&t=21386
It worked like a charm!
I've almost completed implementing my C2 in a custom case (just a button to install and a little paint job yet to be done) but i need to write that damn script to light the LED via the GPIO port and call it at startup...
Can you give me a hand writing that one? I'm definitively out for those kind of things... :lol: I also don't know which GPIO pins i'll have to solder for that: I think that i have to use Pin 1 or 17 (3v3) and Pin 9 or 25 (GND), isn't that so? Then the script should be something like export the GPIO (and i thought that it is import, not export... Which one is it? And why?), set direction (pin 17 for exemple here), and that's it, am i wrong? I too don't understand the set logic part... Care to explain?
Also how do i call that script at startup?
Many thanks in advance for your precious help, all! :D
Soulsavior
 
Posts: 11
Joined: Sun May 01, 2016 1:55 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby Jojo » Tue Jun 21, 2016 10:30 pm

Hi,

thank you for the update about the status.

About the script/program:
generally it is very simple, but I personally don't know anything about Android things. I personally use Linux.
Generally it does not matter if you write a true "script" (bash) or if you prefere a tiny C program. For my project I have written a small C program, but it does a little bit more then only controlling a LED...
You really just need a few rows of "code" as I have pointed out here:
http://forum.odroid.com/viewtopic.php?f=139&t=21117&p=147818#p142446
Thats all, really! It does not really matter which GPIO you take. http://lmgtfy.com/?q=led+export+gpio

About autostart:
depends on "when" exactly the script shall be called: at boot time, after login, when x-server starts... in my case I call the C program from ~/.config/lxsession/LXDE/autostart. But this also depends a little bit on your specific distro.

You are welcome to show your "source code" and your schematics, and we will push you into the right direction :)
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Question about installing power buttons ON/OFF on C2

Unread postby joerg » Thu Jun 23, 2016 11:31 pm

Hello Soulsavior,
as alternative to the solution I told you by pm you can do also like this:

open adb shell and remount
Code: Select all
$ adb shell
root@odroidc2:/ # mount -o remount, rw /

create file 'led' in /system/bin/
Code: Select all
root@odroidc2:/ # vi /system/bin/led


with this code
Code: Select all
#!/system/bin/sh

echo 234 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio234/direction
echo 1 > /sys/class/gpio/gpio234/value


change rights to executable
Code: Select all
root@odroidc2:/ # chmod 755 /system/bin/led


open 'init.odroidc2.rc'
Code: Select all
root@odroidc2:/ # vi init.odroidc2.rc


and insert this
Code: Select all
service led /system/bin/led                                       
    class main                                                                 
    disabled                                                   
    oneshot


and this
Code: Select all
on property:dev.bootcomplete=1                                                 
    start led


Don't forget to remove the 234 in the settings file of GpioShutdownService.
The Gpio234 aka pin33 has default state 0. If C2 reached state shutdown it returns by itself to 0 and the led turn off.
Do a reboot for testing this.

The advantage of this against the other method:
I must not rename my app. ;)
You must not rename your led. ;)
joerg
 
Posts: 804
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby Strykar » Sat May 12, 2018 5:28 am

odroid wrote:Refer this link to implement the shutdown with a button. There is an example script.
http://odroid.com/dokuwiki/doku.php?id=en:odroid-ups3

But, the power-on trigger need a latch circuit or small MCU.
But the locker or slide switch is quite simple. Just add a switch on J4.
http://odroid.com/dokuwiki/doku.php?id= ... arehacking


I'm asking here as I saw another 'C2 power button' thread which said to post here.
I don't need/wish to solder wire and pull that to a rocker switch.

Are these called sub-miniature switches? Those pinholes on J4 are what 1mm apart?
Are right-angled rocker switches that can be soldered right on there manufactured?

I've looked for these but found nothing that small and TBH I don't care if it's a push button and not rocker.
I too would really appreciate if someone could link to a simple right-angled switch of any type that can be soldered straight on to J4.
Strykar
 
Posts: 24
Joined: Sun Feb 25, 2018 5:58 am
languages_spoken: english
ODROIDs: C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby odroid » Sat May 12, 2018 5:50 am

User avatar
odroid
Site Admin
 
Posts: 28703
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Question about installing power buttons ON/OFF on C2

Unread postby Strykar » Sat May 12, 2018 6:33 am

odroid wrote:Refer this newer solution.
https://wiki.odroid.com/odroid-c2/appli ... key_wakeup

Why not just solder that same switch at J4 and not use any GPIO pins?
I need the GPIO pins.
Strykar
 
Posts: 24
Joined: Sun Feb 25, 2018 5:58 am
languages_spoken: english
ODROIDs: C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby odroid » Mon May 14, 2018 5:23 am

To prevent the rootfs corruption from sudden system power off events.
User avatar
odroid
Site Admin
 
Posts: 28703
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Question about installing power buttons ON/OFF on C2

Unread postby Strykar » Wed May 16, 2018 8:15 pm

odroid wrote:To prevent the rootfs corruption from sudden system power off events.

From accidental touches, got it?

But would you still link to the type of PCB-mount switch you had in mind when the C2 board was designed?
I'd like to mount the switch right where the two points for it are.
Strykar
 
Posts: 24
Joined: Sun Feb 25, 2018 5:58 am
languages_spoken: english
ODROIDs: C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby rooted » Thu May 17, 2018 12:06 am

There is no special switch designed for it as they never intended on filling the headers (AFAIK). It is there for end users to do as they wish.
User avatar
rooted
 
Posts: 5579
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Question about installing power buttons ON/OFF on C2

Unread postby Strykar » Thu May 17, 2018 1:14 am

rooted wrote:There is no special switch designed for it as they never intended on filling the headers (AFAIK). It is there for end users to do as they wish.

Oh, I was hoping for a simple solder job, my C2 will be in a bigger enclosure with no worries of accidental touch :(
What's the distance between both pins on J4, 1 mm?
Strykar
 
Posts: 24
Joined: Sun Feb 25, 2018 5:58 am
languages_spoken: english
ODROIDs: C2

Re: Question about installing power buttons ON/OFF on C2

Unread postby odroid » Thu May 17, 2018 3:41 am

0.1inch = 2.54mm.

BTW, you have to shutdown the system gracefully and turn the switch off.
Otherewise, the root file system could be corrupted.
User avatar
odroid
Site Admin
 
Posts: 28703
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 1 guest