System randomly going to sleep

Hey, I’ve got an issue but I’m still not sure whether the hardware or nixos is at fault.

I have a Dell Inspiron 5570. (Quite old, I don’t really know how old is it, as its an laptop that was used in an office before)

So sometimes, the laptop goes into that cycle of going to sleep every like 20 seconds even if I’m using it, and only goes away if I shutdown the laptop and let it be for a whole day, then the next day it will work again until it goes in that cycle goes again and it goes to sleep I wake it, it goes to sleep I wake it, etc…

Journalctl show absolutly nothing, I though it was cause of over heating but the cpu never really goes over 60°C it may still be linked somehow.

It started last week after updating my flake (I didn’t use the laptop for a while (a good week)), I though it was that but even after downgrading again the issue still persists. My nix config is available here.

I’ll be really glad if any of you have an idea of whats going on.

Hello
Do you have any powersaving options in your config (Could not find any but better safe than sorry)?
Also are you wearing any magnetig wristband or watch?
Because if you do the magnet could trigger the “Lid is closed” Mechanism in the Laptop which would than go to sleep.
https://www.dell.com/community/en/conversations/inspiron/laptop-keeps-going-to-sleep/647f7a04f4ccf8a8de82eb0c

Can you also post the output of journalctl | grep "Lid closed" and look if the times that are mentioned fit the times your laptop goes to sleep randomly?

I removed them from Gnome settings as I tough something with Gnome desktop had a bug but it stull is going on.

Nope, I don’t have anything at my wrist.

Here:

mar 06 14:49:45 Raft-Laptop systemd-logind[983]: Lid closed.
mar 06 16:29:07 Raft-Laptop systemd-logind[945]: Lid closed.
mar 06 16:33:34 Raft-Laptop systemd-logind[945]: Lid closed.
mar 06 16:33:36 Raft-Laptop systemd-logind[945]: Lid closed.
mar 06 16:34:04 Raft-Laptop systemd-logind[945]: Lid closed.
mar 06 16:34:05 Raft-Laptop systemd-logind[945]: Lid closed.
mar 06 16:35:30 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:36:37 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:40:45 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:40:52 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:41:49 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:46:09 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:47:05 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:47:13 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:47:26 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:47:28 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:47:30 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:49:31 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:50:11 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 16:55:58 Raft-Laptop systemd-logind[981]: Lid closed.
mar 06 19:12:28 Raft-Laptop systemd-logind[888]: Lid closed.
mar 06 19:17:41 Raft-Laptop systemd-logind[1008]: Lid closed.
mar 06 19:38:30 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:38:35 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:38:55 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:39:09 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:39:59 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:40:03 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:40:39 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:41:26 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:55:43 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:56:04 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 19:56:06 Raft-Laptop systemd-logind[862]: Lid closed.
mar 06 23:52:15 Raft-Laptop systemd-logind[845]: Lid closed.
mar 08 21:02:27 Raft-Laptop systemd-logind[981]: Lid closed.
mar 09 12:00:20 Raft-Laptop systemd-logind[1118]: Lid closed.
mar 09 15:22:29 Raft-Laptop systemd-logind[1118]: Lid closed.
mar 09 19:19:39 Raft-Laptop systemd-logind[992]: Lid closed.
mar 09 23:42:04 Raft-Laptop systemd-logind[992]: Lid closed.
mar 10 10:33:34 Raft-Laptop systemd-logind[870]: Lid closed.
mar 10 10:33:51 Raft-Laptop systemd-logind[870]: Lid closed.
mar 10 10:58:57 Raft-Laptop systemd-logind[870]: Lid closed.
mar 10 13:34:51 Raft-Laptop systemd-logind[867]: Lid closed.
mar 10 14:30:45 Raft-Laptop systemd-logind[867]: Lid closed.
mar 10 15:31:02 Raft-Laptop systemd-logind[937]: Lid closed.
mar 10 15:58:26 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:45:01 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:45:50 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:46:40 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:46:49 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:47:45 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:48:16 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 09:07:12 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 09:11:37 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 09:11:38 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 10:39:29 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 17:55:37 Raft-Laptop systemd-logind[898]: Lid closed.
mar 11 17:56:50 Raft-Laptop systemd-logind[898]: Lid closed.

But do these times are the same when your laptop goes randomly to sleep?

Those times are the times I close the lid myself and not when the issue happened

Ow wait, the times of March 6 do match, but when it happened yesterday it didn’t seem to log the ‘Lid closed’ I woke up the computer a couple of times yesterday and it’s not in the log

Ok that is strange.
To be sure there is nothing wrong with the lid switch try to put this in your config:

services.logind.lidSwitch = "ignore";

This should make your system ignore the lidswitch.
Also can you run this command journalctl | grep "sleep" and look for the times your laptop randomly went to sleep. Than run the same command but instead of greping for "sleep" grep for the time. Should look something like this journalctl | grep "Jan 12 08:39"

Here is the output:

mar 11 08:46:01 Raft-Laptop systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
mar 11 08:46:06 Raft-Laptop systemd-logind[937]: Lid opened.
mar 11 08:46:06 Raft-Laptop .gnome-shell-wr[2510]: clutter_actor_insert_child_at_index: assertion 'child->priv->parent == NULL' failed
mar 11 08:46:06 Raft-Laptop .gnome-shell-wr[2510]: Failed to make thread 'KMS thread' high priority scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist
mar 11 08:46:06 Raft-Laptop .gnome-shell-wr[2510]: Failed to make thread 'KMS thread' high priority scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist
mar 11 08:46:40 Raft-Laptop systemd-logind[937]: Lid closed.
mar 11 08:46:40 Raft-Laptop systemd-logind[937]: Suspending...
mar 11 08:46:40 Raft-Laptop ModemManager[2062]: <msg> [sleep-monitor-systemd] system is about to suspend
mar 11 08:46:40 Raft-Laptop dbus-daemon[813]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.10' (uid=0 pid=1038 comm="/nix/store/lc3inz8d7c4ll4f85j7n0kdg8ag1296r-networ" label="kernel")
mar 11 08:46:40 Raft-Laptop systemd[1]: Starting Network Manager Script Dispatcher Service...
mar 11 08:46:40 Raft-Laptop dbus-daemon[813]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
mar 11 08:46:40 Raft-Laptop systemd[1]: Started Network Manager Script Dispatcher Service.
mar 11 08:46:40 Raft-Laptop dnsmasq[1518]: reading /etc/resolv.conf
mar 11 08:46:40 Raft-Laptop dnsmasq[1518]: using nameserver 1.1.1.1#53
mar 11 08:46:40 Raft-Laptop dnsmasq[1518]: using nameserver 9.9.9.9#53
mar 11 08:46:40 Raft-Laptop .gnome-shell-wr[2510]: clutter_actor_insert_child_at_index: assertion 'child->priv->parent == NULL' failed
mar 11 08:46:40 Raft-Laptop systemd[1]: Stopped target Host and Network Name Lookups.
mar 11 08:46:40 Raft-Laptop systemd[1]: Stopping Host and Network Name Lookups...
mar 11 08:46:40 Raft-Laptop systemd[1]: Stopped target User and Group Name Lookups.
mar 11 08:46:40 Raft-Laptop systemd[1]: Stopping User and Group Name Lookups...
mar 11 08:46:40 Raft-Laptop systemd[1]: Stopping Name Service Cache Daemon (nsncd)...
mar 11 08:46:40 Raft-Laptop systemd[1]: nscd.service: Deactivated successfully.
mar 11 08:46:40 Raft-Laptop systemd[1]: Stopped Name Service Cache Daemon (nsncd).
mar 11 08:46:40 Raft-Laptop systemd[1]: nscd.service: Consumed 46ms CPU time, 3.3M memory peak, 4.8K incoming IP traffic, 2.7K outgoing IP traffic.
mar 11 08:46:40 Raft-Laptop systemd[1]: Starting Name Service Cache Daemon (nsncd)...
mar 11 08:46:40 Raft-Laptop avahi-daemon[810]: Got SIGHUP, reloading.
mar 11 08:46:40 Raft-Laptop avahi-daemon[810]: No service file found in /etc/avahi/services.
mar 11 08:46:40 Raft-Laptop avahi-daemon[810]: Leaving mDNS multicast group on interface wlp3s0.IPv4 with address 192.168.52.190.
mar 11 08:46:40 Raft-Laptop avahi-daemon[810]: Interface wlp3s0.IPv4 no longer relevant for mDNS.
mar 11 08:46:40 Raft-Laptop systemd[1]: Started Name Service Cache Daemon (nsncd).
mar 11 08:46:40 Raft-Laptop nsncd[60767]: Mar 11 07:46:40.677 INFO started, config: Config { ignored_request_types: {}, worker_count: 8, handoff_timeout: 3s }, path: "/var/run/nscd/socket"
mar 11 08:46:40 Raft-Laptop systemd[1]: Reached target Host and Network Name Lookups.
mar 11 08:46:40 Raft-Laptop systemd[1]: Reached target User and Group Name Lookups.
mar 11 08:46:40 Raft-Laptop kernel: wlp3s0: deauthenticating from f2:2d:b5:e7:78:62 by local choice (Reason: 3=DEAUTH_LEAVING)
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: nl80211: send_event_marker failed: Source based routing not supported
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-DISCONNECTED bssid=f2:2d:b5:e7:78:62 reason=3 locally_generated=1
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-SCAN-FAILED ret=-100
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: p2p-dev-wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: p2p-dev-wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: nl80211: deinit ifname=p2p-dev-wlp3s0 disabled_11b_rates=0
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: wlp3s0: CTRL-EVENT-DSCP-POLICY clear_all
mar 11 08:46:40 Raft-Laptop wpa_supplicant[1386]: nl80211: deinit ifname=wlp3s0 disabled_11b_rates=0
mar 11 08:46:40 Raft-Laptop .gnome-shell-wr[2510]: Failed to make thread 'KMS thread' high priority scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist
mar 11 08:46:41 Raft-Laptop .gnome-shell-wr[2510]: Failed to make thread 'KMS thread' high priority scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist
mar 11 08:46:42 Raft-Laptop .gnome-shell-wr[2510]: Failed to make thread 'KMS thread' high priority scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist
mar 11 08:46:42 Raft-Laptop .gnome-shell-wr[2510]: Failed to make thread 'KMS thread' high priority scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist
mar 11 08:46:42 Raft-Laptop systemd[1]: Starting Pre-Sleep Actions...
mar 11 08:46:42 Raft-Laptop systemd[1]: pre-sleep.service: Deactivated successfully.
mar 11 08:46:42 Raft-Laptop systemd[1]: Finished Pre-Sleep Actions.
mar 11 08:46:42 Raft-Laptop systemd[1]: Reached target Sleep.
mar 11 08:46:42 Raft-Laptop systemd[1]: Starting System Suspend...
mar 11 08:46:42 Raft-Laptop systemd-sleep[60825]: Successfully froze unit 'user.slice'.
mar 11 08:46:42 Raft-Laptop systemd-sleep[60825]: Performing sleep operation 'suspend'...
mar 11 08:46:42 Raft-Laptop kernel: PM: suspend entry (deep)
mar 11 08:46:42 Raft-Laptop kernel: Filesystems sync: 0.025 seconds
mar 11 08:46:45 Raft-Laptop kernel: Freezing user space processes
mar 11 08:46:45 Raft-Laptop kernel: Freezing user space processes completed (elapsed 0.001 seconds)
mar 11 08:46:45 Raft-Laptop kernel: OOM killer disabled.
mar 11 08:46:45 Raft-Laptop kernel: Freezing remaining freezable tasks
mar 11 08:46:45 Raft-Laptop kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
mar 11 08:46:45 Raft-Laptop kernel: printk: Suspending console(s) (use no_console_suspend to debug)
mar 11 08:46:45 Raft-Laptop kernel: sd 2:0:0:0: [sda] Synchronizing SCSI cache
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: Entering standby power mode
mar 11 08:46:45 Raft-Laptop kernel: ACPI: EC: interrupt blocked
mar 11 08:46:45 Raft-Laptop kernel: amdgpu 0000:01:00.0: amdgpu: PCI CONFIG reset
mar 11 08:46:45 Raft-Laptop kernel: ACPI: PM: Preparing to enter system sleep state S3
mar 11 08:46:45 Raft-Laptop kernel: ACPI: EC: event blocked
mar 11 08:46:45 Raft-Laptop kernel: ACPI: EC: EC stopped
mar 11 08:46:45 Raft-Laptop kernel: ACPI: PM: Saving platform NVS memory
mar 11 08:46:45 Raft-Laptop kernel: Disabling non-boot CPUs ...
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 1 is now offline
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 2 is now offline
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 3 is now offline
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 4 is now offline
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 5 is now offline
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 6 is now offline
mar 11 08:46:45 Raft-Laptop kernel: smpboot: CPU 7 is now offline
mar 11 08:46:45 Raft-Laptop kernel: ACPI: PM: Low-level resume complete
mar 11 08:46:45 Raft-Laptop kernel: ACPI: EC: EC started
mar 11 08:46:45 Raft-Laptop kernel: ACPI: PM: Restoring platform NVS memory
mar 11 08:46:45 Raft-Laptop kernel: Enabling non-boot CPUs ...
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 1 APIC 0x2
mar 11 08:46:45 Raft-Laptop kernel: CPU1 is up
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 2 APIC 0x4
mar 11 08:46:45 Raft-Laptop kernel: CPU2 is up
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 3 APIC 0x6
mar 11 08:46:45 Raft-Laptop kernel: CPU3 is up
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 4 APIC 0x1
mar 11 08:46:45 Raft-Laptop kernel: CPU4 is up
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 5 APIC 0x3
mar 11 08:46:45 Raft-Laptop kernel: CPU5 is up
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 6 APIC 0x5
mar 11 08:46:45 Raft-Laptop kernel: CPU6 is up
mar 11 08:46:45 Raft-Laptop kernel: smpboot: Booting Node 0 Processor 7 APIC 0x7
mar 11 08:46:45 Raft-Laptop kernel: CPU7 is up
mar 11 08:46:45 Raft-Laptop kernel: ACPI: PM: Waking up from system sleep state S3
mar 11 08:46:45 Raft-Laptop kernel: ACPI: EC: interrupt unblocked
mar 11 08:46:45 Raft-Laptop kernel: ACPI: EC: event unblocked
mar 11 08:46:45 Raft-Laptop kernel: i915 0000:00:02.0: [drm] [ENCODER:94:DDI A/PHY A] is disabled/in DSI mode with an ungated DDI clock, gate it
mar 11 08:46:45 Raft-Laptop kernel: i915 0000:00:02.0: [drm] [ENCODER:102:DDI B/PHY B] is disabled/in DSI mode with an ungated DDI clock, gate it
mar 11 08:46:45 Raft-Laptop kernel: i915 0000:00:02.0: [drm] [ENCODER:111:DDI C/PHY C] is disabled/in DSI mode with an ungated DDI clock, gate it
mar 11 08:46:45 Raft-Laptop kernel: [drm] PCIE GART of 256M enabled (table at 0x000000F400000000).
mar 11 08:46:45 Raft-Laptop kernel: amdgpu: can't get the mac of 5
mar 11 08:46:45 Raft-Laptop kernel: usb 1-5: reset high-speed USB device number 2 using xhci_hcd
mar 11 08:46:45 Raft-Laptop kernel: ata1: SATA link down (SStatus 4 SControl 300)
mar 11 08:46:45 Raft-Laptop kernel: ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: Entering active power mode
mar 11 08:46:45 Raft-Laptop kernel: ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: ACPI cmd f5/00:00:00:00:00:00(SECURITY FREEZE LOCK) filtered out
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: ACPI cmd b1/c1:00:00:00:00:00(DEVICE CONFIGURATION OVERLAY) filtered out
mar 11 08:46:45 Raft-Laptop kernel: ata2.00: configured for UDMA/133
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: ACPI cmd f5/00:00:00:00:00:00(SECURITY FREEZE LOCK) filtered out
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: ACPI cmd b1/c1:00:00:00:00:00(DEVICE CONFIGURATION OVERLAY) filtered out
mar 11 08:46:45 Raft-Laptop kernel: ata3.00: configured for UDMA/100
mar 11 08:46:45 Raft-Laptop kernel: atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying to access hardware directly.
mar 11 08:46:45 Raft-Laptop kernel: usb 1-6: reset high-speed USB device number 3 using xhci_hcd
mar 11 08:46:45 Raft-Laptop kernel: sd 2:0:0:0: [sda] Starting disk
mar 11 08:46:45 Raft-Laptop kernel: usb 1-7: reset full-speed USB device number 4 using xhci_hcd
mar 11 08:46:45 Raft-Laptop kernel: OOM killer enabled.
mar 11 08:46:45 Raft-Laptop kernel: Restarting tasks ...
mar 11 08:46:45 Raft-Laptop kernel: mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
mar 11 08:46:45 Raft-Laptop kernel: Bluetooth: hci0: using rampatch file: qca/rampatch_usb_00000302.bin
mar 11 08:46:45 Raft-Laptop kernel: Bluetooth: hci0: QCA: patch rome 0x302 build 0x3e8, firmware rome 0x302 build 0x111
mar 11 08:46:45 Raft-Laptop kernel: done.
mar 11 08:46:45 Raft-Laptop kernel: random: crng reseeded on system resumption
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/ldac
mar 11 08:46:45 Raft-Laptop systemd[1]: Starting Load/Save RF Kill Switch Status...
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/aptx_hd
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aptx_hd
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/aptx
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aptx
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/aac
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aac
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/opus_g
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/opus_g
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/sbc
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/sbc
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aptx_ll_1
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aptx_ll_0
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_1
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_0
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/faststream
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/faststream_duplex
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/opus_05
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/opus_05
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSink/opus_05_duplex
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Endpoint unregistered: sender=:1.87 path=/MediaEndpoint/A2DPSource/opus_05_duplex
mar 11 08:46:45 Raft-Laptop dbus-daemon[813]: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.4" (uid=0 pid=811 comm="/nix/store/840xr1020qsnhn8v6x6bljpymfwanqfq-bluez-" label="kernel") interface="org.bluez.GattProfile1" member="Release" error name="(unset)" requested_reply="0" destination=":1.88" (uid=1000 pid=2950 comm="/nix/store/flwi3pbnf40l20px0kl09nn3vdc5x8ag-wirepl" label="kernel")
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Destroy Adv Monitor Manager
mar 11 08:46:45 Raft-Laptop bluetoothd[811]: Battery Provider Manager destroyed
mar 11 08:46:45 Raft-Laptop systemd[1]: Stopped target Bluetooth Support.
mar 11 08:46:45 Raft-Laptop systemd[1]: Started Load/Save RF Kill Switch Status.
mar 11 08:46:45 Raft-Laptop systemd[1]: Reached target Bluetooth Support.
mar 11 08:46:45 Raft-Laptop kernel: PM: suspend exit
mar 11 08:46:45 Raft-Laptop systemd-sleep[60825]: System returned from sleep operation 'suspend'.
mar 11 08:46:45 Raft-Laptop systemd-sleep[60825]: Successfully thawed unit 'user.slice'.

It happens again, and it triggers a ‘Lid Closed’ log again.

This was the output when the system randomly went to sleep?
If so than there is something wrong with the lid sensor:

Then can you try using this. This should prevent the system from going to sleep when the lid is closed.

I already added

services.logind.lidSwitch = "ignore";

But it doesn’t seem to prevent the sleeping of the system

Whats even weirder, I was in another room when the system was sleeping again, but now that I’m back on my desk it doesn’t go to sleep anymore…

Should I maybe try to remove the sensor or replace it ?

And here it goes again, it just goes to sleep constantly

Ok can you try these two options. Maybe this will help:

boot.kernelParams = [ "button.lid_init_state=open" ];
services.logind.extraConfig = "HandleLidSwitch=ignore";

Also what is the log now after the new sudden sleep.
Also when trying the boot param option you need to do a restart.

1 Like

I timed it and the Lid Closed log doesn’t happen every time, sometimes it does sometime it doesnt.

Alright restarting right now

Alright this seems to work, I’ll wait a bit to see if it happens again but it has been running for 5 mins and it didn’t go to sleep !

It’s still really weird tho, but at least I can use it finally. Thank you so much !

Apparently you can also disable the lid switch in the bios:
https://www.dell.com/support/kbdoc/en-us/000124946/how-to-enable-or-disable-the-power-on-lid-open-feature-on-your-newer-notebook

However this is not optimal because when you now close your lid your laptop won’t go to sleep and stay on the whole time.
If this is something you can live with than it is good. But if you want that your laptop goes to sleep when closing the lid the only option left is repairing the lid sensor. But first of all make sure there is nothing that creates a magnetic field around your laptop since that can trigger the Hall-Effect Sensor of the Lid Switch.
If there is nothing that is creating a magnetic field, most likely your sensor is defect.
But for that I could not find anything how you could repair this on your model or even replace this part.

1 Like

Sorry for the late response my account is brand new, as such I hit the max messages per day for my account.

Maybe my phone but I doubt it I never had an issue with it before I more think of a sensor defect I’ll search for a replacement and replace it, but ATM I can live with it.

Thank you so much for your help! I’ve been fighting with this computer for a whole week.

I just have one small issue, it prevents the screen from going to sleep but does not prevent the touchpad to be disabled ;-;
Do you maybe know something to prevent the touch pad to be disabled ?

I’ll open it up later to remove the lid sensor if It’s even possibe without desoldering it.

Most likely that the lid sensor shutdown the TouchPad when triggert. This is most likely done by the Bios.
You can try to disable the lid sensor in the Bios and see if this helps. Also check for other powersettings in your Bios that may cause this problem.
The repair of the lid sensor can be very tricky. Since there is no replacement part for this. Also no tutorial or documentation how to fix it.
However I found out that the lid sensor of older models next to the hinge of the display.
Maybe take a look there to see if anything is obviously broken. Then you could search for the connection of the sensor to the Mainboard. Again sadly no documentation on where this is. However if you can find it, disconnect and reconnect it. Maybe this will help.
If you can’t get the sensor to work, I would also try the Dell Support. Maybe they have some more info’s on how to repair it.
If you have any questions left feel free to ask them here.