Repository navigation
Enhance documentation and add OTA firmware update manager - #8
Merged
Merged
Conversation
… methods - Add nRF52840-DK and nRF52840-Feather to supported boards section - Add board feature matrix table (WiFi/BLE/CAN/LittleFS/mDNS per board) - Document all three bus/history/* MCP methods with request/response examples (bus/history/read for can|nmea|nmea2000|obdii, config/get, config/set) - Expand I2C sensor reference with full parameter and address lists - Expand NMEA 0183 sentences table with all 9 sentence types - Add NMEA 2000 PGN reference table (all 8 supported PGNs) - Add OBD-II PID category table - Add Discovery section (mDNS + UDP broadcast) - Update architecture diagram to include BusHistory and DiscoveryManager - Update HTTP endpoints table with /bus-history routes - Add nRF52840 build/flash instructions - Update metrics/list example to include system.wifi.rssi https://claude.ai/code/session_01KcwgryFgMCJubfjtwqMnUc
Introduces OTAManager with HTTP Basic Auth (username "admin", password stored in NVS namespace "ota"). Routes registered on the shared AsyncWebServer: GET /ota — upload page (LittleFS /ota.html or built-in form) GET /ota/status — public JSON: fw version, build date, last result POST /ota/update — authenticated multipart firmware upload + reboot GET /ota/config — authenticated: reports whether default pwd is set POST /ota/config — authenticated: change OTA password (min 8 chars) Default password on first boot is "admin" — change it immediately after flashing via POST /ota/config. Password persisted to NVS and survives reboots. OTAManager is excluded from nRF52 and native (unit-test) builds via platformio.ini build_src_filter rules. https://claude.ai/code/session_01KcwgryFgMCJubfjtwqMnUc
All OTA tunables are now set in platformio.ini (esp32_base) and consumed via preprocessor macros with #ifndef fallback defaults in OTAManager.h: OTA_USERNAME HTTP Basic Auth username (default: "admin") OTA_NVS_NAMESPACE NVS namespace for password (default: "ota") OTA_NVS_PWD_KEY NVS key for the password (default: "password") OTA_DEFAULT_PASSWORD First-boot password (default: "admin") OTA_MIN_PASSWORD_LEN Minimum new-password length (default: 8) Per-board overrides can be added to any [env:*] section in platformio.ini. https://claude.ai/code/session_01KcwgryFgMCJubfjtwqMnUc
OTAManager's class body is gated on #if BOARD_HAS_WIFI, which is not defined when NetworkManager.cpp is compiled in the native test environment. This left OTAManager as an incomplete type and broke all 11 native tests. Changes: - NetworkManager.h: wrap OTAManager forward decl, setOTAManager() and ota_* member in #ifndef NATIVE_TEST blocks. - NetworkManager.cpp: same guard around #include "OTAManager.h", setOTAManager() impl, and ota_->registerRoutes() call. - test/stubs/ESPAsyncWebServer.h: add AsyncWebServerResponse stub, two-callback on() overload (needed by OTA upload handler signature), and authenticate() / requestAuthentication() / beginResponse() stubs. https://claude.ai/code/session_01KcwgryFgMCJubfjtwqMnUc
- NetworkManager.cpp: include board_config.h before OTAManager.h inside the NATIVE_TEST guard so BOARD_HAS_WIFI is defined for ESP32 targets (the #if BOARD_HAS_WIFI in OTAManager.h required it to be set first). - OTAManager.cpp: replace esp_app_get_description() with esp_ota_get_app_description(), which is the correct IDF API on ESP32-C3/S3 and newer IDF versions. https://claude.ai/code/session_01KcwgryFgMCJubfjtwqMnUc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.