From b6aa0635ae4a7bff0ddc8e766b6dec02be3e008d Mon Sep 17 00:00:00 2001 From: jimmy Date: Wed, 4 Nov 2026 20:47:00 +1300 Subject: [PATCH] build: refresh the build time on every build, default make ota host A web-only change relinked without recompiling esp_app_desc.c, so the image kept its old build time. make ota now uses led-controller.local unless HOST is given. Co-Authored-By: Claude Opus 5.5 --- Makefile | 11 ++++++++--- README.md | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ba84ef9..f2452e5 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,8 @@ help: @echo "LED controller (ESP32-S3):" @echo " make build minify + gzip the web UI, then build the firmware" @echo " make flash flash firmware and web UI to PORT ($(PORT))" - @echo " make ota HOST=ip build, then upload the firmware (web UI included) over Ethernet (no USB)" + @echo " make ota [HOST=ip] build, then upload the firmware (web UI included) over Ethernet (no USB);" + @echo " HOST defaults to led-controller.local" @echo " make ota-drivers HOST=ip [MAC=aabbccddeeff] [BROADCAST=1]" @echo " push changed led-driver .py files over ESP-NOW (all drivers without MAC)" @echo " make monitor serial console on PORT (Ctrl-] to quit)" @@ -50,14 +51,18 @@ web: tools/build_web.sh # --- firmware ------------------------------------------------------------- +# The build time in the image comes from esp_app_desc.c, which nothing else recompiles (a web-only +# change just relinks), so drop its object and every build gets the current time. +APP_DESC_OBJ = build/esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj + build: web - $(DOCKER_RUN) $(IDF_IMAGE) bash -c 'idf.py build; rc=$$?; $(FIX_OWNER); exit $$rc' + $(DOCKER_RUN) $(IDF_IMAGE) bash -c 'rm -f $(APP_DESC_OBJ); idf.py build; rc=$$?; $(FIX_OWNER); exit $$rc' flash: build $(DOCKER_RUN) $(DEVICE) $(IDF_IMAGE) bash -c 'idf.py -p $(PORT) flash; rc=$$?; $(FIX_OWNER); exit $$rc' +ota: HOST ?= led-controller.local ota: build - @test -n "$(HOST)" || { echo "usage: make ota HOST="; exit 1; } python3 tools/ota.py $(HOST) ota-drivers: diff --git a/README.md b/README.md index 14ea8eb..5c0e009 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It keeps profiles, zones, presets, device groups, sequences, palettes, patterns ```bash make build # minify the web UI from web/, then build the firmware (ESP-IDF in Docker) make flash # flash over USB -make ota HOST= # update firmware (web UI included) over Ethernet, no USB (POST /ota) +make ota [HOST=] # update firmware (web UI included) over Ethernet, no USB (POST /ota); HOST defaults to led-controller.local make ota-drivers HOST= [MAC=..] [BROADCAST=1] # push changed led-driver .py files over ESP-NOW make monitor # serial console make test # driver unit tests and the C/Python envelope cross-check