How to fully disable sleep related functions?

,

I have a small lab system ( https://www.hardkernel.com/shop/odroid-h3-plus/ ). Running Fedora 41 with KDE. Recently decided to run https://www.zigbee2mqtt.io/ through a Docker image. As a coordinator\gateway am using a https://www.amazon.ae/SONOFF-ZBdongle-Universal-IoBroker-Wireless/dp/B0B6P22YJC

Everything started out well. Then I switched to my main pc. After an hour I realized that the coordinator is no longer capturing messages.

After some googling I came to a realization that it is 99% related to usb autosuspend. So I added usbcore.autosuspend=-1 to grub’s config. And the problem seemed to go away (on the first day I reproduced it a few times to be sure that it wasn’t a onetime glitch).

And, just now, after 2 days of silence,I caught it again(all of a sudden). Zigbee2mqtt, which has a front end, which I accessed from my main system, was working well. But did not capture any messages (like the first times).

So I switched my monitor input to the lab pc, and decided to look whats going on. At that moment everything started working again (seems to be the moment I logged in or something).

I have done another round of searching what could be done, and, for the moment, I disable autosuspend by timeout from the settings.

Any idea how to address this further?

A noobish question, but is there a possibility to somehow “ping” a device/usb port in order to always keep it online (and eliminate the scenario of the device getting suspended), which I could wrap in a script and set a cronjob for it?

With the release of fedora (approx 38 if I remember correctly) fedora switched to automatically suspend the desktops after 15 minutes idle. This caused problems for many users who used their systems as a 24hr online server. Idle is defined as no keyboard or mouse activity and does not include remote connections.

Suspend/sleep/hibernation can be disabled with a couple of changes. see the following links for details.

and

On my system (f43) I do not have the /etc/systemd/sleep.conf.d directory but instead placed the sleep.conf file as shown below. I believe that you could create the /etc/systemd/sleep.conf.d/ directory and place your sleep.conf file there as well.

$ cat /etc/systemd/sleep.conf 
[Sleep]
AllowSuspend=no
AllowSuspendThenHibernate=no
AllowHibernate=no
AllowHybridSleep=no

You also could mask the appropriate services and have the same effect system wide and not limited to your user environment.
Those services are systemd-suspend, systemd-sleep, systemd-suspend-then-hibernate, & systemd-hibernate.
They can be made inactive with sudo systemctl mask systemd-{suspend,sleep,suspend-then-hibernate,hibernate}.service.

1 Like

Many thanks. Will try it tomorrow.

Well, I am now testing the “maybe I needed to reboot” after those changes. I have made the changes more than 24 hours ago. All seemed fine. An hour ago I started to notice delayed reaction to button presses being received by the receiver.

And, once again, the moment I turned the monitor on, moved the mouse, all started working like a clock.

Well, I am now testing the “maybe I needed to reboot” after those changes. I have made the changes more than 24 hours ago. All seemed fine. An hour ago I started to notice delayed reaction to button presses being received by the receiver.

And, once again, the moment I turned the monitor on, moved the mouse, all started working like a clock.

Just to confirm, the changes, that were to be made, are:

  1. Disable suspend in KDE’s Power Management.
  2. /etc/systemd/sleep.conf
    

Correct? (I also found a ‘block suspend’ in the tray, and created a

ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="on"

rule under /etc/udev/rules.d/

I am also exercising one interesting moment - this thing has happened 2-3 times already. But never in the morning - always in the evening.

I have 3 pc’s connected to my monitor - my home pc(dp), my working pc(hdmi), and the lab one(also hdmi). And evening is the moment when I suspend my working pc (Ubuntu), switch to my main(win10). And, later, I turn it off and move to the tv. And this is the time period, where I usually find that the light controls are unresponsive (controller fails to capture messages).

Although today it was strange, and I first noticed that the few clicks were processed with a delay. After it was zero responsivness. But all returned to normal once I switched the monitor input to the lab pc (and the kb and mouse to bt… and made a mouse movement).

Have a hunch there is some suspend/sleep trigger happening by the monitor going to sleep related event(I’ve seen google bring up this topic a few times).