# uConsole-Sleep v1.3

**URL:** <https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612>\
**Category:** uConsole\
**Tags:** uconsole, power-saving, script\
**Created:** [February 4, 2025, 4:55pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612 "2025-02-04T16:55:46Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![paragonnov](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/paragonnov/32/10914_2.png) [@paragonnov](https://forum.clockworkpi.com/u/paragonnov)\
**Post date:** [March 16, 2025, 5:39pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/21 "2025-03-16T17:39:11Z")

</div>

Can you tell me the output of the command below?

```sh
cat /sys/class/backlight/backlight@0

```

---

<div class="post-metadata">

**Author:** ![teo](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/teo/32/11016_2.png) [@teo](https://forum.clockworkpi.com/u/teo)\
**Post date:** [March 16, 2025, 7:00pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/22 "2025-03-16T19:00:08Z")

</div>

It is dir.

/bl\_power?

```auto
cat /sys/class/backlight/backlight@0/bl_power

```

**while screen off:**  
4

**while screen is active:**  
0

---

<div class="post-metadata">

**Author:** ![paragonnov](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/paragonnov/32/10914_2.png) [@paragonnov](https://forum.clockworkpi.com/u/paragonnov)\
**Post date:** [March 17, 2025, 1:00am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/23 "2025-03-17T01:00:05Z")

</div>

```sh
ls -la /sys/class/backlight/backlight@0/

```

---

<div class="post-metadata">

**Author:** ![paragonnov](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/paragonnov/32/10914_2.png) [@paragonnov](https://forum.clockworkpi.com/u/paragonnov)\
**Post date:** [March 17, 2025, 1:02am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/24 "2025-03-17T01:02:14Z")

</div>

```sh
cat /boot/firmware/config.txt

```

---

<div class="post-metadata">

**Author:** ![teo](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/teo/32/11016_2.png) [@teo](https://forum.clockworkpi.com/u/teo)\
**Post date:** [March 17, 2025, 10:26am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/25 "2025-03-17T10:26:29Z")

</div>

```auto
ls -tlra /sys/class/backlight/backlight@0/

-rw-r--r-- 1 root root 16384 мар 16 11:43 uevent
drwxr-xr-x 3 root root 0 мар 16 11:43 ..
drwxr-xr-x 3 root root 0 мар 16 11:43 .
-r--r--r-- 1 root root 16384 мар 16 11:43 type
lrwxrwxrwx 1 root root 0 мар 16 11:43 subsystem -> ../../../../../class/backlight
-r--r--r-- 1 root root 16384 мар 16 11:43 max_brightness
lrwxrwxrwx 1 root root 0 мар 16 11:43 device -> ../../../backlight@0
-r--r--r-- 1 root root 16384 мар 16 21:53 scale
drwxr-xr-x 2 root root 0 мар 16 21:53 power
-r--r--r-- 1 root root 16384 мар 16 21:53 display_name
-r--r--r-- 1 root root 16384 мар 16 21:53 actual_brightness
-rw-r--r-- 1 root root 16384 мар 16 21:58 bl_power
-rw-rw-r-- 1 root video 16384 мар 16 22:02 brightness

```

```auto
[all]
ignore_lcd=1
max_framebuffers=2
disable_overscan=1
dtparam=audio=on
dtoverlay=audremap,pins_12_13
dtoverlay=dwc2,dr_mode=host
dtparam=ant2

[pi4]
#dtoverlay=clockworkpi-devterm
dtoverlay=clockworkpi-uconsole
dtoverlay=vc4-kms-v3d-pi4,cma-384
dtparam=spi=on

[pi5]
dtoverlay=clockworkpi-uconsole-cm5
dtoverlay=vc4-kms-v3d-pi5,cma-384
dtoverlay=spi0-0cs
dtparam=pciex1=off
dtoverlay=test-rp1-audio-out

##only edit the section of the pi you have, other section will be ignored.
##if you have a devterm uncomment devterm and comment out entries with uconsole.

```

---

<div class="post-metadata">

**Author:** ![paragonnov](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/paragonnov/32/10914_2.png) [@paragonnov](https://forum.clockworkpi.com/u/paragonnov)\
**Post date:** [March 17, 2025, 11:50pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/26 "2025-03-17T23:50:04Z")

</div>

Could you put initial\_turbo=0  
on your config.txt?

---

<div class="post-metadata">

**Author:** ![paragonnov](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/paragonnov/32/10914_2.png) [@paragonnov](https://forum.clockworkpi.com/u/paragonnov)\
**Post date:** [March 17, 2025, 11:52pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/27 "2025-03-17T23:52:56Z")

</div>

systemd initialize the daemon too early i think.  
If true, i must make my script lazy

---

<div class="post-metadata">

**Author:** ![teo](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/teo/32/11016_2.png) [@teo](https://forum.clockworkpi.com/u/teo)\
**Post date:** [March 22, 2025, 5:59pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/28 "2025-03-22T17:59:48Z")

</div>

> [@paragonnov](#):
>
> initial\_turbo=0

cant see any difference with config:

```auto
[all]
initial_turbo=0
ignore_lcd=1
max_framebuffers=2
disable_overscan=1
dtparam=audio=on
dtoverlay=audremap,pins_12_13
dtoverlay=dwc2,dr_mode=host
dtparam=ant2

[pi4]
#dtoverlay=clockworkpi-devterm
dtoverlay=clockworkpi-uconsole
dtoverlay=vc4-kms-v3d-pi4,cma-384
dtparam=spi=on

[pi5]
dtoverlay=clockworkpi-uconsole-cm5
dtoverlay=vc4-kms-v3d-pi5,cma-384
#dtoverlay=spi0-0cs
dtparam=pciex1=off
#dtoverlay=test-rp1-audio-out
enable_uart=0

```

---

<div class="post-metadata">

**Author:** ![paragonnov](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/paragonnov/32/10914_2.png) [@paragonnov](https://forum.clockworkpi.com/u/paragonnov)\
**Post date:** [March 25, 2025, 4:18am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/29 "2025-03-25T04:18:11Z")

</div>

I think it’s working well.  
Your default clock range is  
Min: 1500000  
Max: 2400000

And

In the sleep state  
Min: 1500000  
Max: 1500000  
It has the expected value of.

If wake up from a sleep state, it changes as follows.  
Sleep → Wake  
1.5GHz~1.5GHz → 1.5GHz~2.4GHz

Set `arm_freq_min` in `config.txt` to lower the minimum clock further if you want  
Example: `arm_freq_min=300`

If you apply this, the expected value is as follows.  
Sleep → Wake  
0.3GHz~0.3GHz → 0.3GHz~2.4GHz

```sh
sudo ./sleep_power_control 
/sys/bus/usb/devices/1-1.1/power/autosuspend_delay_ms = 0
saving_cpu_freq_min: 1500000
saving_cpu_freq_max: 1500000
default_cpu_freq_min: 1500000
default_cpu_freq_max: 2400000
cpu freq max: 2400000
cpu freq min: 1500000
Error occurred: [Errno 16] Device or resource busy, on init. ignored
Monitoring /sys/class/backlight/backlight@0/bl_power for changes...
cpu freq max: 2400000
cpu freq min: 1500000
Error occurred: [Errno 16] Device or resource busy
kb power state: unbind
cpu freq min: 1500000
cpu freq max: 1500000
cpu freq max: 2400000
cpu freq min: 1500000
kb power state: bind
kb power state: unbind
cpu freq min: 1500000
cpu freq max: 1500000

```

The above error is because you duplicated it with the system daemon.

---

<div class="post-metadata">

**Author:** ![teo](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/teo/32/11016_2.png) [@teo](https://forum.clockworkpi.com/u/teo)\
**Post date:** [March 28, 2025, 10:43am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/30 "2025-03-28T10:43:38Z")

</div>

Thank you for clarification

---

<div class="post-metadata">

**Author:** ![William\_Wilkins](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/william_wilkins/32/12261_2.png) [@William\_Wilkins](https://forum.clockworkpi.com/u/William_Wilkins)\
**Post date:** [May 21, 2025, 10:43am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/31 "2025-05-21T10:43:24Z")

</div>

The power button didn’t remap. How do i manually do it or trigger it?

---

<div class="post-metadata">

**Author:** ![jutleys](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jutleys](https://forum.clockworkpi.com/u/jutleys)\
**Post date:** [May 21, 2025, 4:06pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/32 "2025-05-21T16:06:24Z")

</div>

Will this work on al the different OS available from rex inc bookworm etc?

Got it working on the Dragon OS worked perfectly thank you. I will test it on Bookworm and ubuntu.

---

<div class="post-metadata">

**Author:** ![opt385](https://avatars.discourse-cdn.com/v4/letter/o/b38774/32.png) [@opt385](https://forum.clockworkpi.com/u/opt385)\
**Post date:** [June 30, 2025, 9:30am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/33 "2025-06-30T09:30:00Z")

</div>

Hi @paragonnov! Great stuff. Thank you very much for developing this.

I have a little problem with the `sleep-power-control.service`. It does not start as intended:

```sh
$ sudo systemctl status sleep-power-control.service
× sleep-power-control.service - Sleep Power Control Based on Display and Sleep State
     Loaded: loaded (/etc/systemd/system/sleep-power-control.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2025-06-29 22:09:12 BST; 12h ago
   Duration: 467ms
    Process: 871 ExecStart=/usr/local/bin/sleep_power_control (code=exited, status=1/FAILURE)
   Main PID: 871 (code=exited, status=1/FAILURE)
        CPU: 465ms

Jun 29 22:09:12 clockworkpi systemd[1]: sleep-power-control.service: Scheduled restart job, restart counter is at 5.
Jun 29 22:09:12 clockworkpi systemd[1]: Stopped sleep-power-control.service - Sleep Power Control Based on Display and Sleep State.
Jun 29 22:09:12 clockworkpi systemd[1]: sleep-power-control.service: Start request repeated too quickly.
Jun 29 22:09:12 clockworkpi systemd[1]: sleep-power-control.service: Failed with result 'exit-code'.
Jun 29 22:09:12 clockworkpi systemd[1]: Failed to start sleep-power-control.service - Sleep Power Control Based on Display and Sleep State.

```

From what I see it cannot find a USB device:

```sh
$ sudo /usr/local/bin/sleep_power_control
Traceback (most recent call last):
  File "sleep_power_control.py", line 62, in <module>
Exception: there's no matched kb
[PYI-15095:ERROR] Failed to execute script 'sleep_power_control' due to unhandled exception!

```

In the source code I find out you are looking for these `ids=["feed:0000", "1eaf:0003"]`. But non of these is present in my system:

```sh
$ lsusb
Bus 001 Device 004: ID 1eaf:0024 Leaflabs uConsole
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

```

I am running bookworm as provided by @Rex. Ref: [Bookworm 6.6.y for the uConsole and DevTerm](https://forum.clockworkpi.com/t/bookworm-6-6-y-for-the-uconsole-and-devterm/13235)

I guess `1eaf:0024` looks kind of similar to what you are looking for. Do you think I can just add it to the list and recompile the package or the problem may be more complex than that?

Thanks!

---

<div class="post-metadata">

**Author:** ![hotellonely](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/hotellonely/32/10988_2.png) [@hotellonely](https://forum.clockworkpi.com/u/hotellonely)\
**Post date:** [August 12, 2025, 9:35am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/34 "2025-08-12T09:35:44Z")

</div>

I’m still having random screen rotation issue…, is it possible to bypass this step? it doesn’t always happen, but when it happens it’s pretty hard to recover from unless do a reboot.

---

<div class="post-metadata">

**Author:** ![Adam\_Vigneault](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adam_vigneault/32/13506_2.png) [@Adam\_Vigneault](https://forum.clockworkpi.com/u/Adam_Vigneault)\
**Post date:** [August 12, 2025, 10:36am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/35 "2025-08-12T10:36:50Z")

</div>

Any chance this is renaming `/usr/bin/lxde-pi-shutdown-helper` to `/usr/bin/pishutdown`? Appears to break the logout command on main menu.

---

<div class="post-metadata">

**Author:** ![m1shg4n](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/m1shg4n/32/13629_2.png) [@m1shg4n](https://forum.clockworkpi.com/u/m1shg4n)\
**Post date:** [September 1, 2025, 7:08pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/36 "2025-09-01T19:08:00Z")

</div>

If you use SWAY, you can add such lines to the config

```auto
### Idle configuration
exec swayidle -w \
    timeout 300 'swaymsg "output * dpms off"; \
                swaymsg "input 7855:36:ClockworkPI_uConsole_Mouse events disabled"; \
                swaymsg "input 7855:36:ClockworkPI_uConsole_Keyboard events disabled"; \
                swaymsg "input 7855:36:ClockworkPI_uConsole_Consumer_Control events disabled"' \
    resume 'swaymsg "output * dpms on"; \
            swaymsg "input 7855:36:ClockworkPI_uConsole_Mouse events enabled"; \
            swaymsg "input 7855:36:ClockworkPI_uConsole_Keyboard events enabled"; \
            swaymsg "input 7855:36:ClockworkPI_uConsole_Consumer_Control events enabled"'

```

This will turn off the display, keyboard and mouse after 5 minutes of inactivity. And turn it back on when you press the power button.

---

<div class="post-metadata">

**Author:** ![m1shg4n](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/m1shg4n/32/13629_2.png) [@m1shg4n](https://forum.clockworkpi.com/u/m1shg4n)\
**Post date:** [September 1, 2025, 7:13pm UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/37 "2025-09-01T19:13:21Z")

</div>

I used crutches for the sake of customization and maintaining a single style. I did some magic with TOFI and got a great menu for the power key.

[![](https://img.youtube.com/vi/mbOeQut_IOI/maxresdefault.jpg "uConsole power menu (SWAY/TOFI)") ](https://www.youtube.com/watch?v=mbOeQut_IOI)

---

<div class="post-metadata">

**Author:** ![trinity](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/trinity/32/16167_2.png) [@trinity](https://forum.clockworkpi.com/u/trinity)\
**Post date:** [September 2, 2025, 3:35am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/38 "2025-09-02T03:35:18Z")

</div>

Note that these identifiers can change from system to system (I don’t know if this differs between units or between firmware versions). For example, your mouse is `7855:36:ClockworkPI_uConsole_Mouse` and mine is `65261:0:Clockwork_uConsole_Keyboard_Mouse`. One can determine one’s device identifiers with `$ swaymsg -t get_inputs`.

---

<div class="post-metadata">

**Author:** ![m1shg4n](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/m1shg4n/32/13629_2.png) [@m1shg4n](https://forum.clockworkpi.com/u/m1shg4n)\
**Post date:** [September 2, 2025, 7:33am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/39 "2025-09-02T07:33:28Z")

</div>

And there’s still some work to do. Install swayidle (sudo apt install swayidle) and disable processing of short presses of the power button (sudo nano /etc/systemd/logind.conf)

```auto
HandlePowerKey=ignore
HandlePowerKeyLongPress=poweroff

```

---

<div class="post-metadata">

**Author:** ![white-round-square](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/white-round-square/32/10385_2.png) [@white-round-square](https://forum.clockworkpi.com/u/white-round-square)\
**Post date:** [September 2, 2025, 11:56am UTC](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612/40 "2025-09-02T11:56:47Z")

</div>

> [@m1shg4n](#):
>
> If you use SWAY,

hey, what key did you choose for `$mod`?

[Previous page](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612.md?page=1)

[Next page](https://forum.clockworkpi.com/t/uconsole-sleep-v1-3/15612.md?page=3)
