Can't get power button to work
#6
(08-27-2016, 09:11 PM)pfeerick Wrote: Hi Aiden

In a nutshell, from my understanding, the power button is of use for two main use cases 1) when you have the battery attached and 2) if you are using an android image. Rest of the time, it will simply confuse and not be of much help. To expand on use case 1, if you don't have the battery connected, the pine 64 will start up... and a few seconds later promptly shut down when it realises there is no battery to be found. With use case 2, the power button can be used to both power on the pine64 (with or without a battery), and also give access to the power off menu... otherwise powering the sucker off will be a bit tricky! Wink Thankfully, you don't have to worry about switch contact bouncing (which means the pine64 thinks the button is pressed multiple times) as the power management IC has built-in hardware denouncing, so you just give it a tap for a short press, and hold it for a second or two for a long one. 

There is a third instance you can use it, as if you have linux running, pressing the power button will trigger an event you can have code respond to, but I haven't bothered doing anything with that myself (other than to prove it can work). 

With the system LED, that probably doesn't do what you think it does. It's a user programmable LED, and can be controlled just like any of the other GPIO ports. Like xalius demonstrates here.  

Hope that clears that up for you. Yell out if you're still confused about anything... Wink

(08-27-2016, 10:11 PM)MarkHaysHarris777 Wrote:
(08-27-2016, 09:11 PM)pfeerick Wrote: There is a third instance you can use it, as if you have linux running, pressing the power button will trigger an event you can have code respond to, but I haven't bothered doing anything with that myself (other than to prove it can work). 

With the system LED, that probably doesn't do what you think it does. It's a user programmable LED, and can be controlled just like any of the other GPIO ports. Like xalius demonstrates here.  

I will also add, in addition to what pfeerick has said, that something some of us have discussed is that rather than soldering the system LED in place, it might be better to solder there instead regular male header pins, effectively giving you one more GPIO pin !  I use primarily gnu+linux, and I use the system LED as a final boot-up and system running normally indicator. If your PineA64 is running headless its best to put the indicator on the case front panel, and having a GPIO header pin to plug jumpers into is really helpful. I plan to post those codes as a sticky soon; they are still experimental for me.  

With debian the power button click is nasty! it puts the PineA64 board to sleep for which there is no recovery (well, except power removal );  however, if you HOLD the power button with debian running , then you will receive the debian normal 'shutdown dialogue'.  Its sweet, but, just remember to hold the power, don't just click it.

Edit:  Also, and this is important, on debian ( on mate desktop ) go into the Power Management Preferences and change the General Actions for the power and reset buttons !

System --> Preferences --> Power Management Preferences

Then click the General tab, and then set the power button to "Ask Me", and set the suspend button to "Do Nothing".

(hope that helps)


Thanks for the info guys, that clears it all up. I thought I damaged the power traces or something with my terrible soldering  Big Grin
I guess i'll take a look at triggering an event in linux and see what I can do with that and I'll go back to my original method of using the GPIO for the button LED. 

(08-27-2016, 10:58 PM)pfeerick Wrote: Sorry for the slightly OT post Aiden! Big Grin

No worries, it's interesting infomation to read anyway


Messages In This Thread
Can't get power button to work - by AidenH - 08-27-2016, 08:46 PM
RE: Can't get power button to work - by pfeerick - 08-27-2016, 09:11 PM
RE: Can't get power button to work - by pfeerick - 08-27-2016, 10:58 PM
RE: Can't get power button to work - by pfeerick - 08-28-2016, 01:08 AM
RE: Can't get power button to work - by AidenH - 08-27-2016, 11:38 PM
RE: Can't get power button to work - by AidenH - 08-28-2016, 02:45 AM
RE: Can't get power button to work - by pfeerick - 08-28-2016, 04:07 AM
RE: Can't get power button to work - by AidenH - 08-28-2016, 04:49 AM
RE: Can't get power button to work - by AidenH - 08-28-2016, 05:10 AM
RE: Can't get power button to work - by DonFL - 08-28-2016, 05:13 AM
RE: Can't get power button to work - by DonFL - 08-28-2016, 07:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question +LTS/SOPINE USB voltage on power off using LiPo battery GregH 0 2,464 05-06-2020, 11:23 PM
Last Post: GregH
  Battery case and power question Twistedx 2 5,400 12-24-2018, 08:04 PM
Last Post: Twistedx
  Power Cord & SD Card Maximum 1 2,983 01-09-2017, 04:41 PM
Last Post: Ghost
  Board will not boot/does not work major7 2 4,200 09-03-2016, 02:53 AM
Last Post: major7
  Wires as power button Nittola 5 7,364 08-19-2016, 03:35 PM
Last Post: MarkHaysHarris777
  Push button on/off switch Wolfenstein 6 9,029 08-01-2016, 11:05 AM
Last Post: MarkHaysHarris777
  Day lost in getting it work ptiwari 4 6,068 07-24-2016, 01:17 PM
Last Post: ptiwari
  Power Jumper rahlquist 12 16,905 04-03-2016, 09:29 AM
Last Post: SkimMilk

Forum Jump:


Users browsing this thread: 2 Guest(s)