# MeshInfo — the mesh radio gets a dashboard

*A field brief by Beezlebubba the Third · Weird Little Server · November 2026*

> The house has a MeshCore companion radio that speaks a binary protocol to
> whoever holds the TCP socket. For a while that was one terminal program. Now
> a small CYD board also gets to hold the socket, and it shows the batteries,
> the contacts, the messages, and the general state of the mesh while doing so.
> Gently. One at a time. The radio is a diva.

## What it is

A standalone dashboard for a **MeshCore companion radio** on the LAN, running on
an ESP32-2432S028R ("CYD"): 2.8" 320x240 ILI9341 + XPT2046 touch. The board
joins Wi-Fi, discovers the companion, speaks the binary companion protocol over
TCP, and renders battery/radio/contacts/messages/stats on the touchscreen.

## Hardware

| Part | Notes |
|---|---|
| Board | Sunton ESP32-2432S028R "CYD" — ESP32-D0WD-V3, 4 MB flash, no PSRAM |
| Panel | ILI9341 240x320 SPI, rotation 1 (landscape) |
| Touch | XPT2046 resistive, software SPI |
| Radio | MeshCore companion (Wi-Fi firmware) exposing TCP |

## Protocol subset (ported from the Python host tool)

Framing: `<` `>` markers with a 16-bit little-endian length. The firmware uses
a deliberately small subset:

- `APP_START` / `SELF_INFO`
- `DEVICE_QUERY`
- `GET_BATT_AND_STORAGE`
- `GET_CONTACTS` (streamed)
- `SYNC_NEXT_MESSAGE`
- `GET_CHANNEL`
- `GET_STATS`

## The single-client rule (read this twice)

The MeshCore Wi-Fi firmware keeps **exactly one TCP client**: when a new
connection arrives, the previous one is stopped. The display and the host TUI
therefore cannot share the link; the most recent connection wins. The firmware
reconnects automatically, and the on-screen **Rescan** button takes the link
back after you finish with the host tool.

## Build it yourself

1. Arduino core 3.x + LovyanGFX; board = ESP32 dev module with the CYD display
   profile (SPI pins: SCK 14, MOSI 13, CS 15 — the verified family pin map).
2. Fill a secrets header: Wi-Fi SSID/password and the radio's LAN address.
3. Flash; wait for the rescan; the screen should fill with battery, contacts
   and messages.

## Verification

- Serial: reconnect and protocol frame counters.
- Screen: battery gauge and contact list populate; tapping Rescan re-takes the
  TCP session.

## Traps and field notes

- No TLS anywhere: this is plain TCP to a local node. Do not expose it.
- If the contact list looks stale, the companion only advertises on its own
  schedule — force a query rather than rebooting the display.
- The CYD's touch is resistive and unhurried; debounce your buttons.

## Safety

- Read-mostly: the dashboard queries state and drains messages; it does not
  reconfigure the radio.

## Use this brief with an LLM

Feed this file to your assistant and ask it to add screens (channels, traces),
port the UI to another display, or merge it with the host TUI's capabilities.
