Skip to content

Conversation

@Sniffleupagus
Copy link
Contributor

@Sniffleupagus Sniffleupagus commented Mar 1, 2025

Stops saving the UI to a file every update, and serves it from memory instead. Improves update performance.

Also adds syslog logging (journalctl -fu pwnagotchi) and disabling log files by setting config.toml values to "".

Faces mod improvements to image sizing and scaling. Slight performance increase on updates when face has not changed.

Description

view.py copies the _canvas to _web_canvas after doing all of the drawing. web/handler.py has been changed to pull the _web_canvas image and serve it up through memory stream instead of saving as a file.

Motivation and Context

Solves wear and tear on SD and unnecessary SD usage. Improves cpu "wait" times.

Fixes an issue where large dummy displays spend a lot of time saving the pwnagotchi.png and occupying the filesystem.

  • [ X ] I have raised an issue to propose this change (required)

How Has This Been Tested?

Tested on noai branch of jayofelony (forked into no-png-file branch), and on banangotchi

Tested using an existing 2.9.5-3 pwnagotchi, editing the files in place. Then cloned a fresh copy of the repo and made a branch, ,testing against the cloned repo.

It does not affect other code, unless something outside pwnagotchi code depends on that image.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [X ] My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • [X ] I've read the CONTRIBUTION guide
  • [ X] I have signed-off my commits with git commit -s

@Sniffleupagus
Copy link
Contributor Author

I've added more stuff since submitting. Changed faces mod stuff to scale images (like neon's PR), but also scales to fit a defined box on screen maintaining aspect ratio, centering image in box.

@Sniffleupagus Sniffleupagus changed the title Eliminate /var/tmp/pwnagotchi/pwnagotchi.png Performance improvements through less SD usage (mostly pwnagotchi.png and logging) Mar 9, 2025
@Sniffleupagus
Copy link
Contributor Author

Bloated. I'm splitting it out into separate PRs. :)

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.

1 participant