Page 1 of 1

Laptop into sleep mode

Posted: Thu 26 Apr 2012, 17:17
by strategic_thinker
I just installed Puppy 5.2.8-005 on my wife's laptop and I really like it. Nice and stable. Even got Citrix to work just fine.

How do I configure it so that it goes into a sleep mode when the laptop lid is shut ?

Laptop Details: IBM-T43p, P4 2.2Ghz, 2GB ram.

Thanks and regards.

Posted: Thu 26 Apr 2012, 18:21
by sfeeley
partial answer:

1. go to package manager and install acpitool

2. if you want options type in console

Code: Select all

acpitool -h
3. for handy sleep mode. Console

Code: Select all

acpitool -s
4. But typing that for sleep is a pain so do the following:
create a new text file. Name it something like sleep. insert this text in the file

Code: Select all

acpitool -s
save.

right click on the file you made. set permissions to executable.

Now if you click on it, the computer should sleep.

to make things even easier. Drag the file to your desktop. Go to the web and find a pretty icon (or use the one attached below). right click the file on the desktop ---> file--> set icon. Drag your icon.

Now if you have a desktop icon that will put your computer to sleep.

Sorry but I don't know how to make it sleep by shutting the lid

Posted: Thu 26 Apr 2012, 19:32
by frefel
Nice technique sfeeley.
I must be having a brain lapse. How do I grab that sleep .png icon?
Thanks.

Posted: Thu 26 Apr 2012, 19:47
by sfeeley
I must be having a brain lapse. How do I grab that sleep .png icon?
Actually, I can't figure out why sometimes png files appear as a picture in the forum post, and other times as a downloadable file.

Anyways, you can just right click on the image, and "save as" (at least in firefox)

Posted: Thu 26 Apr 2012, 22:52
by Karl Godt
For automatically put laptop to ram-sleep acpid might be of interest .

I think Puppy busybox comes with acpid enabled, but have not gotten it to work with configuration files (/etc/acpid.conf,acpi.map).

The code for busybox acpid had changed completely from 1.17 to 1.18 and was first introduced in 1.14 with minor changes to 1.16 and a bigger change from 1.16 to 1.17 .

Until now i got it to work with version <=1.18
for the power button .

To describe :
when acpid runs it polls /proc/acpi/events file .
when it detects an event, it should run a file called :
/etc/acpi/PWRF/00000080

The busybox code >=1.18(not working) looks like this :

Code: Select all

#struct acpi_event {
#	const char *s_type;
#	uint16_t n_type;
#	const char *s_code;
#	uint16_t n_code;
#	uint32_t value;
#	const char *desc;
#};
#static const struct acpi_event f_evt_tab[] = {
#	{ "EV_KEY", 0x01, "KEY_POWER", 116, 1, "button/power PWRF 00000080" },
#	{ "EV_KEY", 0x01, "KEY_POWER", 116, 1, "button/power PWRB 00000080" },
#};

#struct acpi_action {
#	const char *key;
#	const char *action;
#};
#static const struct acpi_action f_act_tab[] = {
#	{ "PWRF", "PWRF/00000080" },
#	{ "LID0", "LID/00000080" },

Since LID0 is mentioned it might work with a script in /etc/acpi/LID/ directory (called 00000080) .
Note:My Lap had a LID/ dir entry in /proc/acpi not a LID0/ .

*

The regular acpid comes with much more script (examples) and works ,too .
I would use the regular acpid .
Jemimah has got regular acpid included in Saluki with very good scripts (at least in version 19 which i had tested)
(Jemimah/pemasu's kernels have additionally hibernation enabled .)

must have write access to proc/acpi/sleep no sleep file

Posted: Mon 21 May 2012, 10:17
by robpeteuk
Hi trying to get my Toshiba equium a60 to hibernate.
After installing acpitool and typing in console# acpitool -s
I get
Function Do_Suspend : could not open file : /proc/acpi/sleep.
You must have write access to /proc/acpi/sleep to suspend your computer.

Checked proc/acpi there is no sleep file in the folder. Is there a solution to this?
Also if I shut the lid then reopen it the laptop shuts down. Any idea as to why? thanks Rob

Posted: Mon 21 May 2012, 11:23
by Semme
Rob- for starters mention you're running Slacko 5.3.3. If you grabbed it from PPM- run acpitool in a console..

These are the contents of mine.. Without another system or two to reference- the values may be different..

==

*Question: Does PPM return the deps installation window after hitting "examine dependencies?"

Aboard 5.3.3-4 I find PPM to be broken for acpitool and unable to install it's required deps..

Additionally- refrain from any follow-ups here and open a new, "Slacko specific" thread..

Posted: Mon 21 May 2012, 12:39
by strategic_thinker
With Slacko Puppy 5.3.3.4, the sleep mode is working fine on my wife's laptop (IBM T43p) with just the default installation.

Goes into and comes out of sleep in seconds.

Posted: Tue 22 May 2012, 20:33
by Karl Godt
Slacko should have regular acpid installed , don"t know about current lucid .

Lucid busybox should have been 1.16.2 with acpid enabled .

busybox acpid --help

should show some info .. if help enabled ..

Acpid gets lauched by a script in /etc/init.d/ .

My investigations seem to be that busybox >= 1.18 acpid needs the button.ko module loaded, while busybox < 1.18 seems to get the input by the keyboard input driver .

sh-3.2# busybox
BusyBox v1.18.3 (2011-05-01 19:45:13 CEST) multi-call binary.

sh-3.2# lsmod | grep button

sh-3.2# ps | grep acpid

sh-3.2# modprobe -v button
insmod /lib/modules/2.6.37.4-KRG-iatom-1/kernel/drivers/acpi/button.ko

sh-3.2# busybox acpid -f

Will hit the power button now .. Good night !

Posted: Fri 08 Jun 2012, 16:05
by stvnx7
I also am having the exact same problem as robpeteuk, but I can't create the sleep file in /proc/acpi/.

I would try "root" but I thought I already was root.

Any help would be greatly appreciated.

Also, if "acpitool -e" says that fan is not available, does that mean it's not running, or it can't grab the info?