Author Topic: What Does The On/off Button Do  (Read 5319 times)

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
What Does The On/off Button Do
« on: October 06, 2007, 11:12:35 am »
As the title says,

Can I do the same from command line as if I'd press the power button ?

I have a C1000 with a power button that lets me down every now and then, causing the Z to freeze. It's not debian related, it happens in pdaXrom, Angstrom, debian eabi and titchy. I haven't tried the sharp-rom, but I suppose it would be the same.

I see the screen dropping to a "console" on my C3100, then I see it "stopping tasks" before power turns off. When I use apm --suspend it doesn't do that.
Does anybody know what command/script I have to look for ?

Thanks,
Chero.
« Last Edit: October 06, 2007, 11:14:22 am by Chero »
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

jfv

  • Sr. Member
  • ****
  • Posts: 437
    • View Profile
What Does The On/off Button Do
« Reply #1 on: October 06, 2007, 11:52:19 am »
What works on desktops is:
shutdown -h now
You can try that and see what happens.
SL 5000 D  and C860 Sharp ROM
Too many accessories...

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
What Does The On/off Button Do
« Reply #2 on: October 06, 2007, 12:11:01 pm »
Quote from: jfv
What works on desktops is:
shutdown -h now
You can try that and see what happens.

That also works on my zaurus, but I don't want to shutdown, I want to suspend.

Thanks for the effort anyway,
Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

jpmatrix

  • Hero Member
  • *****
  • Posts: 1014
    • View Profile
    • http://matrixmen.free.fr
What Does The On/off Button Do
« Reply #3 on: October 06, 2007, 02:33:39 pm »
apparently

apm --suspend

seems to do the job.

apparently there's apm --standby too, i haven't tried.
**Fujitsu U1010 !!!  
**ex-Zaurus SL-C3000 owner with Debian kernel 2.6.24-yonggun

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
What Does The On/off Button Do
« Reply #4 on: October 06, 2007, 05:23:47 pm »
So do you mean it is a hardware failure?

It's very straightforward to map the suspend command to a shortcut key to make up for the misbahaving power key. Perhaps modifying the kernel keymap and xmodmap will fix it once and for all?
« Last Edit: October 06, 2007, 05:23:59 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

dlj0

  • Full Member
  • ***
  • Posts: 218
    • View Profile
What Does The On/off Button Do
« Reply #5 on: October 06, 2007, 10:11:40 pm »
Quote from: jpmatrix
apparently

apm --suspend

seems to do the job.

apparently there's apm --standby too, i haven't tried.

apm --suspend works as advertised.  -- standby gives me "invalid argument".  apm --help lists it as an option, though.
Zaurus:  SL C3100
ROM:  eabi debian/sid

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
What Does The On/off Button Do
« Reply #6 on: October 07, 2007, 03:40:44 am »
Quote from: ZDevil
So do you mean it is a hardware failure?

It's very straightforward to map the suspend command to a shortcut key to make up for the misbahaving power key. Perhaps modifying the kernel keymap and xmodmap will fix it once and for all?

Ok, but first I have to know what the suspend command is.

Check this :
Use the on/off button to suspend, then resume using it again or using the home button. Check dmesg :
stopping tasks...done
restarting tasks...done

Then use apm -s to suspend and resume using the on/off or the home button. Check dmesg :
restarting tasks ... done.

But there is no stopping tasks.
This brings me to my initial question : what does the on/off button do and how can I do it from command line ?

Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
What Does The On/off Button Do
« Reply #7 on: October 07, 2007, 04:18:53 am »
Just a wild guess: What does the /etc/sysconfig/keyboard/kernel.map in your pdaXii setup say about the Power AND the Home buttons?

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
What Does The On/off Button Do
« Reply #8 on: October 08, 2007, 02:18:20 am »
I've done a few tests and it seems that apm --suspend does add "stopping tasks ... done" to dmesg, so I guess I'll have to do some more testing and see where it leads me ... .

Thanks for all the answers.
Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
What Does The On/off Button Do
« Reply #9 on: October 08, 2007, 02:52:15 am »
Quote from: Chero
Quote from: ZDevil
So do you mean it is a hardware failure?

It's very straightforward to map the suspend command to a shortcut key to make up for the misbahaving power key. Perhaps modifying the kernel keymap and xmodmap will fix it once and for all?

Ok, but first I have to know what the suspend command is.
...
Chero.
I just wonder if it is possible to remap the Power/Home key to something else, without even knowing the exact command, so as to make the new key function in the same way as Power/Home key.

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

jpmatrix

  • Hero Member
  • *****
  • Posts: 1014
    • View Profile
    • http://matrixmen.free.fr
What Does The On/off Button Do
« Reply #10 on: October 12, 2007, 11:04:23 am »
i don't know if it is related to this thread, but i notice some battery draining while the zaurus is suspended.
am i the only one ? perhaps my zaurus battery is beginning to be a little old, i've never changed it since i've bought my C3000
**Fujitsu U1010 !!!  
**ex-Zaurus SL-C3000 owner with Debian kernel 2.6.24-yonggun

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
What Does The On/off Button Do
« Reply #11 on: October 12, 2007, 05:40:27 pm »
Can't tell yet.
The day before yesterday my 3200 was busy compiling things busily without any external power source. I checked after three hours of compilation and the bettery went down from 9x% to 50%.

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]