Can't get power button to work
#11
(08-28-2016, 02:45 AM)AidenH Wrote: Just an update - I tried to test the input of the power button using evtest in Ubuntu and nothing is showing up when I push the button - not for the button soldered to the connection points at the front or for the button connect to the EXP connector. Should this be working in Ubuntu or am I doing something wrong? I think I'm going to try and Andriod image to see if the power button is actually work properly.

hi, yeah, the power|suspend button and the reset button attach directly to the PMIC (power management integrated circuit).  See the schematic diagram here (although its a bit out-of-date).

... I have not tried to see the event from evtest !?!  ... also I have tested in both debian and ubuntu, holding the power on button for two seconds will cause the PMIC to signal the GPU ( OS ) to pull up the power off dialogue.

edit:  ok... the trick to see the event ( power on ) in evtest, is to select the axp81x option (1).

... the event comes up nicely, code 116 ( key_power ).

( this I tested with evtest on ubuntu mate )

So, if you want to build your own monitor, you need to first tell the OS not to respond to 116, key_power, then map that key for your own purposes.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#12
(08-28-2016, 02:45 AM)AidenH Wrote: Just an update - I tried to test the input of the power button using evtest in Ubuntu and nothing is showing up when I push the button - not for the button soldered to the connection points at the front or for the button connect to the EXP connector. Should this be working in Ubuntu or am I doing something wrong? I think I'm going to try and Andriod image to see if the power button is actually work properly.

As Mark indicated, it does work... the trick is to to select the right device. 

You can see in the code box below the output from running evtest on a ubuntu box, and selecting axp81x-supplyer, which was device event number 1 in that case. Credit goes to xalius for posting it in that thread I linked earlier about the power button. The button was pressed twice, so you can see a 1 when it was pressed, and a 0 when it is released. 

Code:
ubuntu@pine64:~$ sudo evtest

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      sunxi-keyboard
/dev/input/event1:      axp81x-supplyer
/dev/input/event2:      sunxi-ths
/dev/input/event3:      audiocodec sunxi Audio Jack
/dev/input/event4:      sunxi_ir_recv
/dev/input/event5:      MCE IR Keyboard/Mouse (sunxi-rc-recv)

Select the device event number [0-5]: 1

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "axp81x-supplyer"
Supported events:
 Event type 0 (EV_SYN)
 Event type 1 (EV_KEY)
   Event code 116 (KEY_POWER)
 Event type 2 (EV_REL)
Properties:
Testing ... (interrupt to exit)
Event: time 1466799328.888825, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799328.888825, -------------- SYN_REPORT ------------
Event: time 1466799328.999256, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799328.999256, -------------- SYN_REPORT ------------
Event: time 1466799329.630542, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799329.630542, -------------- SYN_REPORT ------------
Event: time 1466799329.798206, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799329.798206, -------------- SYN_REPORT ------------
#13
(08-28-2016, 03:12 AM)MarkHaysHarris777 Wrote: hi, yeah, the power|suspend button and the reset button attach directly to the PMIC (power management integrated circuit).  See the schematic diagram here (although its a bit out-of-date).

... I have not tried to see the event from evtest !?!  ... also I have tested in both debian and ubuntu, holding the power on button for two seconds will cause the PMIC to signal the GPU ( OS ) to pull up the power off dialogue.

edit:  ok... the trick to see the event ( power on ) in evtest, is to select the axp81x option (1).

... the event comes up nicely, code 116 ( key_power ).

( this I tested with evtest on ubuntu mate )

So, if you want to build your own monitor, you need to first tell the OS not to respond to 116, key_power,  then map that key for your own purposes.

(08-28-2016, 04:07 AM)pfeerick Wrote: As Mark indicated, it does work... the trick is to to select the right device. 

You can see in the code box below the output from running evtest on a ubuntu box, and selecting axp81x-supplyer, which was device event number 1 in that case. Credit goes to xalius for posting it in that thread I linked earlier about the power button. The button was pressed twice, so you can see a 1 when it was pressed, and a 0 when it is released. 

Code:
ubuntu@pine64:~$ sudo evtest

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      sunxi-keyboard
/dev/input/event1:      axp81x-supplyer
/dev/input/event2:      sunxi-ths
/dev/input/event3:      audiocodec sunxi Audio Jack
/dev/input/event4:      sunxi_ir_recv
/dev/input/event5:      MCE IR Keyboard/Mouse (sunxi-rc-recv)

Select the device event number [0-5]: 1

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "axp81x-supplyer"
Supported events:
 Event type 0 (EV_SYN)
 Event type 1 (EV_KEY)
   Event code 116 (KEY_POWER)
 Event type 2 (EV_REL)
Properties:
Testing ... (interrupt to exit)
Event: time 1466799328.888825, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799328.888825, -------------- SYN_REPORT ------------
Event: time 1466799328.999256, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799328.999256, -------------- SYN_REPORT ------------
Event: time 1466799329.630542, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799329.630542, -------------- SYN_REPORT ------------
Event: time 1466799329.798206, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799329.798206, -------------- SYN_REPORT ------------

I am definitely using the apx81x-supplyer device to test and still not getting any output.  I followed the example from the xalius link that pfeerick posted. Not sure what's wrong.
#14
(08-28-2016, 04:49 AM)AidenH Wrote: I am definitely using the apx81x-supplyer device to test and still not getting any output.  I followed the example from the xalius link that pfeerick posted. Not sure what's wrong.

At the risk of being pedantic, are you using the right switch ?

... the power switch is the one on the left as you are looking at the end of the board with the usb ports.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#15
(08-28-2016, 04:52 AM)MarkHaysHarris777 Wrote:
(08-28-2016, 04:49 AM)AidenH Wrote: I am definitely using the apx81x-supplyer device to test and still not getting any output.  I followed the example from the xalius link that pfeerick posted. Not sure what's wrong.

At the risk of being pedantic, are you using the right switch ?

... the power switch is the one on the left as you are looking at the end of the board with the usb ports.

Yes, I'm using the switch on the left, nothing. I tested an android image (an older version than the one currently available) and the power buttons are not working. I'm thinking this indicates an issue somewhere?
#16
(08-27-2016, 10:11 PM)MarkHaysHarris777 Wrote: 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)

So should this config change make the reset button inoperable with Debian (I'm running Debian-Mate)?

Thats how I interpret it, suspend=reset...but even with "do nothing" as the suspend choice, the reset button still puts me in the unrecoverable sleep mode with a long or short press.

Power button, long or short press, brings up the suspend menu.

From whats been described, that doesn't sound like expected behavior. Its not a huge issue, as I seldom use the buttons with linux images anyway, but now that I'm seeing that behavior, it will bug me until I understand what should or should not be happening.

I know the power management menu is functioning, as I changed the power button option to "shutdown", and it skipped the menu and immediately shutdown, as expected.

Is there possibly some other config setting overriding the power management setting for the reset button?
#17
(08-28-2016, 05:13 AM)DonFL Wrote:
(08-27-2016, 10:11 PM)MarkHaysHarris777 Wrote: 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)

So should this config change make the reset button inoperable with Debian (I'm running Debian-Mate)?

Thats how I interpret it, suspend=reset...but even with "do nothing" as the suspend choice, the reset button still puts me in the unrecoverable sleep mode with a long or short press.
hi Don, no.
... reset is NOT suspend. The short-press of the power button is the suspend.  I turn that 'OFF' in my debian, because it suspends forever and won't wake up.  Apparently (says pfeerick) the new Android image does wake up. 
reset is JUST a hard reset of the PMIC and it does just that... and its hard on the system because it doesn't care what is going on, it just drops the power and resets !
So, the config I noted above, to re-iterate, the short-press does nothing, the long-press pulls up the power down dialogue, and the really long press forces power off.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#18
Ok, that clarifies...was missing the point of the short-press of power, not reset, being suspend. And what I thought I saw with the reset being a suspend state was just me being impatient waiting for the reboot.


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

Forum Jump:


Users browsing this thread: 3 Guest(s)