maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Brainstorm (https://talk.maemo.org/forumdisplay.php?f=47)
-   -   Disable long-press power button (https://talk.maemo.org/showthread.php?t=99306)

ynzinier 2017-04-21 15:45

Disable long-press power button
 
The Thing:
when walking or placing the N900 in a pocket of trousers or a jacket somehow it goes down, probably by unknowingly pressing the power button. It happens sometimes, there's no pattern nor probable bug causing this. I can't find any log of power on/off.

Potential solution:
disable the long-press on power button through file in (not sure about this) /sys/devices/platform/gpio-switch/

Advantages:
N900 won't turn off anymore by incidental long-press.

Disadvantages:
When stuck or in need to do a hard restart you will have to remove battery.

Does anyone have an idea how to debug or just disable the button?

pichlo 2017-04-21 16:07

Re: Disable long-press power button
 
How do you know it was the power button press and not, for example, a dodgy battery?

The simplest solution is a hardware mod: glue a small ring (for example, a washer) to the case around the power button. You will still be able to press it with a tool but not by accident.

ynzinier 2017-04-21 16:23

Re: Disable long-press power button
 
Quote:

Originally Posted by pichlo (Post 1527150)
How do you know it was the power button press and not, for example, a dodgy battery?

Well, it happens only when in my pocket.

freemangordon 2017-04-21 16:38

Re: Disable long-press power button
 
Quote:

Originally Posted by ynzinier (Post 1527154)
Well, it happens only when in my pocket.

Most probably it is bad battery/weak battery holder springs.

ynzinier 2017-05-09 18:13

Re: Disable long-press power button
 
Checked in another pocket and there was no such accident.
Back to the question: how to disable this functionality with some software edit?

juiceme 2017-05-10 05:02

Re: Disable long-press power button
 
Quote:

Originally Posted by ynzinier (Post 1527827)
Checked in another pocket and there was no such accident.
Back to the question: how to disable this functionality with some software edit?

Could well be I am wrong here, but the long press cannot be masked in software; it triggers a hard shutdown even in case where cpu is totally locked.

pichlo 2017-05-10 05:25

Re: Disable long-press power button
 
...all of which brings us back neatly to the weak battery contacts.

ynzinier 2017-05-10 18:22

Re: Disable long-press power button
 
Quote:

Originally Posted by juiceme (Post 1527836)
Could well be I am wrong here, but the long press cannot be masked in software; it triggers a hard shutdown even in case where cpu is totally locked.

Hm, that makes the problem harder to solve.

Quote:

Originally Posted by pichlo (Post 1527838)
...all of which brings us back neatly to the weak battery contacts.

I can fold them to better connect to board (fold the battery holders too), but even after falling from about 1 m it didn't switch off.

nieldk 2017-05-10 18:33

Re: Disable long-press power button
 
I seriously doubt that this should not be configurable somehow.
Linux is in basics just configs in file system . Even hardware.
Just, no one have been told where it's hidden.

juiceme 2017-05-10 18:38

Re: Disable long-press power button
 
Quote:

Originally Posted by nieldk (Post 1527889)
I seriously doubt that this should not be configurable somehow.
Linux is in basics just configs in file system . Even hardware.
Just, no one have been told where it's hidden.

heh, if there's a rc delay connected to the power supply enable line I sure would like to see that configured by software :D

pichlo 2017-05-11 05:29

Re: Disable long-press power button
 
Quote:

Originally Posted by nieldk (Post 1527889)
I seriously doubt that this should not be configurable somehow.
Linux is in basics just configs in file system . Even hardware.
Just, no one have been told where it's hidden.

http://www.netfunny.com/rhf/jokes/96/Jun/nosmoke.html

ontime 2017-05-11 10:36

Re: Disable long-press power button
 
For monitoring PwrButton
$ evkey -d -t -1 /dev/input/event0
or there is a counter
$ cat /proc/interrupts
376: 8 twl4030 PwrButton
here says 8, but there was 4 pushed the pwrbutton

For "disable" it: in /etc/mce/mce.ini you can change PowerKeyLongDelay=1500 value to some big number.

pichlo 2017-05-12 11:01

Re: Disable long-press power button
 
Quote:

Originally Posted by ynzinier (Post 1527886)
I can fold them to better connect to board (fold the battery holders too), but even after falling from about 1 m it didn't switch off.

I can tell you a story.
A story of my Jolla phone.
A true story.

My Jolla phone started randomly rebooting at some point. I only noticed it when I enabled a SIM card PIN: at least once, sometimes more times per day, when I pulled the phone out of the pocket, I found it waiting on the "enter SIM card PIN" screen. I could not think of anything that might have caused that other than an OS update I did just a few days before, so I naturally blamed that OS update.

I noticed that the random reboots were a bit less frequent when I carried the phone in the shirt pocket than when it was in the trousers pocket. This is when I started suspecting that maybe, just maybe, the battery may have something to do with it: the phone experiences more vibrations from walking when in the trousers pocket. On the other hand, I witnessed quite a few random reboots when there were seemingly no vibrations at all, like for example while typing a reply to an SMS.

So I went back to suspecting the software and, like you, I ignored the good advice to do something with the battery. I spent at least three months in this state, trying in vain to find the package responsible.

Eventually I gave up and added a folded piece of paper under the battery to push it more hardly against the contacts, as the people had been suggesting to me all this time. And guess what? Random reboots stopped immediately and completely.

End of story.


All times are GMT. The time now is 21:23.

vBulletin® Version 3.8.8