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

Several runtime optimizations to reduce CPU load and temperature and increase battery life #101

Open
wants to merge 250 commits into
base: main
Choose a base branch
from

Conversation

friebi
Copy link

@friebi friebi commented Nov 16, 2024

Hi, I love this project and also the MupiHAT that you guys have developed. I have two MupiBoxes in operation, each running a Raspberry Pi 3 B+.
When I started using your SW, I realized a pretty high CPU load even in idle state and after letting the system settle for a couple of minutes. At least in my case using Raspberry 3's. So, I started profiling and optimizing. I am running these changes successfully on my two boxes over the last couple of months, so it can be considered as tested.?

What did I do:

  • Reduce the frequency of the execution of several Mupi services
  • Move calls to jq from inside endless loops to outside

What did I achieve:

  • approx. 10° lower CPU temperature compared to your version
  • higher responsiveness of the Chromium UI due to more available CPU power
  • Drive-by improvement: Kernel 6.6 compatibility (Background: Stop using /sys/class/gpio – it’s deprecated)

Disadvantages:

  • Some settings will now require a reboot or at least a restart of the affected service to take effect

Further improvements:

  • I recommend to migrate autosetup/autosetup.sh and update/start_mupibox_update.sh into one script, because they share a lot of copied code and they start to diverge making it a mess to maintain.

When viewing the changes in this PR I recommend disabling whitespaces in view.
grafik

When merging this PR I recommend doing a squash merge, because otherwise a lot of commits would be merged onto the main branch.

friebi added 30 commits March 19, 2024 10:37
# Conflicts:
#	config/templates/dietpi.txt
# Conflicts:
#	config/templates/dietpi.txt
added dependency to gpiod apt package

# Conflicts:
#	scripts/OnOffShim/off_trigger.sh
# Conflicts:
#	scripts/OnOffShim/off_trigger.sh
# Conflicts:
#	scripts/OnOffShim/off_trigger.sh
This reverts commit 0b9b3cc.
This reverts commit a84ebcb.

# Conflicts:
#	update/start_mupibox_update-beta.sh
#	update/start_mupibox_update-developer.sh
This reverts commit b6c5b95.

# Conflicts:
#	update/start_mupibox_update-beta.sh
#	update/start_mupibox_update-developer.sh
# Conflicts:
#	README.md
friebi and others added 30 commits November 26, 2024 06:59
This reverts commit d10bc86.
# Conflicts:
#	scripts/mupibox/get_monitor.sh
# Conflicts:
#	autosetup/autosetup.sh
#	scripts/OnOffShim/off_trigger.sh
#	scripts/OnOffShim/poweroff.sh
#	update/start_mupibox_update.sh
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

Successfully merging this pull request may close these issues.

3 participants