ESP32 Projects
Start a build
Markdown

Cmdr Ipstube for ESP32

An ESP32 display project involving TFT display, Addressable LED strip.

ESP32ESP-IDFUnrated
Parts and source

Before you start

Check the exact TFT display, Addressable LED strip configuration against the upstream wiring or parts list.

Upstream README

cmdr-ipstube

A smart clock firmware for the IPSTube, built on the commander embedded shell framework.

The IPSTube is an off-the-shelf "fake Nixie" desk clock — six 135×240 IPS panels (ST7789) standing in glass tubes, plus WS2812 ambient LEDs and a DS1302 RTC, all driven by a classic ESP32. This firmware replaces the stock one and adds a live shell over USB/telnet, OTA updates, and swappable faces/fonts on a filesystem partition.

The IPSTube clock running this firmware: four tubes showing 01:04, a fifth with
the weekday and date, and a sixth showing the current temperature and today's
forecast.

What it does

  • Font clock — HH:MM rendered from a TTF (Karla) with a dot colon, a weekday/date panel, and a live weather panel.
  • PNG flip-clock face — face png shows HHMMSS from digit images. The images live on a LittleFS partition (not baked into firmware), so digit sets can be swapped or added without reflashing. face font returns to the font clock.
  • Weather (panel 5) — current temp + condition + today's forecast low/high from forecast.weather.gov (NWS), refreshed every 30 min. The high/low stays on today until local midnight rather than rolling to tomorrow in the evening.
  • News — top headlines from newsapi.org, hourly. Show as a full-strip marquee (news), or vertically scroll them on panel 5 (panel5 news).
  • Display scenes — a single scene runner drives the active view: clock, marquee <text>, read <d|all> <text> (vertical reader), hscroll, news, and hold (yield the displays so an external host can push content). rotate on cycles clock ↔ news on a timer.
  • Live tuning — tune (clock layout), mspeed/msize (marquee), news speed (news scroll). Type a command bare for usage.

Panel 5 vertically scrolling a news headline while the other five tubes keep
showing the time and date.

panel5 news — headlines scroll up the last tube while the clock keeps running.

The shell

Everything above is driven from a live command shell, over USB serial (./monitor) or telnet on port 23. help lists whatever the enabled modules registered:

$ ./monitor
Connecting to /dev/cu.wchusbserial1430  (Ctrl-T q to quit)

> help
  help -- list all commands
  version -- firmware name, build number, commit
  rtc -- DS1302 real-time clock - 'rtc' / 'rtc set ...'
  ipstube -- 6x ST7789 displays - 'ipstube' for usage
  wifi -- WiFi status/control - 'wifi status|off|on'
  wled -- WS2812 LEDs - 'wled' for usage
  marquee -- scroll a message across all six displays
  read -- vertical-scroll a long message up a panel
  hscroll -- horizontal-scroll one line across a panel
  clock -- return the displays to the clock face
  news -- headlines marquee ('news fetch' refreshes)
  panel5 -- panel 5 content: weather or news
  weather -- show/fetch weather ('weather raw' debugs)
  rotate -- timed scene rotation on/off (clock<->news)
  hold -- yield displays for external pushes
  face -- clock face: font|png|set <name> (FS sets)
  font -- text font: bare lists, <name> loads from FS
  tune -- font-clock layout offsets (bare = print)
  mode -- show the active display scene
  mspeed -- marquee scroll speed in px/frame
  msize -- marquee font height in px (fps trade)
  reset -- reboot the firmware
  ota -- flash firmware from URL (http)
>

help, version, reset and ota come from commander itself; rtc, ipstube, wifi and wled are stock modules enabled with cmdr module enable; the rest are this project's own, registered in main/main.cpp.

Faces & fonts (LittleFS)

The storage partition holds the swappable assets, mounted at /storage:

storage/faces/<set>/0.png … 9.png   # 135×240 digit images (PNG flip-clock)
storage/fonts/<name>.ttf            # text-rendering fonts

Runtime commands (the selection persists across reboots via NVS):

face                 # show mode (font/png) + active set
face font | png      # switch render mode
face set             # list digit sets under /storage/faces
face set <name>      # use that set (and switch to the png face)
font                 # show current font + list /storage/fonts
font <name>          # load /storage/fonts/<name>.ttf and re-fit all text

Build/refresh the asset tree with scripts/gen-faces.py (needs Pillow); it is packed into the partition image and flashed with the app. The embedded Karla is a fallback if the filesystem is empty or unmountable.

scripts/gen-faces.py                                  # render the `flip` set from a bundled OFL font
scripts/gen-faces.py --font Karla-Regular --set karla # …or a different one
scripts/gen-faces.py --from-dir ~/digits --set myset  # convert your own 0.png…9.png

The ten digits of the shipped flip face, each a split-flap card with a hinge gap
across the middle.

The shipped flip set is rendered from Open Sauce One (one of the bundled OFL fonts) rather than bundled artwork, so everything in this repo is covered by its own licence. Digit sets made from images you supply are yours to license — check the terms of any third-party face set before redistributing it.

Build & flash

Prereqs: ESP-IDF v5+ and a pngle checkout at ~/u-developer/pngle (or $PNGLE_PATH) — commander's getting-started guide bootstraps both with one script. Copy secrets.h.example → secrets.h and fill in WiFi + newsapi key.

cmdr regen   # write the dev scripts (gitignored — they're generated, not source)
./build      # idf.py build into build-esp32/
./upload     # USB flash (writes app, partition table, otadata, and the storage FS)
./monitor    # serial console
./bum        # build + upload + monitor

The scripts self-source ESP-IDF, so you don't need to load it first.

OTA (over WiFi): flash layout is dual 2 MB app slots + a ~3.9 MB storage filesystem (partitions.csv). The first flash must be over USB (it lays down the new partition table); after that, ./bum-ota builds and pushes firmware to the device. During an update the tubes fill left→right as the image lands. OTA carries the app only — face/font assets are reflashed over USB when storage/ changes.

Display and text rendering live in commander's ipstube module; the clock/weather/news logic is this project's own, in main/main.cpp.

Updating the commander framework

This project pins commander to a release tag (the GIT_TAG in CMakeLists.txt). cmdr pull re-fetches that same tag, so on its own it changes nothing — to adopt a newer release, cmdr pin <tag> then cmdr pull (rebuild after). cmdr unpin floats on main instead; cmdr update updates the cmdr tool itself.

Don't build against a local commander checkout as a normal workflow — it makes this project silently depend on unpublished commander state. (cmdr link <path> exists as a deliberate, temporary exception for framework development.)

Credits

PNG decoding on-device is pngle (MIT, © kikuchan), built as a thin IDF component from an external checkout.

Bundled UI fonts, each licensed under the SIL Open Font License 1.1 — and the source of the shipped flip digit face, which is rendered from them: