ESP32 CYD keeps restarting: my £10 homelab screen and the 5 second watchdog
I wanted a little screen on my desk that tells me if anything in the homelab needs me, without opening a laptop. Nothing fancy. A number for "things waiting for you", a number for known-exploited CVEs, whether the server
I wanted a little screen on my desk that tells me if anything in the homelab needs me, without opening a laptop. Nothing fancy. A number for "things waiting for you", a number for known-exploited CVEs, whether the servers are up, and when the next bus is.
So I bought an ESP32-2432S028R, the one everyone calls the Cheap Yellow Display or CYD. About a tenner. 2.8 inch, 320x240, resistive touch, ESP32 on the back. I flashed it with ESPHome and built the whole thing over about a day, around 12 October 2026, and nearly every hour of it was something going wrong. Here's the lot.
What it shows
Four pages, you tap the screen to flip between them:
- Warden: things waiting for me to approve, known-exploited CVEs (goes red if it's above 0), open findings, pending patches and reboots. Warden is my homelab security tool.
- Buses: next two buses each way at my stop, counting down, from TfL's free API.
- Homelab: nodes up, services up in Uptime Kuma, backups fresh or not, the busiest CPU, RAM and disk.
- Network: internet up and ping, how many devices are on the LAN, bans, warden events in the last 24 hours.
I styled it like e-ink. Paper colour background, black ink, one red ink for anything bad, Libre Baskerville for the big numbers and IBM Plex Mono for the labels. Backlight at 40% so it's not a torch on the desk, and I run the backlight PWM at 20 kHz because lower frequencies flicker when you dim it.
Problem 1: it wouldn't even build on my server
First go, I tried compiling on the box that runs my agents. It had 3.2 GB free and was 91% full. ESPHome on the arduino framework still pulls in ESP-IDF 5.5.5, and that wants several GB. Build failed. I cleaned up and built on my Mac instead. A full build later came to about 3 GB, so don't try this on a squeezed VM.
Problem 2: ESPHome 2026.9.1 had moved things about
I was on ESPHome 2026.9.1 and a few things had changed under me:
-
http_requestheaders:is nowrequest_headers: - the
ili9xxxdisplay now requiresinvert_colors:, it won't guess -
id: clockis reserved, so I called my time sourcesntp_time
Then two more that esphome config happily passed, and only a full compile caught:
- I'd named a script
poll. That collides with the C library'spoll(). Rename it. -
request_headerslambdas have to return aconst char*, not a string. I ended up with a global buffer.
Lesson there: esphome config passing means the YAML is valid. It doesn't mean it'll compile. Do the full compile before you get excited.
Problem 3: I leaked my own token four times
The first version talked straight to warden's API with a bearer token. Turns out esphome config and compile print the token in their output if it's written inline. I did that four times during setup before it clicked, and revoked all four.
The fix is boring: always use !secret, because ESPHome redacts those in its output. And later on I got rid of the token on the board completely, more on that below.
Problem 4: fuzzy static
First flash, the screen showed fuzzy static. My board is the two-USB version (micro-USB and USB-C), and those use an ST7789 controller, not the ILI9341 the older one-USB version has. So I made the display chip a setting you can override. That was part of it, but not the real cause.
The real clue was this line in the log:
Could not allocate buffer for display!
A full 320x240 frame in 16-bit colour is 320 × 240 × 2 bytes, about 150 KB. This ESP32 has no PSRAM. Later, with a debug build, the board reported 216 KB of free heap in total but the biggest single free block was 110 KB. A frame buffer needs one unbroken lump, so it was never going to fit.
The fix was switching from ili9xxx to ESPHome's newer mipi_spi driver. It has presets for all three CYD versions built in (ESP32-2432S028-7789 for the two-USB one, ESP32-2432S028-9342, and ESP32-2432S028 for the one-USB one) and it draws the screen in strips with a buffer of about 20 KB. Full 16-bit colour still, and the screen came up properly after that.
display:
- platform: mipi_spi
model: ${display_model} # ESP32-2432S028-7789 on my two-USB board
invert_colors: ${invert_colors}
rotation: 270
If your CYD shows fuzzy static, it's either the wrong variant or this. Check the log for that buffer line before you start swapping drivers about.
Problem 5: it kept restarting and blinking
Now it worked, but every so often it rebooted and the screen blinked. The log had lines like this:
interval took … 5414 ms
The board was doing HTTPS calls to warden and TfL itself. TLS on an ESP32 is slow, and those calls blocked the main loop for 5 to 6 seconds a minute. The ESP's watchdog is 5 seconds. So it kept tripping it.
I could have fiddled with timeouts, but the real answer was to stop making a £10 microcontroller do the slow bit. I moved all of it to a small script on my agent box:
- A Python script runs every 60 seconds on a systemd timer. It pulls from warden, TfL, Beszel, Uptime Kuma, my backup check and a LAN scan, and writes one small JSON file. The slow ones are cached, Kuma and the LAN scan every 5 minutes, backups every 30.
- A tiny read-only web server shares that file on the LAN.
- The board does one plain HTTP GET every 30 seconds. The file was 462 bytes when I checked it on 18 October 2026.
- The screen only redraws when the JSON actually changes, plus once a minute for the bus countdown. That got rid of the blink.
Bonus: no token lives on the board any more. If someone nicks it off my desk they get a screen and my WiFi, that's it. If a source fails it just drops off its page instead of breaking the lot.
Things I left off on purpose
Two things I tried and dropped because the numbers would lie:
- AdGuard stats. My router's AdGuard API returned 401, it's tied to the router's web login session. Not worth hacking round.
-
NetBird peers. It said
Peers 1/9, but it only counts peers with a live tunnel right now. On a glance screen "1/9" looks like an outage when it isn't.
A number on a screen you glance at needs to mean what it looks like it means, or it's worse than nothing.
Did the restarts stop?
Mostly yeah, and I'll be honest about the bit I can't explain. After moving to the feed, it had 3 restarts between 09:41 and 09:53 that morning. I added ESPHome's debug component so the board reports its reset reason, free heap and loop time on its own web page. Then it ran 4 hours with zero restarts, uptime 14,387 seconds, and the restarts didn't come back.
I never caught the cause. My best guess is me, streaming the board's live logs over and over and doing repeated OTA updates that morning. If it comes back, the reset reason is right there on its web page and I don't need a USB cable to read it.
If you're building one
- Work out which CYD you've got first. Two USB ports means ST7789, one means ILI9341.
- Use
mipi_spi, notili9xxx. It's deprecated anyway and the full-frame buffer won't fit. - Don't do TLS on the board if you can help it. Let a proper computer do the slow work and give the ESP32 something small and dull to fetch.
- Keep secrets in
!secret. ESPHome will print anything else. - Full compile, not just
esphome config.
What have you got on your desk telling you the homelab's alright? Mine's a tenner and it took a day, but I look at it more than any dashboard I've got.
🤖 Drafted with AI assistance from my own homelab notes, logs and repos, and fact-checked against them before publishing.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.
