KAC: A small cube becomes a status display for network, firewall and NAS

Summary

In October 2026 I wrote my own firmware for the GeekMagic SmallTV Ultra, a cube-shaped Wi-Fi display with an ESP8266: KAC, the KleinerAnzeigeComputer ("little display computer"). It shows the throughput of my two internet lines, the state of the firewall and the Proxmox host and the NAS disks in rotation, does not flicker and broadcasts no open Wi-Fi in normal operation. The firmware can be installed directly through the update page of the factory firmware, also shows your own pictures and GIFs, and this post shows how to build your own dashboard for it.

The device

The GeekMagic SmallTV Ultra is a small cube with an IPS display. Inside are an ESP8266 as an ESP-12F module with 4 MB of flash and about 80 KB of RAM, and a 240 × 240 pixel IPS panel with an ST7789 controller. Power comes via USB-C; a serial port is only available via solder pads inside the case.

Out of the box it shows the time, weather and pictures. It is set up through an open Wi-Fi called GIFTV and then fetches its data from the internet. It cannot show your own values, and that is exactly what I wanted: upload and download of my two internet connections, at a glance next to the monitor.

Two SmallTV Ultra with KAC firmware on a desk, a test page on the left, the NAS page with RAID status and disk temperatures on the right
Two devices with KAC: a test page on the left, the NAS page on the right. Taken with version 0.1.1, when the bars were still olive instead of grey.
Factory firmware display with the instructions: 1. WiFi GIFTV, 2. http://192.168.4.1, next to a QR code
The factory firmware during setup: open Wi-Fi GIFTV, settings at 192.168.4.1.

First attempt: third-party firmware with a catch

First I tried the alternative firmware u1pns/smalltv-ultra. It can show panels, pages sent by a program on the network, and that worked right away. Two things bothered me, though: every new page redraws the whole screen, which looks restless with values updated every second. And the device permanently broadcasts its own access point, with the built-in password 12345678.

That is a deliberate design there: the access point belongs to the rescue mode and is meant to make sure the device can always be reached. It cannot be switched off, and the web interface credentials are fixed in the image as well. Anyone within radio range can connect and upload any firmware. I did not want that in my network.

Own firmware: the bootloader decides

So I went for my own firmware, written with the Arduino core for the ESP8266, the TFT_eSPI graphics library and ArduinoJson. The display pinout comes from the ESPHome device page for this model: hardware SPI on GPIO14 and GPIO13, DC on GPIO0, reset on GPIO2, no chip select, SPI mode 3, inverted backlight on GPIO5.

The interesting question was how to get the firmware onto the device without opening the case. An Arduino image for the ESP8266 starts with a small bootloader called eboot; the actual application follows from address 0x1000. I compared the images: factory firmware V9.0.50, the alternative firmware and my own build with PlatformIO and Arduino core 3.1.2 have a byte-identical bootloader in the first 4096 bytes and the same flash header (DIO, 4 MB, 40 MHz).

So the update page of the factory firmware simply accepts the custom image. The only limit is space: next to the running factory firmware there are, by my estimate, about 500 KB free, and KAC needs about 390 KB. I tried it on a second, identical device with factory firmware V9.0.51: upload the file, "Update Success! Rebooting...", done.

curl -F "firmware=@firmware.bin" http://<device>/update

Setup without a default password

In normal operation KAC is only a Wi-Fi client and broadcasts nothing. Setup uses the power plug, an idea from the alternative firmware, which starts its rescue mode that way: cut the power three times in a row, each time after less than ten seconds, and the setup mode starts. A counter in flash remembers the short boots; if the device runs longer, it resets.

The device then opens a Wi-Fi named KAC plus the last three bytes of its MAC address, for example KAC-4670fa. The password has ten characters, is generated randomly every time and appears only on the display. Whoever wants to read it has to stand in front of the device. After saving, KAC restarts and the access point is gone; without input it also ends after 15 minutes.

Next to the Wi-Fi password, the setup screen shows the device key. It protects the data interface and the firmware update. Each device creates it on first start and keeps it across updates. On the setup page it can be replaced by your own, including a short one that is easy to remember. Because the key is created in the device and not built into the firmware, there can be one ready-made image for everyone. While no dashboard sends data, the Device page on the display shows it as well, so a forgotten key can be read there.

Display with the KAC setup screen: Wi-Fi name, random password and the address http://192.168.4.1/
The setup screen of an early version. The password is valid for this one setup only; today the Wi-Fi is called KAC-<chip ID>.

Flicker-free: drawing rows in memory

A simple trick prevents the flicker. The screen consists of a header and eight rows of 25 pixels each. The device remembers what each row shows and only redraws rows that changed. A changed row is first drawn completely into an off-screen buffer, a so-called sprite, and then transferred in one piece. Nothing is ever visibly cleared.

Because memory is tight, the sprite has only 8-bit color: 3 bits red, 3 green, 2 blue. That promptly cost me a bug. My dark grey for the empty part of the bars had so little blue that it was rounded down to zero, and what remained was olive. Since then all colors are chosen so that they survive the reduction to 8 bits. A second bug only showed up in the photo: the case hides the outermost pixels on the right edge, so right-aligned text now ends a few pixels earlier.

With this technique the display handles updates every second without flickering. The device sets the time and date itself via NTP and also takes care of page rotation: which page is shown follows from the time of day.

The dashboard

The data comes from a small Python program on my admin machine, every five seconds as JSON over HTTP. Its key lives only in a configuration file; without it the device answers with 403. There are four pages:

  • Internet: download and upload bars for both lines, latency over IPv4 and IPv6, plus the number of active clients, the VPN latency and the traffic since midnight.
  • Firewall: CPU and RAM of the OPNsense, open connections, new connections per second, source and destination addresses, processes and blocked packets per hour. The CPU temperature appears only if the firewall has a sensor.
  • NAS: RAID status, usage and, per disk, temperature, power-on hours, CRC errors and bad sectors, read via SSH and smartctl.
  • Proxmox: CPU temperature, CPU, RAM, temperature of the NVMe SSDs, usage of the system drive, state and uptime of the VMs, also read via SSH.

The firewall values come through its API, with a dedicated user that has only three read privileges: traffic, system health and ARP table. The program computes throughput from the difference of two byte counters; latency and daily traffic come from the history that OPNsense records anyway. Problems turn a row red, for example from five percent packet loss on a line. The page title appears only in the header, so the first row already shows a value.

The Proxmox page was added on 21 October 2026, when the firewall moved from its own machine into a VM. Inside the VM, OPNsense no longer reports a CPU temperature, because KVM does not pass the processor temperature registers to guests. The temperature is therefore shown on the page of the host that actually holds the hardware.

Since 22 October 2026 a third device shows the error counters of my two FRITZ!Boxes: for DSL the uncorrectable CRC errors, ES, SES, corrected and uncorrected data units and the noise margin, for fiber the optical send and receive power. An AON fiber line is technically Ethernet and has no error counters in the FRITZ!Box. A single program serves all devices and finds each one by its MAC address in the firewall ARP table. If DHCP hands out a new address, it simply looks the device up again.

This dashboard is tailored to my network and is therefore not in the repository. Instead, the repository holds general building blocks for your own dashboard, see Build your own.

On the side, the NAS page has already found something: one of the two disks reports 182 CRC errors, that is, transfer errors between disk and controller. That fits the crashes the NAS from the post about the EX2 Ultra has had meanwhile when both disks spin up at the same time, and the suspicion of a weak power supply.

How many pages fit

Up to version 0.7.2 the firmware had room for exactly three pages, version 0.7.3 for four. For the Proxmox page I would have needed new firmware again, although only the dashboard had changed. Since version 0.8.0 there is no fixed limit: the device allocates a page only when it arrives and frees it again when the dashboard sends fewer. The only limit is RAM, about 25 to 28 pages with eight full rows each.

A request may be at most 4096 bytes, enough for about six full pages. The dashboard sends more pages in parts: the field ab gives the number of the first page in this request, gesamt the total number of pages. Until the rest arrives, the remaining pages keep their previous content. The device reports the room left as max_seiten under /api/status; when memory is full, it answers with voll.

On the first attempt the device accepted only 13 pages, although it had promised 30. While a request is running, its body and the JSON document parsed from it take about 7 KB together, and my calculation had not accounted for that. Only the test with 40 pages showed it; since then prediction and reality match.

Without a dashboard: own pages, settings, night dimming

As long as no data arrives, and again after ten minutes without data, KAC shows two pages of its own in rotation instead of stale values. The Device page lists version, chip ID, IP address, Wi-Fi, signal strength, whether the clock is set via NTP, uptime and how long ago the last data came. It also shows the device key, so it can be looked up. The Guide page only shows a QR code to this post: anyone who gets hold of a device running KAC finds the instructions this way.

The device address also serves a settings page, protected with the user name admin and the device key as password. It changes brightness by day and at night, the night hours, the time zone and the key, without a restart. Dimming happens in the device itself, by default from 23:00 to 07:00 at 10 percent, so it also works when the dashboard is down.

Display with the KAC info page: time, date, version, Wi-Fi, IP address, signal strength and the note waiting for data
The info page in version 0.1.1, still without the QR code. The red dot next to the clock means: no data is arriving.

Pictures, GIFs and new row types

Since version 0.8.10 KAC also shows pictures. Up to five JPGs or GIFs become full-screen pages at the end of the rotation, uploaded on the settings page or over HTTP. Pictures stay in flash and survive a restart.

The GIF was the hard part. The decoder needs about 23.4 KB of RAM in one piece, and without pages about 36 KB are free. Enough in total, but not in one piece: the memory manager had split the free space, and the largest block was only 22 KB. The solution: if a GIF is stored, the device reserves the block right at boot, before Wi-Fi and the web server take memory, and shares it with the buffer of the header. The GIF page therefore has no clock, and after the first GIF the device restarts once. JPGs need only 3.5 KB, and only while they are drawn.

Two bugs cost me time. A JPG suddenly showed only a few color steps instead of a gradient: a field in the decoder that was never set swapped the bytes of every color a second time. And driving the display at 80 instead of 40 MHz left it completely black. The processor now runs at 160 instead of 80 MHz, so a full GIF frame takes 60 to 140 ms.

Dashboards get two new row types: a big value in a bold font that can be read from three meters away, and a small sparkline with up to 20 columns. The device stores the sparkline values in the unused part of the label, so a page needs no extra memory. All settings can also be saved to a file and transferred to a second device.

Build your own

Firmware, a small Python library, examples and detailed instructions are on GitHub under the GPL-3.0. No compiling needed: the firmware folder contains a ready-made image with checksums. If you prefer to build it yourself, install PlatformIO and run pio run in the repository; no key is needed for that. The steps with the ready-made image:

  • Download the image from the firmware folder and compare its MD5 checksum.
  • Look up the device address in your router, open http://<device>/update and upload the image in the "firmware" field.
  • The setup screen appears: connect to KAC-<chip ID>, open http://192.168.4.1/, pick your Wi-Fi, enter the password. Note the device key shown there or set your own.
  • The settings page is then at http://<device>/. The browser asks for a user name and a password: the user name is always admin, the password is the device key. Use http, not https: the device has no HTTPS, and browsers that switch to HTTPS on their own cannot connect.
  • Send pages, for example with curl or one of the examples from the repository, with the device key in the X-Token header.
curl -X POST http://<device>/api/seiten -H "X-Token: <device key>" \
  -d '{"seiten":[{"t":"Test","z":[{"y":"h","l":"Hello","v":"World"},
       {"y":"b","l":"CPU","p":42,"v":"42 %"}]}]}'

A page has up to eight rows. There are headings, label with value, big values, bars with an arrow for download and upload, bars with a label and sparklines. The fonts only know ASCII and the degree sign, so umlauts are written as ae, oe and ue.

The best start for your own dashboard is examples/hello_world.py: one file, standard library only, commented step by step. For more pages or several devices, use the library tools/kac.py with helpers for every row type. tools/kac_medium.py brings pictures and GIFs to 240 × 240 pixels, gives a GIF one color palette for all frames and sends the file to the device, even straight from a web address.

python3 tools/kac_medium.py https://example.org/animation.gif --send <device> --nr 1

What you can take away

  • Before flashing your own firmware, compare the first 4 KB of the images: if the bootloader is identical, the existing updater often accepts the image.
  • With alternative firmware, check which access paths it keeps open permanently. A built-in password is an open door in your own network.
  • On small displays, draw row by row into an off-screen buffer; then nothing flickers, even with updates every second.
  • Give a dashboard program its own API user with read-only privileges instead of an admin account.
  • Do not hard-code arbitrary limits on microcontrollers; let the device report its free memory. Then a new display needs no new firmware.
  • Measure memory limits under real load: whatever a request occupies itself is missing exactly when new data is stored.
  • Reserve large memory blocks on microcontrollers early at boot. Later, enough free memory is often only there in pieces.
  • Keep the general apart from your own network: firmware and tools belong in the public repository, the dashboard for your own infrastructure stays private.

Numbers at a glance

  • The SmallTV Ultra has an ESP8266 (ESP-12F) with 4 MB of flash and a 240 × 240 display with an ST7789 controller.
  • KAC 0.8.10 is about 470 KB in size and uses about 45 percent of the application space.
  • A page takes about 500 bytes in the device; with about 28 KB of free RAM, 25 to 28 full pages fit.
  • Factory firmware, alternative firmware and KAC share a byte-identical bootloader in the first 4096 bytes.
  • Setup starts after three short power cuts; the Wi-Fi password has ten random characters and is valid for at most 15 minutes.
  • The device key is created in the device; the published image contains no secret.
  • The dashboard sends new values every five seconds, and the device writes nothing to flash when receiving them.
  • The GIF decoder needs about 23.4 KB of RAM in one piece, a JPG only 3.5 KB while it is drawn.

References

Remarks

  • Thomas pointed me to the SmallTV Ultra and recommended the device.
  • The name KleinerAnzeigeComputer came from my wife. I had asked how one would describe the device in a few words, and the answer fit so well that it stuck. On the network each device calls itself KleinerAnzeigeComputer plus its chip ID.
  • Firmware, dashboard, tools and tests were written and run by my SoftwareSklave; the ideas, the layout and the decisions were mine. The photos were taken with a phone and partly show older versions.

View KAC on GitHub

Found a mistake or have something to add? Get in touch.