Power button time to ON setting

When powering on the board you have to hold the power button down for 10 seconds. When looking at the board through the serial it actually turns on long before 10 seconds and starts loading. But if you release the power button before the 10 seconds, it just shuts off.

This is really undesirable behavior. Is there a way to program the power button so you can just push it or even hold it but for less than current 10 seconds?


you can plug the cable to the mini USB port to solve this problem.

Just a cable? Or does something need to be connected on the other side? I don’t think this is a workable solution. This is for a commercial product based on R2 so I think this will be even more confusing to the customers if they have to be plugging in cables.

That’s why I am looking for information on how to program the power button behavior.

Do you know where I could get more info?


If you don’t want to use Android OS or power off R2 by using 'shutdown" command, you can refer to below link, thanks. http://forum.banana-pi.org/t/bpi-r2-boot-power-suppy/3647/47

That’s not what I mean. We actually want to avoid the customer ever un-plugging the power cord. We’d lose important cached data that needs to be flushed to disk.

What I am looking for is information on how to program the power button.

  1. Press 3-5 seconds, system turns on and boots.
  2. Press 3-5 seconds, system powers down. (this is not the problem, I saw code to get an event on button press)
  3. Press 3-5 seconds, system turns on and boots.

So there are 2 problems with current button.

  1. It takes 10 seconds to power on.
  2. After you type in “poweroff” on the console and system shuts down, the system no longer powers back on again if you hold the button for 10 seconds.

the issue pressing for 10 sec to boot is highly depending on the bootloader. AFAIK, it isn’t having a good solution to fix up in the bootloader.

and if you want power back, you should use reboot instead of poweroff or shutdown.

ah ok, I can take a peek in the boatloader with regards to intial boot time. Thank you for the pointer.

For the second issue, I am not talking about wanting to reboot. I am saying that once you run poweroff and then let the system sit and then eventually push power button again, it doesn’t power-on or boot. It just stays off.

when it fails at boot via press pwr-key for 10 secs, is micro-usb cable is connected? if so, try to remove micro-usb cable and test again to see if the behavior is the same? if not, i think i need to take a look what happen in my setup :frowning:

I don’t use the micro USB connector at all so the answer is no usb connected.

@linkerosa, so have you checked? Why is not powering back on if no micro-usb connected?