0
seif

poweroff and LEDs

Recommended Posts

After a (sudo) poweroff, the ethernet port leds turn off, the usb sockets' power supply too, but the green led remains on. I would like the green led to turn off after a sudo poweroff.  How can I do that? What's the best way to do it?

 

It's an Orange Pi PC with ARMBIAN 5.60 stable Debian GNU/Linux 8 (jessie) 3.4.113-sun8i

 

Thanks.

Share this post


Link to post
Share on other sites

You mean this?

 

sudo /RAID/h3fakeoff 
[sudo] password for pi: 

H3fakeoff 1.0-b20171229 by ariel/KotCzarny (c) 2017

Load arisc blob which will turn off most subsystems, then wait for
gpio or IR button to start the system.
Make sure you have saved your work and umounted all filesystems.

Usage: /RAID/h3fakeoff [-s] [-l PXYY] [-b PXYY] [-w X] [-i X]
    -s    yes, power down my system
    -l PXYY    led gpio (OrangePiPC: PL10)
    -b PXYY    gpio button (OrangePiPC: PL03)
    -w X    gpio key must be held for X seconds to trigger wakeup
    -i X    ir wakeup button (ie. 255)
 

¿?

Share this post


Link to post
Share on other sites

Yes. This is the only way to power down on boards without external PMU chips under mainline kernel. In those topics you can find more indormationa about this.

Wrote on mobile

Share this post


Link to post
Share on other sites
16 minutes ago, Igor said:

Yes. This is the only way to power down on boards without external PMU chips under mainline kernel. In those topics you can find more indormationa about this.

 

Thanks!

 

Will that do a sane poweroff by itself? I mean, can I use it instead of a (sudo) poweroff? Or do I have to call first Debian's poweroff and put that (h3fakeoff) in some script so that it gets called by Debian (as late as possible) in the (sudo) poweroff/shutdown sequence of events?

 

 

Share this post


Link to post
Share on other sites
2 minutes ago, seif said:

Will that do a sane poweroff by itself?

 

That supposed to be the same way as on the stock kernel. Where this works OOB. 

Do the testings and if it works o.k., make a solution (script and builds script implementation) that we https://www.armbian.com/get-involved/ all can benefit from it. I can't fix all problems. We can.

Share this post


Link to post
Share on other sites
Quote

That supposed to be the same way as on the stock kernel. Where this works OOB. 

 

Do the testings and if it works o.k., make a solution (script and builds script implementation) that wehttps://www.armbian.com/get-involved/ all can benefit from it. I can't fix all problems. We can.

 

A sudo h3fakeoff -s shuts down my Orange Pi PC very quickly, too much perhaps, and leaves it in a sort of catatonic state in which it-s not 100% off because my chinese usb amp-meter instead of 0.00A (what I get with a sudo poweroff) shows 0.08A (80mA). 

 

sudo h3fakeoff -s -l PL10 -b PL03 does the same thing, but pressing the button for a while (the led flashes and) it reboots.

 

I think a sudo poweroff shuts down the things better, and turns everything off properly, but this does not.

 

The benefit over a poweroff is that with a h3fakeoff you can turn it on again with the button. I guess that's where the fake comes from :-)

Share this post


Link to post
Share on other sites

What I did and has worked for me is this:

 

edit /usr/lib/armbian/armbian-hardware-optimization line #208:

 

(sleep ${BlinkTime} && (echo default-on >/sys/class/leds/*green*/trigger) 2>/dev/null) &

 

and replace "default-on" with "timer"

 

For some reason, when the LED trigger is timer, it seems to always end off after a sudo poweroff.

 

It wasn't working in /etc/rc.local because in rc.local it seems to run before that #L208, so any trigger setting done there doesn't stick (it's overwritten later by #L208).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0