Pironman5 - OLED Sleep mode like Pironman4

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.

1 Like

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.

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

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.

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 ?

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)

(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

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

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.

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!

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.

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

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.