Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 at 100% CPU #1

Open
FartyMcfly opened this issue Sep 17, 2021 · 1 comment
Open

python3 at 100% CPU #1

FartyMcfly opened this issue Sep 17, 2021 · 1 comment

Comments

@FartyMcfly
Copy link

Noticed that indenting the sleep(1) command in the autobrightness.py got the CPU usage to die down. I do not believe sleep was getting used in the script by default. Not a python guy so maybe I am missing something, but that worked for me.

@morphias2004
Copy link

morphias2004 commented May 14, 2022

Noticed that indenting the sleep(1) command in the autobrightness.py got the CPU usage to die down. I do not believe sleep was getting used in the script by default. Not a python guy so maybe I am missing something, but that worked for me.

@FartyMcfly you are indeed correct! 👍

The SLEEP was not inside the WHILE loop, so the script was looping at the native frequency of whatever CPU it was running on and flogging the CPU core.

It was causing my Pi4 to overheat and lock up.

A minor typo on the creator's behalf, but easily fixed.

I forked it here with the fix and also resolved some of the permission issues as well as adding support for Waveshare displays.

https://github.com/morphias2004/PiAutoDim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants