Built a small Arduino-style UI/control library for ESP32 (Trellis) — looking for feedback

User avatar
ovexro
Posts: 2
Joined: Wed Apr 08, 2026 4:58 pm

Built a small Arduino-style UI/control library for ESP32 (Trellis) — looking for feedback

Postby ovexro » Wed Apr 08, 2026 5:16 pm

Hi all,

I’ve been working on a small library for ESP32 called Trellis, and I thought it might be useful to share here and get some feedback from people actually building with these boards.

What it does

The main idea is:

Instead of building a custom web UI for every ESP32 project, you declare the device’s controls/sensors in code, and Trellis automatically generates the interface.

So rather than writing HTML/CSS/JS for every project, you do something like this:

Code: Select all

#include <Trellis.h>

Trellis trellis("Greenhouse");

void setup() {
  trellis.addSwitch("pump", "Water Pump", 13);
  trellis.addSensor("temp", "Temperature", "C");
  trellis.addSlider("fan", "Fan Speed", 0, 100, 25);
  trellis.begin("YourSSID", "YourPass");
}

void loop() {
  trellis.setSensor("temp", readTempSensor());
  trellis.loop();
  delay(2000);
}

That gives you:
  • a built-in dashboard at `http://<device-ip>/`
    live updates over WebSocket
    OTA updates
    mDNS (`<name>.local`)
    automatic device telemetry
    a JSON capability endpoint for external tools
Design goals

I tried to keep it simple and self-contained:
  • no cloud dependency
    no required MQTT broker
    no account / pairing flow
    no SPIFFS / SD card requirement
    no external frontend assets or CDN
    works offline on the LAN
Everything is embedded directly in firmware.

Current features

Right now it supports things like:
  • switches
    sliders
    sensors
    color controls
    text-style inputs
    auto-generated UI from declared capabilities
It also exposes device/system information like:
  • RSSI
    free heap
    uptime
    chip type
Desktop companion app

I also built a desktop app for Linux / Windows / macOS that auto-discovers Trellis devices on the LAN and renders them into one unified dashboard.

That part is optional though — each ESP32 still works fully on its own through the built-in local web UI.

Compatibility

At the moment:
  • ESP32 is the main target
    Pico W is also supported at the source level
The Pico W side is compile-tested, but I don’t yet have one on the bench to run every example end-to-end, so I’d especially appreciate feedback there if anyone tries it.

What is still missing / rough

A few things are definitely not finished yet:
  • battery / deep sleep awareness
    multi-device coordination / mesh-style behavior
    more advanced hardware capability types
What I’d love feedback on

If anyone takes a look, I’d especially appreciate opinions on:
  • whether the auto-generated UI idea feels useful or too restrictive
    what capability types are missing
    whether this would fit your workflow better than writing a small custom web UI per project
Examples of things I’m considering adding:
  • rotary encoder support
    matrix keypad support
    stepper controls
    richer grouping/layout options
Repo

GitHub:
https://github.com/ovexro/trellis

Examples currently in the repo include:
  • `BasicSwitch`
    `GreenhouseController`
    `RGBLed`
    `TemperatureSensor`
    `AutoConnect`
`AutoConnect` runs a captive portal AP for first-boot Wi-Fi provisioning.

Small note

I also just pushed v0.4.2, which fixes a no-WiFi `LoadProhibited` crash in `loop()` that could occur if `begin()`’s return value was ignored.

If anyone here gives it a spin, I’d genuinely appreciate any feedback — good or bad.

Thanks. :D
Life-long learner.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Built a small Arduino-style UI/control library for ESP32 (Trellis) — looking for feedback

Postby MicroController » Thu Apr 09, 2026 2:09 pm

The main idea is:
Instead of building a custom web UI for every ESP32 project, you declare the device’s controls/sensors in code, and Trellis automatically generates the interface.
I like that idea. Coding dashboards in HTML/JS/CSS yourself can be pretty quick&easy - if you're familiar with the relevant frameworks already and get them integrated into your build tooling. So "declaring" a UI directly in your C++ code can be really valuable.

Looking at Trellis, I find there is some room for improvement though. I think the tight coupling it implements between separate concerns isn't a good idea. I don't want my web UI framework to hijack a serial port, take over control of the WiFi, and configure and use IO pins for me; my application should provide data to the UI and possibly receive commands from there.

(Personally, I would also like to have the functions and classes used to define/"declare" the UI be constexpr so that all/most of the setup can happen at compile-time, and consequently code generated/optimized accordingly. - Based on the assumption that the structure of the UI will not change at run-time anyway.)

User avatar
ovexro
Posts: 2
Joined: Wed Apr 08, 2026 4:58 pm

Re: Built a small Arduino-style UI/control library for ESP32 (Trellis) — looking for feedback

Postby ovexro » Mon Apr 13, 2026 8:12 pm

Thank you so much for your insights!

I made a few major updates, all available on GitHub.
Life-long learner.

Who is online

Users browsing this forum: ChatGPT-User, MicroController and 13 guests