Power Off / Reset Buttons - DietPi
#1
Hi! 
My pine arrived a couple days ago. I'm loving this little beast.

I have a couple trigger buttons laying around and I'd like to use one for the power off and other for the reset but I have no idea if the system is actively listening to the circuit of both these buttons.
I tried them on and nothing. Any tips?

Currently running DietPi as the OS.

Thanks!
  Reply
#2
Reset is just a hardwired hardware reset, the power button is wired to the PMIC (Power Management IC) and has the usual power-on, soft-off and hard-off function depending on how long you press it. The PMIC sends an interrupt to the A64 when the Power button is pressed and you can read/write registers on the PMIC to configure the behavior a bit. In linux the powerbutton is also a event device (think /dev/input/eventXXX) and you can watch for those events with a tool like evtest ... on my Ubuntu images with Mate Desktop the power button brings up the normal Reboot/Shutdown menu, so I guess they already wired up some udev rules for that...

For reference see:

http://files.pine64.org/doc/Pine%20A64%2...elease.pdf

http://files.pine64.org/doc/datasheet/pi...t_V1.0.pdf
Come have a chat in the Pine IRC channel >>
  Reply
#3
(08-11-2016, 03:46 PM)xalius Wrote: Reset is just a hardwired hardware reset, the power button is wired to the PMIC (Power Management IC) and has the usual power-on, soft-off and hard-off function depending on how long you press it. The PMIC sends an interrupt to the A64 when the Power button is pressed and you can read/write registers on the PMIC to configure the behavior a bit. In linux the powerbutton is also a event device (think /dev/input/eventXXX) and you can watch for those events with a tool like evtest ... on my Ubuntu images with Mate Desktop the power button brings up the normal Reboot/Shutdown menu, so I guess they already wired up some udev rules for that...

For reference see:

http://files.pine64.org/doc/Pine%20A64%2...elease.pdf

http://files.pine64.org/doc/datasheet/pi...t_V1.0.pdf

Thank you very much for the clarification, I'll give that a look and luckily make it able to shutdown. Right now either of them does nothing at all!  Smile

It is indeed in the /dev/input/event1.
When the button is pressed, weird characters are written to it.

Any idea on how I can make it so when the button is pressed "init 0" command is executed? Total noob to udev rules Sad
  Reply
#4
(08-11-2016, 04:12 PM)casmiguefl Wrote:
(08-11-2016, 03:46 PM)xalius Wrote: Reset is just a hardwired hardware reset, the power button is wired to the PMIC (Power Management IC) and has the usual power-on, soft-off and hard-off function depending on how long you press it. The PMIC sends an interrupt to the A64 when the Power button is pressed and you can read/write registers on the PMIC to configure the behavior a bit. In linux the powerbutton is also a event device (think /dev/input/eventXXX) and you can watch for those events with a tool like evtest ... on my Ubuntu images with Mate Desktop the power button brings up the normal Reboot/Shutdown menu, so I guess they already wired up some udev rules for that...

For reference see:

http://files.pine64.org/doc/Pine%20A64%2...elease.pdf

http://files.pine64.org/doc/datasheet/pi...t_V1.0.pdf

Thank you very much for the clarification, I'll give that a look and luckily make it able to shutdown. Right now either of them does nothing at all!  Smile

It is indeed in the /dev/input/event1.
When the button is pressed, weird characters are written to it.

Any idea on how I can make it so when the button is pressed "init 0" command is executed? Total noob to udev rules Sad

This most might be of use. Be warned... my OS of choice is Debian, if that makes an difference.
  Reply
#5
(08-11-2016, 07:18 PM)pfeerick Wrote:
(08-11-2016, 04:12 PM)casmiguefl Wrote:
(08-11-2016, 03:46 PM)xalius Wrote: Reset is just a hardwired hardware reset, the power button is wired to the PMIC (Power Management IC) and has the usual power-on, soft-off and hard-off function depending on how long you press it. The PMIC sends an interrupt to the A64 when the Power button is pressed and you can read/write registers on the PMIC to configure the behavior a bit. In linux the powerbutton is also a event device (think /dev/input/eventXXX) and you can watch for those events with a tool like evtest ... on my Ubuntu images with Mate Desktop the power button brings up the normal Reboot/Shutdown menu, so I guess they already wired up some udev rules for that...

For reference see:

http://files.pine64.org/doc/Pine%20A64%2...elease.pdf

http://files.pine64.org/doc/datasheet/pi...t_V1.0.pdf

Thank you very much for the clarification, I'll give that a look and luckily make it able to shutdown. Right now either of them does nothing at all!  Smile

It is indeed in the /dev/input/event1.
When the button is pressed, weird characters are written to it.

Any idea on how I can make it so when the button is pressed "init 0" command is executed? Total noob to udev rules Sad

This most might be of use. Be warned... my OS of choice is Debian, if that makes an difference.

Thank you very much!
That actually seems like it will work perfectly. Smile
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Z-Wave - Full and Low Power Inclusion mode B34N 1 4,682 03-26-2017, 06:03 PM
Last Post: B34N
  Power Supply for Pine a64 (2GB) Pip19083 1 4,899 01-22-2017, 01:32 PM
Last Post: Luke
  Low power headless operation? rubenk 9 16,920 01-05-2017, 12:37 AM
Last Post: swinging
  Power switch circuit drewh 43 70,983 09-19-2016, 09:17 AM
Last Post: tampadave
  power Circuit polo 28 46,068 07-01-2016, 07:06 PM
Last Post: pfeerick
  Power over Ethernet (PoE) WLR 1 6,292 02-10-2016, 07:14 PM
Last Post: tllim
  USB HDD Power eender 5 10,499 02-06-2016, 09:30 PM
Last Post: blktiger

Forum Jump:


Users browsing this thread: 2 Guest(s)