From 7d8ebd663777d947d976a8be2bafbe4acab71974 Mon Sep 17 00:00:00 2001 From: MasterPhooey Date: Mon, 15 Jun 2026 06:08:49 -0500 Subject: [PATCH] Update prebuilt firmware flasher and tagged Docker releases --- .github/workflows/docker-publish.yml | 18 +- README.md | 31 +- run.sh | 11 +- static/index.html | 141 ++++-- trainer_server.py | 689 ++++++++++++++++++--------- 5 files changed, 585 insertions(+), 305 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6e4d3ea..494655d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,9 +1,9 @@ -name: Publish Docker Image +name: Publish Docker Images on: push: - branches: - - main + tags: + - "v*" workflow_dispatch: permissions: @@ -36,6 +36,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest + type=ref,event=tag + - name: Build and push image uses: docker/build-push-action@v6 with: @@ -43,6 +52,7 @@ jobs: file: dockerfile platforms: linux/amd64 push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha,scope=mww-trainer-nvidia-docker cache-to: type=gha,mode=max,scope=mww-trainer-nvidia-docker diff --git a/README.md b/README.md index 1855782..90474ff 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ taterassistant.com -Train custom microWakeWord models in Docker with NVIDIA/CUDA acceleration, generated Piper samples, device-captured samples, reviewed false-wake negatives, live training logs, and ESPHome firmware flashing. +Train custom microWakeWord models in Docker with NVIDIA/CUDA acceleration, generated Piper samples, device-captured samples, reviewed false-wake negatives, live training logs, and prebuilt Tater firmware flashing. Real samples come from device-captured wake audio, close misses, or manual uploads. Every saved sample is normalized to `16 kHz / mono / 16-bit PCM WAV` before training. @@ -19,6 +19,12 @@ Real samples come from device-captured wake audio, close misses, or manual uploa docker pull ghcr.io/tatertotterson/microwakeword:latest ``` +Tagged releases also publish matching immutable image tags: + +```bash +docker pull ghcr.io/tatertotterson/microwakeword:v5 +``` + --- ## Run The Container @@ -32,6 +38,8 @@ docker run -d \ ghcr.io/tatertotterson/microwakeword:latest ``` +Use a version tag such as `ghcr.io/tatertotterson/microwakeword:v5` when you want to pin a known release instead of tracking `latest`. + The flags: - `--gpus all` enables GPU acceleration. @@ -56,14 +64,14 @@ If you change `REC_PORT`, open that port instead and use the same port in the ES - `Trainer` starts a wake-word session, shows positive/negative sample counts, and launches training. - `Captured Audio` reviews clips sent by ESPHome sats, including wake hits, close misses, and false wakes. - `Samples` plays, removes, clears, and manually imports personal or negative samples. -- `Firmware` builds the latest `microWakeWords` ESPHome YAMLs from GitHub and flashes VoicePE or Satellite1 over OTA. +- `Firmware` pulls verified prebuilt Tater firmware images from GitHub and flashes supported satellites over OTA. - Popup consoles show colorized training and firmware logs while long-running jobs are active. --- ## Captured Audio Workflow -To collect samples from a sat, flash it with the Tater firmware from [TaterTotterson/microWakeWords](https://github.com/TaterTotterson/microWakeWords). The `Firmware` tab can build and flash the VoicePE or Satellite1 YAMLs directly from that repo. +To collect samples from a sat, flash it with the Tater firmware from [TaterTotterson/microWakeWords](https://github.com/TaterTotterson/microWakeWords). The `Firmware` tab can pull verified prebuilt OTA images from that repo for fast firmware updates. After flashing, the device exposes ESPHome entities for capture setup: @@ -177,18 +185,17 @@ After those assets are prepared, later runs reuse the local copies unless the mo ## Firmware Flashing -The `Firmware` tab builds and flashes Tater firmware for supported ESPHome sats. +The `Firmware` tab flashes prebuilt Tater firmware for supported ESPHome satellites. -- Downloads the latest firmware YAML templates from `TaterTotterson/microWakeWords` on GitHub. -- Lets you choose `VoicePE` or `Satellite1`. +- Downloads the latest prebuilt firmware manifest and OTA image from `TaterTotterson/microWakeWords`. +- Verifies downloaded images by size and SHA before upload. - Auto-detects ESPHome devices with mDNS when the container is running with host networking. - Allows manual IP or hostname entry if discovery does not find the device. -- Saves firmware form values so you do not re-enter sounds and URLs every run. -- Lists locally trained wake words from `/data/trained_wake_words/` for easy model selection. -- Builds with ESPHome and flashes OTA. -- Streams ESPHome output in a colorized firmware console. +- Saves the selected OTA target for each firmware family. +- Lists locally trained wake words from `/data/trained_wake_words/` for live model switching. +- Streams download, verification, and OTA upload progress in a colorized firmware console. -Firmware YAMLs are intentionally pulled from GitHub each time. There is no local fallback path in the trainer UI. +You usually only flash for firmware updates. New satellites, or devices older than Tater firmware `3.0.3`, need one USB flash first before OTA updates and live wake-word switching are available. --- @@ -225,7 +232,7 @@ That removes: - cached datasets - training environments - trained models -- firmware build caches +- downloaded firmware images --- diff --git a/run.sh b/run.sh index 3364b37..b65d833 100644 --- a/run.sh +++ b/run.sh @@ -17,7 +17,6 @@ PIN_FILE="${VENV_DIR}/.pinned_installed" FASTAPI_VERSION="${REC_FASTAPI_VERSION:-0.115.6}" UVICORN_VERSION="${REC_UVICORN_VERSION:-0.30.6}" PY_MULTIPART_VERSION="${REC_PY_MULTIPART_VERSION:-0.0.9}" -ESPHOME_VERSION="${REC_ESPHOME_VERSION:-2026.5.1}" echo "microWakeWord Trainer UI (Docker)" echo "-> ROOTDIR: ${ROOTDIR}" @@ -31,7 +30,7 @@ install_ui_deps() { "fastapi==${FASTAPI_VERSION}" \ "uvicorn[standard]==${UVICORN_VERSION}" \ "python-multipart==${PY_MULTIPART_VERSION}" \ - "esphome==${ESPHOME_VERSION}" \ + "zeroconf>=0.132.2" \ "silero-vad>=5.0.0" \ "numpy>=1.24.0" } @@ -54,11 +53,11 @@ if [[ ! -f "${PIN_FILE}" ]]; then touch "${PIN_FILE}" else echo "Reusing existing trainer UI venv (no upgrades)" - if ! "${PY}" - "${FASTAPI_VERSION}" "${UVICORN_VERSION}" "${PY_MULTIPART_VERSION}" "${ESPHOME_VERSION}" <<'PY' >/dev/null 2>&1 + if ! "${PY}" - "${FASTAPI_VERSION}" "${UVICORN_VERSION}" "${PY_MULTIPART_VERSION}" <<'PY' >/dev/null 2>&1 import importlib.metadata as md import sys -fastapi_version, uvicorn_version, multipart_version, esphome_version = sys.argv[1:5] +fastapi_version, uvicorn_version, multipart_version = sys.argv[1:4] def version_tuple(value): parts = [] @@ -76,13 +75,13 @@ exact = { "fastapi": fastapi_version, "uvicorn": uvicorn_version, "python-multipart": multipart_version, - "esphome": esphome_version, } minimum = { "silero-vad": "5.0.0", "numpy": "1.24.0", + "zeroconf": "0.132.2", } -present = ("torch", "zeroconf") +present = ("torch",) for package, expected in exact.items(): if md.version(package) != expected: diff --git a/static/index.html b/static/index.html index f37ce8e..ba43b7d 100644 --- a/static/index.html +++ b/static/index.html @@ -1519,13 +1519,13 @@
Firmware Studio
-

ESPHome Firmware Flasher

-

Build a microWakeWords ESPHome firmware template and flash it to a sat over OTA. Auto-detect is best effort; if the device does not show up, enter its IP or hostname manually.

+

Prebuilt Tater Firmware Flasher

+

Flash only for firmware updates. If this is a new satellite or it is not already on Tater firmware 3.0.3 or newer, do one USB flash first, then use this tab for fast OTA updates.

1 Pick firmware 2 Select target - 3 Review settings - 4 Build + flash + 3 Verify image + 4 Flash OTA
Flasher idle @@ -1555,15 +1555,15 @@
1
-

Firmware YAML

-

Choose a Tater firmware YAML to build from the shared firmware repo.

+

Firmware Image

+

Choose a prebuilt Tater firmware image from the shared firmware repo.

@@ -1606,14 +1606,14 @@
3
-

Device Settings

-

Each build fetches the latest YAML, then applies the saved substitutions for this target device.

+

Prebuilt Image

+

The trainer downloads the latest verified OTA image and checks its size and SHA before flashing.

- +
-
Firmware template settings will appear here.
+
Firmware image details will appear here.
@@ -1621,13 +1621,13 @@
4
-

Build + Flash

-

The ESPHome output opens in the console so you can follow build, upload, and reboot progress.

+

Flash OTA

+

The console shows download, verification, OTA upload, and reboot progress.

- - + +
@@ -1653,13 +1653,13 @@