2026-05-02 11:43:41 -04:00
|
|
|
[package]
|
|
|
|
|
name = "esp32-blinky"
|
|
|
|
|
version = "0.1.0"
|
|
|
|
|
edition = "2021"
|
|
|
|
|
resolver = "2"
|
|
|
|
|
rust-version = "1.77"
|
|
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
|
name = "esp32-blinky"
|
|
|
|
|
harness = false
|
|
|
|
|
|
|
|
|
|
[profile.release]
|
|
|
|
|
opt-level = "s"
|
|
|
|
|
|
|
|
|
|
[profile.dev]
|
|
|
|
|
debug = true
|
|
|
|
|
opt-level = "z"
|
|
|
|
|
|
|
|
|
|
[features]
|
|
|
|
|
default = ["std", "esp-idf-svc/native", "esp-idf-svc/binstart"]
|
|
|
|
|
pio = ["esp-idf-svc/pio"]
|
|
|
|
|
std = ["esp-idf-svc/std"]
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2026-05-02 13:10:32 -04:00
|
|
|
# `log` feature makes tracing events emit log records too, so EspLogger
|
|
|
|
|
# (which is a log::Logger) picks them up and writes via esp_log_write.
|
|
|
|
|
# No tracing subscriber needed on the device; structured fields render
|
|
|
|
|
# into the message text.
|
|
|
|
|
tracing = { version = "0.1", features = ["log"] }
|
2026-05-02 11:43:41 -04:00
|
|
|
anyhow = "1"
|
|
|
|
|
esp-idf-svc = "0.51"
|
|
|
|
|
embedded-svc = "0.28"
|
Add device-side OTA loop (OTA phase 2)
src/ota.rs polls ghcr.io every 60s on a dedicated 32 KB pthread,
fetches the manifest with an anonymous Bearer token, and on a digest
mismatch streams the layer into the inactive OTA partition while
verifying SHA256 against the descriptor as it goes. Aborts and
bails on size or SHA mismatch; otherwise sets the boot partition,
persists pending_digest to NVS, and reboots.
main.rs detects PENDING_VERIFY on boot and only calls
esp_ota_mark_app_valid_cancel_rollback() after Wi-Fi + the existing
HTTPS bringup checks pass -- so an OTA that breaks networking
auto-reverts on the bootloader's next boot. After mark-valid,
pending_digest is promoted to last_digest in NVS.
GIT_SHA is baked into the firmware via env!() at compile time
(set by the Makefile from `git rev-parse --short HEAD`) and logged
on boot, so we can see which build is running.
Bumped CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT to 16 KB; 8 KB
stack-overflowed during HTTPS + JSON + SHA work.
`make monitor` now auto-passes --non-interactive when stdout is
not a TTY, so it works in scripts and background tasks.
Verified end-to-end against ghcr.io/imjasonh/esp32 -- published v1,
flashed via USB, bumped a visible version string, published v2,
and the device polled, downloaded, SHA-verified, rebooted, and
marked the new image valid after bringup. Zero USB intervention.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:53:19 -04:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
|
|
|
|
serde_json = "1"
|
|
|
|
|
sha2 = "0.10"
|
2026-05-02 11:43:41 -04:00
|
|
|
|
|
|
|
|
[build-dependencies]
|
|
|
|
|
embuild = "0.33"
|