Skip to content

Feature/wifi internet ota#5

Merged
polipl merged 14 commits into
mainfrom
feature/wifi-internet-ota
Jun 6, 2026
Merged

Feature/wifi internet ota#5
polipl merged 14 commits into
mainfrom
feature/wifi-internet-ota

Conversation

@polipl
Copy link
Copy Markdown
Owner

@polipl polipl commented Jun 6, 2026

No description provided.

polipl and others added 12 commits June 6, 2026 01:38
- WiFiConnect.h: multi-network WiFi manager (WIFI_NETWORKS="ssid:pwd;...")
- InternetOTA.h: HTTPS manifest fetch + HTTPUpdate flash; 4-part semver
  comparison (vX.Y.Z.W); no ArduinoJson dependency
- ESP32Board: startInternetOTA / checkInternetOTA methods (WIFI_INTERNET_OTA guard)
- CommonCLI: 'check cloud ota' / 'start cloud ota' CLI commands
- platformio.ini: [esp32_internet_ota] and [poli_build] sections
- heltec_v4/heltec_v3/xiao_s3_wio: BOARD_ID defines + cloud_ota envs
- LoRaFEMControl.h: disable LNA by default (fixes deaf radio on Heltec V4.3;
  matches upstream commit 696aae6)
- build_firmware.sh: universal build+deploy script; vX.Y.Z.W versioning;
  auto-increment; per-board manifest.json; macOS Bash 3.2 compatible
- poli_version.txt: tracks current PoLi build number (v1.15.0.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CommonCLI.cpp: move cloud OTA else-if blocks from the middle of the
chain to the very end (just before the Unknown command fallback),
wrapped in #if defined(WIFI_INTERNET_OTA) so they are invisible in
non-PoLi builds and clearly scoped in diffs. Also drop the empty
if(!board->...) {} pattern.

MeshCore.h: add [PoLi] comment marker on the virtual methods so
they are easily identifiable during upstream merges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_PWD_N pairs

Semicolon-delimited WIFI_NETWORKS string was fragile (broke on passwords
containing ':' or ';') and hard to read in platformio.local.ini.

- WiFiConnect.h: remove addNetworksFromString() — parser no longer needed
- ESP32Board.cpp: _ensure_wifi_configured() now uses WIFI_SSID_1/WIFI_PWD_1
  through WIFI_SSID_5/WIFI_PWD_5 (up to 5 networks, all optional)
- All cloud_ota variant envs: remove WIFI_NETWORKS placeholder; add comment
  documenting the WIFI_SSID_N/WIFI_PWD_N format for platformio.local.ini
- Also removes MESH_PACKET_LOGGING/MESH_DEBUG from cloud_ota envs
  (debug flags don't belong in production builds)

WiFi credentials belong exclusively in platformio.local.ini (gitignored).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Auto-detect pio at ~/.platformio/penv/bin/pio (macOS PlatformIO install
  does not add pio to PATH for non-interactive shells)
- write_local_ini(): preserve existing WIFI_SSID_N/WIFI_PWD_N lines from
  platformio.local.ini before overwriting with new version/date
- cleanup_ini(): never delete platformio.local.ini if it contains WiFi
  credentials (WIFI_SSID_N/WIFI_PWD_N)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- write_local_ini: replace `[[ -n ]] && cmd` with `if/fi` — the short-circuit
  false exit code was killing the script under set -e when no WiFi credentials
  were present (caused silent exit after Version config, before build loop)
- deploy_board: move DRY_RUN check before the directory existence check so
  dry-run no longer requires the deploy directories to exist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of failing when data/firmware/<board>/ doesn't exist,
create it with mkdir -p. Avoids manual intervention after git clean
or fresh clone of meshcore.epila.pl.

Also bump poli_version.txt to v1.15.0.6 (manually deployed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Firmware binary contains compiled-in WiFi credentials — the download
endpoint needs protection so random internet users can't grab the .bin
and extract passwords with `strings`.

Solution: shared secret token appended as ?token= query parameter to
all firmware requests. Server validates the token in nginx; token is
compiled into firmware via OTA_TOKEN define (platformio.local.ini,
gitignored).

- InternetOTA.h: OTA_TOKEN define (default empty); append ?token= to
  manifest URL and firmware download URL
- build_firmware.sh: preserve OTA_TOKEN in platformio.local.ini across
  runs (same mechanism as WIFI_SSID_N/WIFI_PWD_N)

Token is set in platformio.local.ini and nginx.conf (private repo only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When WIFI_INTERNET_OTA is defined (cloud_ota envs), the repeater
checks meshcore.epila.pl for a new firmware version every 15 minutes.
First check fires 5 minutes after boot (let the device stabilize).

If an update is available it is downloaded and flashed immediately;
the device reboots into the new firmware. No update = no action.
Result is logged to Serial as [OTA] <message>.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After deploying firmware.bin and manifest.json to meshcore.epila.pl/data/firmware/,
automatically run git add + commit + push in the website repo so pull/push
stays in sync and manual git operations are no longer needed after each build.

Skipped when: --dry-run, --no-deploy, or all boards failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Flags were removed without asking during WiFi config refactor.
Restored to match the standard repeater env behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@polipl polipl self-assigned this Jun 6, 2026
@polipl polipl merged commit 9902c68 into main Jun 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant