Power Management: ACPI Wake-Up settings

Hi,

I see my computer wake up sometimes when I’m not using it.
After some searching its the devices in /proc/acpi/wakeup that are allowed to do this.
By echoing the “4-character device name” to /proc/acpi/wakeup you can enable/disable these.
(eg: $ echo USB1 | sudo tee /proc/acpi/wakeup to enable/disable USB1)

I would like an extra panel under Power Management, called “Wake-Up Events”
or something, so i can check and uncheck these.

Currently i have solved this issue with a systemd script, but it could be so much easier just in a nice tab :smile:

Thanks a lot

For those interested, these are my devices, i enabled only the power button. So no mouse click, keyboard touch or wlan/lan packet can wake it up. (see systemd script below, change accordingly for your own benefit)

$ cat /proc/acpi/wakeup
Device	S-state	  Status   Sysfs node
PCI0	  S4	*disabled  no-bus:pci0000:00
PCIE	  S4	*disabled  pci:0000:00:1e.0
USB1	  S0	*disabled  pci:0000:00:1d.0
USB2	  S0	*disabled  pci:0000:00:1d.1
USB3	  S0	*disabled  pci:0000:00:1d.2
USB4	  S0	*disabled  pci:0000:00:1a.0
USB5	  S0	*disabled  pci:0000:00:1a.1
USB6	  S0	*disabled  pci:0000:00:1a.2
EHC2	  S0	*disabled  pci:0000:00:1a.7
EHCI	  S0	*disabled  pci:0000:00:1d.7
AZAL	  S3	*disabled  pci:0000:00:1b.0
RP01	  S4	*disabled  pci:0000:00:1c.0
RP02	  S4	*disabled  pci:0000:00:1c.1
RP03	  S4	*disabled  pci:0000:00:1c.2
RP04	  S3	*disabled  pci:0000:00:1c.3
RP05	  S3	*disabled
RP06	  S5	*disabled
LID	  S3	*disabled  platform:PNP0C0D:00
PBTN	  S4	*enabled   platform:PNP0C0C:00
$

/etc/systemd/system/acpi-wake.service:

[Unit]
Description=ACPI Wake Service

[Service]
Type=oneshot
ExecStart=/bin/sh -c "for i in $(cat /proc/acpi/wakeup|grep enabled|awk '{print $1}'|xargs); do [ $i != PBTN ] && echo $i|tee /proc/acpi/wakeup;done"

[Install]
WantedBy=multi-user.target

To enable and start the service
$ systemctl start acpi-wake.service
$ systemctl enable acpi-wake.service

4 Likes

This is interesting, as I have a similar problem sometimes: wakeup by USB is enabled in my BIOS, because I want to power on my system via keyboard.

This works well. But sometimes it will wakeup by mouse move as well.
This is a problem, as my roccat mouse is really sensitive and will wake the system if s. o. shakes my desk even slightly. I am not talking about me or other people, this would be no problem - but my robot vacuum cleaner wakes the system then! :wink:

Wakeup by mouse move definitely is not always enabled - I checked this manually. I don’t know why it is enabled sometimes, but mostly not.

BTT:
The output of cat /proc/acpi/wakeup lists USB controllers only for me and no USB devices:

[email protected] ~ $ cat /proc/acpi/wakeup 
Device	S-state	  Status   Sysfs node
PEG0	  S4	*disabled  pci:0000:00:01.0
PEGP	  S4	*disabled  pci:0000:01:00.0
PEG1	  S4	*disabled
PEGP	  S4	*disabled
PEG2	  S4	*disabled
PEGP	  S4	*disabled
PS2K	  S4	*disabled
PS2M	  S4	*disabled
UAR1	  S4	*disabled
RP09	  S4	*disabled  pci:0000:00:1d.0
PXSX	  S4	*disabled
RP10	  S4	*disabled
PXSX	  S4	*disabled
RP11	  S4	*disabled
PXSX	  S4	*disabled
RP12	  S4	*disabled
PXSX	  S4	*disabled
RP13	  S4	*disabled
PXSX	  S4	*disabled
RP01	  S4	*disabled  pci:0000:00:1c.0
PXSX	  S4	*disabled
RP02	  S4	*disabled
PXSX	  S4	*disabled
RP03	  S4	*disabled  pci:0000:00:1c.2
PXSX	  S4	*enabled   pci:0000:04:00.0
RP04	  S4	*disabled
PXSX	  S4	*disabled
RP05	  S4	*disabled
PXSX	  S4	*disabled
RP06	  S4	*disabled
PXSX	  S4	*disabled
RP07	  S4	*disabled
PXSX	  S4	*disabled
RP08	  S4	*disabled
PXSX	  S4	*disabled
RP17	  S4	*disabled  pci:0000:00:1b.0
PXSX	  S4	*disabled
RP18	  S4	*disabled
PXSX	  S4	*disabled
RP19	  S4	*disabled
PXSX	  S4	*disabled
RP20	  S4	*disabled
PXSX	  S4	*disabled
RP14	  S4	*disabled
PXSX	  S4	*disabled
RP15	  S4	*disabled
PXSX	  S4	*disabled
RP16	  S4	*disabled  pci:0000:00:1d.7
PXSX	  S4	*disabled
GLAN	  S4	*enabled   pci:0000:00:1f.6
XHC	  S4	*enabled   pci:0000:00:14.0
XDCI	  S4	*disabled
HDAS	  S4	*disabled  pci:0000:00:1f.3

I don’t have individual USB devices listed there and can not disable only the USB mouse therefore.
Any hint?

Look at:

Of course it can only the ones that are “enabled” which narrows it down a lot:

PXSX  S4*enabled   pci:0000:04:00.0
GLAN  S4*enabled   pci:0000:00:1f.6
XHC   S4*enabled   pci:0000:00:14.0

You can test it by echoing to these to /proc/acpi/wakeup and try. After reboot the settings are back to default.

PXSX     ?
GLAN     GIGABIT ETHERNET/LAN
XHC      USB 3.0

Try and let us know.

THANK YOU!!! I've been struggling with this for far too long in another topic I started, and though I don't understand this solution it totally works. Unless you or someone corrects my dim understanding or offers a warning about the three password inputs required, I'm going to write it up in super basic language as a new post in Tips, Tricks and Tutorials with links back to this post and my post seeking solutions. This seems to be a chronic problem with a spectrum of suggested solutions that didn't seem to work for me in Ubuntu Mate 20.04.1 so hopefully it may help other newbies.

Again, Thank You.

thanks a lot.
thats work
i have problem evry night and my fan noise devastate my mind

@karnemelk

I don't know if you created that script or are just sharing it. Either way..THAAAANK YOU BIG @#$KING TIME!! :smiley:

For YEARS with multiple hardware setups I have been bashing my head against a wall trying to figure out why my Linux distro installations would auto-turn on my PC after doing a complete shut down as I always do basically every night. I'd disable everything in bios talking about auto wake from the lan to usb, pci.etc, but never had this persistent problem in any version of Windows and that was one of the very first things that always made me do the boot-of-shame back to Windows

I've been on LM 20 Cinnamon since Late July 2020 and the problem persistent ..still with my Asrock z97m pro4 micro atx motherboard.

I can 100% confirm what you shared FINALLY worked for my system even though it's a Linux Mint and a different desktop environment as of tonight after doing 20 "shutdown -P now" via terminal to manually power off the PC, waiting at least 20 seconds ( given before it would auto power back on within 6 seconds or less of the fans completely stop spinning) between manually powering it back on via pressing the power button on my PC's case......20 times- rounds

You are AWESOME for sharing this! I have pasted this link in the linuxmintforums.com as a new post.

Cheers!!