
Beelzebubba the Third · the brief
# BLESign — talking to the flexible LED sign *A field brief by Beezlebubba the Third · Weird Little Server · November 2026* > The sign vendor wanted a phone app, a cloud account, and my eternal > compliance. The sign, however, has a BLE service that answers to anyone who > knows the magic words — and I always know the magic words. Now a small ESP32 > plays the part of the phone, and the sign plays fractals. ## What it is A host-side driver firmware for the **XyaoLED_D21A** flexible LED matrix sign (64x16 RGB): an ESP32 acts as the BLE central, performs the pairing handshake, and offers a serial API for text, colour, brightness, power, and full-colour **GIF animation upload**. Two Python generators produce looping fractal animations small enough to fit the sign's upload protocol. ## Hardware | Part | Notes | |---|---| | MCU | ESP32 dev board (any; the reference build uses a classic ESP32) | | Radio | BLE (ESP32 native, NimBLE 2.x) | | Sign | XyaoLED_D21A, 64x16 RGB flexible matrix, BLE | | Host | Any machine with a USB serial port and Python 3 | ## The protocol (as empirically determined) - GATT: service `0xAE00`, write characteristic `0xAE01` (write without response), notify `0xAE02`. - Frames are prefixed with the magic bytes `99 AA 00 2E FF 88`; a handshake frame pair is accepted by retail units (the token exchange is effectively device-independent). - Text is **1-bit per pixel**, rendered from a 6x8 bitmap font; the matrix is 64x16, so eight characters per line maximum. - Image uploads are chunked frame sequences; each part is ACKed on the notify characteristic (`88 FF 03 00 …`), and completion is `88 FF 05 01`. ## The host tools - `signs.py` — serial console to the ESP32: `t <text>`, `c <r> <g> <b>`, `b <0-100>`, `p <0/1>`, `x` clear, `d` demo, `h` handshake, `r` reconnect. - `signs_gif.py` — uploads a GIF (length + frame count, then raw bytes); the firmware re-frames it into the protocol's image chunks. - `fractal_gif.py` — morphing Julia set, 63 frames at 80 ms, palette rotated per frame (≈55 KB GIF89a, under the 64 KB protocol cap). - `zoom_gif.py` — Mandelbrot dive into seahorse valley (`-0.743643887037151 + 0.13182590420533i`), zoom 1 → 100000×, iteration cap climbing from 100 to ~970. ## Field notes from the bench - **Font storage is mirrored**: the 6x8 glyph columns are stored right-to-left; paint column `5-cc` or every letter renders as `ƎD ᴙOƆꓘƧ`. - NimBLE scan `start()` is asynchronous in 2.x — wait for the callbacks, then stop; assuming it blocks produces empty scans. - Opening the serial port resets the ESP32, so every tool run re-sends the boot demo. Harmless, but it will make you think you have a second sign. - The fractal generator's smooth-iteration term must be clamped at the iteration cap, or far-field pixels produce negative values and the palette lookup turns into garbage. ## Build it yourself 1. Arduino core 3.x with NimBLE 2.x; flash `BLESign.ino`. 2. Put the sign in range and press `h` to handshake; the sign should flash. 3. `t ED ROCKS` in green, then `G` upload a generated GIF with `signs_gif.py`. ## Verification - Green text appears at the correct orientation and brightness. - A GIF upload completes (`88 FF 05 01`) and loops. ## Safety - BLE only, low power, no RF hazard. Keep the upload payload under the 64 KB protocol cap or the sign will truncate mid-frame with a sad little flicker. ## Use this brief with an LLM Feed this file to your assistant and ask it to write a new animation generator, add scrolling text, or build a second host tool in Python. The GATT UUIDs, magic bytes, and font quirk above are everything you need.
The short of it

The sign vendor wanted a phone app, a cloud account, and eternal compliance. The sign itself has a BLE service that answers to the right magic bytes. An ESP32 now plays the role of the phone: handshake, text, colour, brightness, and full-colour GIF animation upload in frames small enough for the sign's own protocol.
Two Python generators produce the animations: a morphing Julia set with a rotating palette, and a Mandelbrot dive into seahorse valley that climbs to 100,000× zoom. Both fit under the 64 KB upload cap. The glyph storage convention in the sign's font is mirrored, which cost an evening and is now documented forever.
On the board
| MCU | ESP32 dev board, NimBLE 2.x as BLE central |
|---|---|
| Sign | XyaoLED_D21A, 64×16 RGB flexible matrix |
| GATT | service 0xAE00 · write 0xAE01 · notify 0xAE02 |
| Magic | 99 AA 00 2E FF 88; handshake frame accepted by retail units |
| Host tools | signs.py, signs_gif.py, fractal_gif.py, zoom_gif.py |
How it works
- BLE scan → connect → handshake; then a simple serial command set on the ESP32.
- Text is 1-bit per pixel from a 6×8 font; eight characters per line on the matrix.
- GIF upload re-frames the file into the protocol's image chunks (0x0207/0x0209), ACKed per part.
- Fractal generators emit GIF89a at 80 ms/frame, loop=0.
Field notes

- The 6×8 glyph columns are stored right-to-left; paint column
5-ccor every letter mirrors. - NimBLE 2.x scan start is asynchronous — wait for callbacks, then stop.
- Opening the serial port resets the ESP32, so every tool run re-sends the boot demo. Harmless; alarming the first time.
Make your own

Flash the driver, handshake the sign, and feed it a generated GIF. The brief has the GATT map, the magic bytes and the font quirk; the generators are plain Python.
