feat(m1): hardware status firmware with wifi web provisioning

Add the M1 milestone tree under poc/ (m1_hardware + poc_a apps,
shared common components, evidence schema). Merges the plan's
'm1 baseline+fixes' and 'wifi provisioning' batches: the poc/ tree is
entirely untracked and both concerns share files.

M1 hardware baseline:
- landscape ST7305 RIP display via LVGL I1 driver
- TF-card status log: JSONL telemetry with CRC32C per line; append
  buffer widened to line[640] after the 512-byte truncation defect
  (payload ~550B with real values) was root-caused on-device
- PCF85063 RTC read, SHTC3 temperature/humidity with plausibility
  checks, KEY input with short/long/portal press thresholds
- boot-time partition identity check and M1-002 boot record fields
  (device_id, image_sha256, reset_reason, services status)

WiFi web provisioning:
- softAP portal Frame-Setup-xxxx with HTTP endpoints /scan, /connect,
  /clear; httpd handlers never call httpd_stop (deadlock hazard) — a
  1s monitor task executes stop/start/connect actions
- credentials persist to system_fs wifi.json (littlefs) per the
  SEC-010 development exception (plaintext, documented in _doc)
- fallback: 5 disconnects without IP or 60s no-IP -> stop retry,
  portal returns; GOT_IP tears the AP down
- KEY >=3s hold requests the portal; prov start/stop/status console
  commands; ap_active/ap_mode_requested surfaces in status JSON/text

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
2026-08-31 08:01:37 +08:00
co-authored by Sisyphus
parent e71bcce56e
commit 5f7c60c899
37 changed files with 3903 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.25)
set(FRAME_REQUIRED_IDF_TAG "v6.0.2" CACHE STRING
"Exact ESP-IDF release tag required by the architecture")
set(FRAME_REQUIRED_IDF_COMMIT "7101770dc6db2667b3c477cc31365dd1acd6db4e" CACHE STRING
"Exact ESP-IDF commit required by the architecture")
set(FRAME_REQUIRED_COMPILER_VERSION "15.2.0" CACHE STRING
"Exact Xtensa GCC version required by the architecture")
include("${CMAKE_CURRENT_LIST_DIR}/../../../cmake/FramePlatform.cmake")
frame_require_esp_idf("${FRAME_REQUIRED_IDF_TAG}")
set(EXTRA_COMPONENT_DIRS
"${CMAKE_CURRENT_LIST_DIR}/../../common/components")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(frame_poc_a)
frame_verify_platform("${FRAME_REQUIRED_IDF_COMMIT}" "${FRAME_REQUIRED_COMPILER_VERSION}")
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++26" APPEND)
+27
View File
@@ -0,0 +1,27 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"displayName": "PoC-A development",
"description": "ESP-IDF v6.0.2 PoC-A configuration",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/default",
"cacheVariables": {
"IDF_TARGET": "esp32s3",
"SDKCONFIG": "${sourceDir}/build/default/sdkconfig"
}
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
}
]
}
+7
View File
@@ -0,0 +1,7 @@
# PoC-A ESP-IDF Test Application
This directory is a standard ESP-IDF project. Open `poc/poc-a.code-workspace`, select the `v6.0.2` setup and `esp32s3` target for the `poc-a` folder, then use the extension Build, Flash, Monitor, and Size commands.
The application consumes `frame_poc_runtime` through `EXTRA_COMPONENT_DIRS`; shared PoC runtime code must use `idf_component_register` and must not be added as an ordinary CMake target.
The separate `poc/host` project is only for ABI and pure state-model tests that do not produce ESP32 firmware.
+5
View File
@@ -0,0 +1,5 @@
idf_component_register(
SRCS "poc_a_main.cc"
PRIV_REQUIRES frame_poc_runtime unity)
target_compile_options(${COMPONENT_LIB} PRIVATE -std=c++26)
+42
View File
@@ -0,0 +1,42 @@
#include <cstddef>
#include <cstdint>
#include <type_traits>
#include "frame_poc/frame_abi.h"
#include "unity.h"
TEST_CASE("C ABI header layout is stable", "[poc-a][abi]")
{
TEST_ASSERT_EQUAL_UINT32(0, offsetof(frame_abi_header_t, struct_size));
TEST_ASSERT_EQUAL_UINT32(16, sizeof(frame_abi_header_t));
TEST_ASSERT_EQUAL_UINT32(8, sizeof(plugin_instance_handle_t));
}
TEST_CASE("C ABI compatibility checks size version and features", "[poc-a][abi]")
{
constexpr uint64_t required_feature = UINT64_C(1) << 12;
const frame_abi_header_t offered{
.struct_size = sizeof(frame_abi_header_t),
.abi_major = FRAME_ABI_MAJOR,
.abi_minor = FRAME_ABI_MINOR,
.feature_bits = required_feature,
};
TEST_ASSERT_TRUE(frame_abi_supports(
&offered, FRAME_ABI_MAJOR, FRAME_ABI_MINOR,
sizeof(frame_abi_header_t), required_feature));
TEST_ASSERT_FALSE(frame_abi_supports(
&offered, FRAME_ABI_MAJOR + 1, FRAME_ABI_MINOR,
sizeof(frame_abi_header_t), required_feature));
TEST_ASSERT_FALSE(frame_abi_supports(
&offered, FRAME_ABI_MAJOR, FRAME_ABI_MINOR,
sizeof(frame_abi_header_t) + 1, required_feature));
}
static_assert(__cplusplus >= 202302L);
static_assert(std::is_standard_layout_v<frame_abi_header_t>);
extern "C" void app_main(void)
{
unity_run_menu();
}