# Pironman5 - OLED Sleep mode like Pironman4

**URL:** <https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623>\
**Category:** General\
**Created:** [September 7, 2024, 12:03pm UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623 "2024-09-07T12:03:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![TrungHuynh](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TrungHuynh](https://forum.sunfounder.com/u/TrungHuynh)\
**Post date:** [September 7, 2024, 12:03pm UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/1 "2024-09-07T12:03:44Z")

</div>

Hi there,

To help extend the life of the OLED screen, the Pironman4 has a default feature that turns off the display after 60 seconds of inactivity. You can easily reactivate the screen by pressing the power button. This is a great feature of the Pironman4. Does the Pironman5 have a similar feature? If not, could you provide guidance on how to modify the Python code to implement this functionality?

Thanks,  
Trung.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 9, 2024, 9:34am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/2 "2024-09-09T09:34:20Z")

</div>

Currently, you can temporarily use commands or modify the code to control the OLED screen’s power. We will investigate and optimize this issue in the future.

---

<div class="post-metadata">

**Author:** ![TrungHuynh](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TrungHuynh](https://forum.sunfounder.com/u/TrungHuynh)\
**Post date:** [September 9, 2024, 10:22am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/3 "2024-09-09T10:22:53Z")

</div>

Hi,

There is no option to control OLED via pironman5 command line. Below command line is only for pironman4

set to sleep mode: “al” means to “always on”. In sleep mode, short press the power button to wake up.

> pironman -al off

set to always on mode:

> pironman -al on

Set the duration in seconds,

> pironman -s 60

Please advise the corresponding command for pironman5 if its available. Or could you please show me the python source code file that I can add option or modify?

Thanks

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 10, 2024, 6:46am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/4 "2024-09-10T06:46:09Z")

</div>

Currently, there is no command to control the sleep mode of the OLED screen. Since the PI5 has a switch button, the OLED screen cannot enter sleep or wake mode through the button.

There is also no support for this in the Python source code. We will consider implementing this feature in the future, but it will take time to find a good solution.

---

<div class="post-metadata">

**Author:** ![xGattox](https://avatars.discourse-cdn.com/v4/letter/x/5e9695/32.png) [@xGattox](https://forum.sunfounder.com/u/xGattox)\
**Post date:** [September 10, 2024, 9:53pm UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/5 "2024-09-10T21:53:15Z")

</div>

Pironman4 has a switch too, but its oled screen goes into sleep mode until you touch the switch.  
Isn’t it possible to make it works at the same way ?

---

<div class="post-metadata">

**Author:** ![pj530i](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@pj530i](https://forum.sunfounder.com/u/pj530i)\
**Post date:** [September 11, 2024, 11:21pm UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/6 "2024-09-11T23:21:35Z")

</div>

Not exactly what you’re looking for but I forked the code and added support for oled power control via command line and HTTP request (did not update the dashboard to add a toggle, don’t think it’d be hard)

> **[GitHub - pj530i/pironman5 at oled\_control](https://github.com/pj530i/pironman5/tree/oled_control)**
>
> oled\_control

(this forum limits links per post for some reason. repo for pm\_auto is)/pj530i/pm\_auto/tree/oled\_control

Command line option syntax:  
-oe [OLED\_ENABLE], --oled-enable [OLED\_ENABLE]  
OLED enable True/False

Example HTTP request:  
curl -X POST -H “Content-Type: application/json” -d ‘{“data”:{“auto”:{“oled\_enable”:true}}}’ [http://127.0.0.1:34001/api/v1.0/set-config](http://127.0.0.1:34001/api/v1.0/set-config)

The oled\_control branch of pironman5 should have the install.py point to my oled\_control branch of pm\_auto automatically. Main branch has stuff very specific to my setup

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 12, 2024, 6:37am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/7 "2024-09-12T06:37:59Z")

</div>

xGattox: No. The Pironman V2 uses custom button, while the button on the Pironman 5 are directly connected to the Raspberry Pi’s power switch. Pressing the button will trigger the Raspberry Pi to shut down, so there’s no way to use this button to control the OLED.

---

<div class="post-metadata">

**Author:** ![TrungHuynh](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TrungHuynh](https://forum.sunfounder.com/u/TrungHuynh)\
**Post date:** [September 12, 2024, 6:50am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/8 "2024-09-12T06:50:52Z")

</div>

Hi @pj530i,

I’ve tried it out, and it works great—thanks for your effort!

Hi @SunFounder_Moderator,

Could we implement the following: pressing and holding for 3-5 seconds should trigger a shutdown while pressing and releasing in less than 3 seconds will display the OLED screen?

Thanks!

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 12, 2024, 9:28am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/9 "2024-09-12T09:28:34Z")

</div>

It is not possible. A short press will trigger the Raspberry Pi to shut down.

If you are running the Raspberry Pi Bookworm Desktop system, pressing the power button on the Pi 5 twice will shut it down.

If you are using the Raspberry Pi Bookworm Lite system without a desktop, pressing the power button on the Pi 5 once will cause it to shut down.

Therefore, it is not possible to use the button to control the sleep and wake modes of the OLED screen.

---

<div class="post-metadata">

**Author:** ![TrungHuynh](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TrungHuynh](https://forum.sunfounder.com/u/TrungHuynh)\
**Post date:** [September 12, 2024, 9:42am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/10 "2024-09-12T09:42:19Z")

</div>

Ok thanks for your clarification @SunFounder_Moderator I think we can merge code from @pj530i and implement on/off switch in the dashboard and call the api to on/off oled via the portal

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 13, 2024, 5:48am UTC](https://forum.sunfounder.com/t/pironman5-oled-sleep-mode-like-pironman4/1623/11 "2024-09-13T05:48:43Z")

</div>

This method can be implemented, but it is not very meaningful. Since the data displayed on the OLED screen is already available on the PC dashboard, adding a switch function for the OLED screen on the PC dashboard makes the OLED screen redundant. The PC dashboard can display all the data from the OLED screen. We are considering creating a command to control the OLED screen’s power.
