General Community

Testers wanted: more room for tiles on ESP Screens (unofficial branch, report issues to me)

keyz182

What this is

I've been working on how ESP Screens firmware uses memory. On screens with PSRAM, a tile's lists and longer texts, and the data behind energy, calendar, vacuum, light preset and section cards, now go to PSRAM first. Five of each tile's settings also take one byte instead of a text. That leaves more internal RAM, and so more room for tiles.

Note: This is all vibe coded. I've validated it on my own hardware, but I haven't properly reviewed the code, beyond having a second agent review it independently.

On my 7 inch Waveshare (ESP32-S3 with PSRAM, 2 pages, 15 tiles), measured against 0.64.0 at the same uptime with the same YAML:

0.64.0 This branch
Room for tiles 18 KB (102 % used) 24 KB (79 % used)
Heap Free 37.3 KB 44.3 KB
Heap Minimum Free 18.8 KB 27.7 KB
Psram Free 3,829 KB 3,825 KB

It stayed flat over 13 hours, and every page and tile still drew and responded to taps.

This is not an official release. It lives on my fork, branch ao/esp-memory/memory-optimisation, based on 0.64.0. Please report anything about it to me only, as an issue on https://github.com/keyz182/homeassistant_espscreen/issues. Please don't report it to the upstream project's issues or Discord unless and until it's merged there.

Who I'd like to hear from

  • Any board with PSRAM. Does the room for tiles go up for you too?
  • Boards without PSRAM (for example the CYD). I have none, so this is untested on real hardware. The code builds for them, but I need to know nothing broke.

How to test

You build the branch from your screen's own YAML in ESPHome Builder. Your screen keeps its name, keys, Wi-Fi and plugins.

  1. Take the "before" numbers first (see "What to look for" below).

  2. In ESPHome Builder, open your screen's YAML. Back it up.

  3. Find your board's key in this line: files: [packages/<key>.yaml] (for example waveshare7).

  4. Open that file on my branch: https://github.com/keyz182/homeassistant_espscreen/blob/ao/esp-memory/memory-optimisation/packages/<key>.yaml Note the files under its packages: section.

  5. Replace the display: package in your YAML with the one below. Put your board's files in files:, each with packages/ in front. This example is for the 7 inch Waveshare:

    packages:
      display:
        url: https://github.com/keyz182/homeassistant_espscreen
        ref: ao/esp-memory/memory-optimisation
        refresh: 0s
        files:
          - packages/core.yaml
          - packages/boards/waveshare-esp32s3-7.yaml
          - packages/features/hotspot.yaml
    

Discussion 1

Add a comment
keyz182

Β· Edited

Sorry, that got cut off, continuing:

5. Replace the display: package in your YAML with the one below. Put your board's files in files:, each with packages/ in front. This example is for the 7 inch Waveshare:

packages:
  display:
    url: https://github.com/keyz182/homeassistant_espscreen
    ref: ao/esp-memory/memory-optimisation
    refresh: 0s
    files:
      - packages/core.yaml
      - packages/boards/waveshare-esp32s3-7.yaml
      - packages/features/hotspot.yaml

6. Add these two blocks. They make the code and fonts come from the same branch:

substitutions:
  FONT_DIR: "https://raw.githubusercontent.com/keyz182/homeassistant_espscreen/ao/esp-memory/memory-optimisation/fonts"

external_components:
  - source:
      type: git
      url: https://github.com/keyz182/homeassistant_espscreen.git
      ref: ao/esp-memory/memory-optimisation
      path: components
    refresh: 0s
    components: [smart_display]

If your YAML already has a substitutions: block, add the FONT_DIR line to it. Don't make a second one. 7. Select Install, then Wirelessly. The first build takes a while. 8. Wait 15 minutes, then take the "after" numbers.

The firmware row will still say 0.64.0. To check the new build is running, look for today's compile time on the screen's device page.

Don't press Update or Install for this screen in ESP Screen Manager, or "Update available" in Home Assistant, while testing. Either one puts the released firmware back. That is also how you go back when you're done.

What to look for Take each reading before and after, at the same time after boot (15 minutes is fine) and on page 1.

  1. Room for tiles. In the ESP Screen Manager editor, hover over the memory bar. It says "These tiles take X of the Y KB this screen has for tiles". X should stay the same and Y should go up
  2. Memory. On the screen's device page in Home Assistant, turn on Debug mode, then read Heap Free, Heap Minimum Free and Psram Free. Don't watch the screen's logs while you read them, because a log session uses some RAM itself
  3. Every tile works. Turn every page and tap each kind of tile you have. Look closely at energy, calendar (and its first view), vacuum, light presets, sections, locks, wide cards with direct controls, and the big one-button cards for lights and switches
  4. Stability. "Last boot" should not reset by itself. If you can, leave it overnight and check that Heap Free in History stays flat rather than sliding down.

What to send me

  • Your board (the ) and your ESPHome version.
  • The before and after numbers from 1 and 2.
  • Anything that looks or behaves differently from 0.64.0, with a photo if you can.
  • If the screen restarts by itself: the time, and the screen's log from just after the restart.

Thanks for testing!

Add your thoughts, a screenshot or a useful link.

Markdown & basic HTML
Paste or drop images Β· URLs on their own line become previews0 / 10,000
Create your account to join in

We need a verified email address to reach you about your contribution. Your address stays private.

Continue with GitHub

Your draft stays in this tab. Return here after verification.