Laptop is waking up at night, every night

I have no idea where to begin looking at this issue. My laptop wakes up at night and only at night, even though the laptop lid is closed. It stays awake until I wake up to open and close the lid for it to go back to sleep.

I have no idea where to start tracking down the thing that is causing this.

This is what I’m running on currently.
image

Welcome to the community! That seems an odd problem.

The journalctl command output could help, see here:

My journalctl log is over 20k lines. I don’t know what paste site will allow that large upload. Maybe I could just upload the file somewhere?

I do have to mention that I rarely shutdown the laptop.

What I like about Endeavour OS and Arch is that with each problem fixing we can learn more about essential linux functions. Myself I need to learn more about the journalctl but here is a good read:

https://wiki.archlinux.org/index.php/Systemd/Journal

You can add a flag/option to display a more minimal or targetted output, for example (picked up from manjaro wiki):


$ journalctl -x -p3 -b1

The flags correspond to explanatory output, priority level, and which boot to pull logs from.

Someone more knowledgable could perhaps help here with what options to use.

Here’s the output for journalctl --since "24 hours ago"

I suspect something is going on with the wireless trying to connect, seeing wlan0 and network manager in the journal log.

I suggest try putting your laptop in airplane mode or switch off wireless overnight to check if it fixes temporarily the issue.

Second thing, I would check whether you setup “suspend” in system settings under power or battery and your computer actually suspends when closing the lid, not only dims screen.

2 Likes

I’m pretty sure it goes into proper sleep since the lamp that indicates if it’s running/sleeping/shut down goes into sleeping mode where it blinks orange instead of full on blue (running) or turned off (shut down).

I have tried to shut down running programs and it still woke up, but I’ve never been tried turning wifi off. I’ll try that next.

try TLP settings there is a gui also for it, TLP is enabled per default at EOS:
tlpui (at AUR: yay -S tlpui) → https://github.com/d4nj1/TLPUI

You need something that disconnect wifi before suspending.

3 Likes

I’ll see what I can understand from it. Not sure what to turn on/off atm.

there are settings for when TLP should power off network devices, but afaik i do not see something to do on suspending…

1 Like

If you are only putting the computer on suspend mode, then keep in mind there are various devices that can wake the pc. For example any mouse or keyboard input will wake my pc from suspend. I need to turn off the wireless mouse (from the switch on the bottom of it), so that it doesn’t wake up the pc.
Alternatively, check that the touchpad is not being activated by being in proximity to the screen (when the lid is closed). This has happened to me.
Finally, if you use shutdown instead of suspend, check and disable wake on lan in bios, or check if there is an alarm set up in bios.

1 Like

There a few things I’m sure aren’t causing the wake up. I have tried removing all USB devices before putting it in suspend mode and it still woke up. And touching the touchpad doesn’t wake up the laptop, even with the lid up and it being in suspend mode. As for keyboard input, I don’t think there is a way for any key to be pressed when the lid is closed.

I just checked the WOL setting and it’s off already. So I’m gonna try to disable WIFI next and see if it helps and get back to this thread after. Have a few good ideas now. Thanks.

Ok, it did not help to disable networking before suspending the laptop. It still woke up. Here’s the newer journalctl --since "24 hours ago"

And here is the output from dmesg -T https://pastebin.com/NZCGfVjL

Is this happening always at the same time or after the same amount of time has passed? Any pattern?

I would check for wake up alarms:

Can’t seem to find any pattern in time of wake up. Nor any wake up alarms.

Maybe try to disable wakeup triggers if these are enabled.

Check this ArchWiki article:
Suspend and hibernate - Instantaneous wakeups from suspend

Also make sure …
cat /sys/class/rtc/rtc0/wakealarm
… returns nothing. This is your system’s “alarm clock” to wake up out of suspend and should return nothing by default.
[Edit] @mbod already had the rtc alarm covered two posts above. Didn’t notice before, sorry :wink:

1 Like

I might have solved the issue, but it’s a bit too early to tell. Only tested one night and it didn’t wake up by itself. I will come back to this thread and comfirm at a later date. In the meantime, found the current solution in this thread https://askubuntu.com/questions/148481/how-do-i-prevent-immediate-wake-up-from-suspend-and-or-hibernation. Might help someone.

I disabled EHC1 and XHC.

1 Like

Ok. The solution I mentioned above did not work. The laptop still woke up after a while. I was just lucky that it didn’t wake up during the night like it usually does. The search for a solution continues.

Did you perhaps reboot inbetween?
Disabling the wakeup triggers as shown ín that #buntu post reverts to enabled after a boot.

I did not. This is cat /proc/acpi/wakeup

[~]$ cat /proc/acpi/wakeup 
Device	S-state	  Status   Sysfs node
P0P1	  S4	*disabled
EHC1	  S3	*disabled  pci:0000:00:1d.0
XHC	  S3	*disabled  pci:0000:00:14.0
HDEF	  S4	*disabled  pci:0000:00:1b.0
RP01	  S4	*disabled  pci:0000:00:1c.0
PXSX	  S4	*disabled
RP02	  S4	*disabled
PXSX	  S4	*disabled
RP03	  S4	*enabled   pci:0000:00:1c.2
PXSX	  S4	*disabled  pci:0000:04:00.0
RP04	  S4	*enabled   pci:0000:00:1c.3
PXSX	  S4	*disabled  pci:0000:05:00.0
		*disabled  platform:rtsx_pci_sdmmc.0
RP05	  S4	*enabled   pci:0000:00:1c.4
PXSX	  S4	*disabled
RP06	  S4	*disabled
PXSX	  S4	*disabled
RP07	  S4	*disabled
PXSX	  S4	*disabled
RP08	  S4	*disabled
PXSX	  S4	*disabled