Commit Graph
34 Commits
Author SHA1 Message Date
agessaman f9968ac1a5 merge: upstream/dev into observer-firmware-dev (v1.17.0)
Picks up upstream MeshCore 1.17.0 and the dev commits that followed it.

Notable upstream content:
- 1.17.0 version/build-date bump in the example MyMesh headers.
- anon_req hardening: reply_path_len is now uint8_t with an isValidPathLen()
  bounds check and a 0xFF sentinel; reply_path_hash_size is gone.
- LR2021 support (Meshnology W12, Seeed MeshTracker X1) incl. side detectors,
  multi-SF and the new `extra.sf` get/set CLI.
- CustomLFS 0.2.2 -> 0.2.3 (GD25Q64C support).
- kiss_modem envs for several nRF52 variants; ThinkNode M6 GPS/flash fixes.

Conflicts resolved:
- platformio.ini: took upstream's CustomLFS 0.2.3, kept our lib_ignore for
  the vendored PsychicMqttClient.
- CommonCLI.h: kept both upstream's USE_LR2021 configSideDetectors() hook and
  our fault-alert callbacks.

NodePrefs gains upstream's extra_sf[4], which is not registered with
ConfigSerializer, so /prefs.json layout is unchanged.

Verified: 275/275 native host tests pass; Heltec_v3_repeater_observer_mqtt,
Heltec_v3_repeater and heltec_v4_repeater_observer_mqtt all build.
2026-08-09 06:32:53 -07:00
Rastislav Vysoky c2d57f08c8 add missing kiss radio roles, add kiss radio build to build.sh 2026-08-09 14:17:18 +02:00
agessaman 612c52132c merge: upstream/dev into observer-firmware-dev (2026-07-30, db232808)
Absorbs 106 upstream commits. Seven files conflicted; the substantive one
was upstream's new JSON ConfigSerializer (PR #2982), which replaces the
binary /com_prefs layout with /prefs.json and makes NodePrefs a
ConfigSerializer subclass.

Prefs migration
- Adopt upstream's ConfigSerializer. writeCommonPrefsImage() and its
  documented offsets (0-294) are deleted, along with the now-unreachable
  saveCommonPrefsImageAtomically()/CommonPrefsFileStore atomic rename path.
- Load order is /prefs.json, then /com_prefs, then /node_prefs. Upstream
  dropped the /node_prefs fallback; it is restored here so devices that
  never advanced past that filename keep their config.
- Legacy files are never removed, so migration cannot destroy its own
  source and a deferred or failed save simply retries next boot.
- /com_prefs is treated as a format migration only, not an "upgrade", so
  it does not trip the bridge.source tx->rx flip on existing nodes.
- The MQTTPrefsAtomicStore legacy gate is retained: the observer tail
  recovered from an old-format file still commits to /mqtt_prefs before
  /prefs.json is written.
- MQTTPrefs and /mqtt_prefs are untouched; savePrefs keeps its save_mqtt
  parameter and now returns upstream's bool.

Fixes to upstream code
- RadioPrefs::structure() bound both "rxgain" and "fem_rxgain" to
  rx_boosted_gain, so radio_fem_rxgain was never persisted. Bound to the
  correct field.
- discovery_mod_timestamp was dropped from structure(); it gates
  'since'-filtered DISCOVER replies and is set on every config change, so
  losing it would silently stop discovery responses after a reboot. Added
  as "disc_mod".

Merge artifacts repaired
- Restored bblanchon/ArduinoJson to the native test env; a clean but wrong
  auto-merge at the lib_deps block boundary dropped it and broke all 19
  host test suites.
- Migrated the fork's WebConfig UITask screens off the removed
  DisplayDriver::Color enum to upstream's UIColor element types.
- Removed duplicate getCADEnabled() definitions in companion MyMesh.cpp
  and simple_sensor SensorMesh.cpp that both sides had added.
- Dropped memset(&_prefs, 0, ...) in the four example meshes; NodePrefs now
  has a vtable. guard gains an initializer that memset used to provide.

Other resolutions
- simple_room_server keeps both the fork's discover.* commands and
  upstream's new room.post.
- docs/payloads.md taken from upstream, undoing content earlier merges had
  reverted (Control data section, split login tables).

Verified: 273/273 host tests pass across native and native_kiss_modem;
Heltec v3 repeater, repeater_observer_mqtt, room_server_observer_mqtt,
sensor, and companion_radio_ble all build clean.
2026-07-30 14:56:23 -07:00
agessamanandClaude Opus 4.8 41cc36b773 build.sh: put the published build number in observer asset filenames
Stamp FIRMWARE_BUILD_NUMBER into FIRMWARE_VERSION_STRING (the output
filename), so dev assets become <env>-v1.16.0.N-dev-<hash>.bin and the web
flasher's Version dropdown (parsed from the asset name by the /releases
Worker) shows the true published build instead of the bare base version.

The build-number suffix is computed once, up front, and now feeds BOTH the
filename and the embedded -DFIRMWARE_VERSION (byte-for-byte unchanged, it
already carried .N). Local builds without the counter still produce
3-segment names, so OTA and every filename parser stay backward-compatible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 11:26:35 -07:00
agessaman f5090667b9 build: add FILENAME_CHANNEL_TAG; dev channel tags asset filenames with -dev
Dev-channel assets are now named <env>-v1.16.0-dev-<hash>.bin so a
downloaded file identifies its channel at a glance; production names are
unchanged (tag unset). The tag sits between version and hash, lowercase
letters only — the flasher-side parsers (gen-slim ASSET_RE, /releases
Worker label+dedupe, flasher.js stale-URL recovery) were made
tag-tolerant first and are already deployed. Filename-end hash
extraction (release pruning) is position-independent and unaffected.

Pushing this intentionally triggers a beta build: that publish is what
applies the new naming. The Worker's dedupe collapses the untagged
9276b6a generation and the new tagged one to the newest per env, so the
flasher never lists both.
2026-07-19 22:37:09 -07:00
agessaman 5094ece3bf ci: add beta release channel workflow
Publishes a parallel observer firmware channel that cannot cross-contaminate
production. Manual dispatch only, so the branch is chosen in the Actions UI
rather than hardcoded here.

Channel separation (each of these is load-bearing, not cosmetic):
- OTA_MANIFEST_BASE_URL -> beta nodes only ever read beta manifests. This is
  the one that actually keeps devices on-channel.
- Separate RELEASE_TAG: the publish step prunes all but KEEP_BUILDS hashes
  WITHIN its tag, so a shared tag would make each channel delete the other's
  assets.
- Separate build counter: shared counters would interleave and make OTA's
  "N behind" comparison meaningless.
- Separate staticPath via a derived config-beta.json.

FIRMWARE_VERSION deliberately matches production: the OTA logic treats a
different base version as "always an update", so channels must be separated by
manifest URL, not base version. OTA_CHANNEL_TAG marks the embedded version
instead (v1.16.0.N-observer-beta-<hash>) so `ver` identifies the channel.

config-beta.json is derived per build rather than committed - a checked-in copy
would be a 56-entry duplicate of config.json that goes stale as devices are
added. Deriving keeps the beta device list identical by construction.

Two verify steps fail the build rather than publish firmware that would OTA
itself onto production: one checks the beta URL is baked into a binary (and the
production URL is not), one checks the generated manifests use the beta host.

Production's changelog and docs sync steps are omitted - those rewrite site-wide
content the production channel owns. The flasher commit is scoped to the beta
manifest dir and counter for the same reason.

Also adds OTA_CHANNEL_TAG support to build.sh. Safe for OTA version parsing:
ota_parseVersion() reads to the first '-' and ota_extractHash() takes the token
after the last, so an extra tag between them changes neither. Verified on a
real build: v1.16.0.7-observer-beta-36831271.
2026-07-19 14:41:54 -07:00
agessaman 36831271fe build: make OTA_MANIFEST_BASE a build.sh-injected release channel
The observer fetches its manifest from <OTA_MANIFEST_BASE>/<OTA_VARIANT>.json,
so that URL IS the release channel. It was hardcoded to the production channel
in 28 identical places across variants/*/platformio.ini, which made a parallel
(e.g. beta) channel impossible: both channels build the same env names, so beta
devices would read the production manifest and silently flash themselves onto
production firmware.

Inject it from build.sh instead, symmetric with OTA_VARIANT (which no .ini
declares), defaulting to the production URL. Set OTA_MANIFEST_BASE_URL to
publish a parallel channel.

Removed from the .ini files rather than overridden: PLATFORMIO_BUILD_FLAGS
cannot reliably override a -D from build_flags, because SCons reorders -U/-D
and the -U can land after both -Ds, leaving the macro undefined. Verified
empirically before choosing this approach.

A default in a header was deliberately NOT added: leaving both macros undefined
on a plain 'pio run' is what keeps ESP32Board.cpp's 'ERR: OTA not configured
(build via build.sh)' guard firing, so locally built firmware is never OTA-armed.

Verified on Heltec_v3_repeater_observer_mqtt:
- plain 'pio run'      -> OTA disarmed, no manifest URL in the binary
- build.sh (default)   -> https://observer.gessaman.com/v
- OTA_MANIFEST_BASE_URL set -> beta URL only, production URL absent
2026-07-19 14:37:06 -07:00
Liam Cottle a3a1aa5e3b Merge pull request #1865 from MeshEnvy/fix/python-json-parse-error
fix: JSON parsing regression in build.sh
2026-07-19 22:58:21 +12:00
liamcottle 54234b5837 implement matrix builds for faster firmware releases 2026-07-07 13:23:18 +12:00
agessaman 125ddac184 feat(ota): add partition-table signature handling for OTA updates
Implemented functionality to generate and compare partition-table
signatures during OTA updates. This enhancement ensures that the
target build's partition layout matches the device's actual layout,
improving the reliability of OTA updates and preventing issues
related to partition changes.
2026-06-23 15:38:10 -07:00
agessaman 730eb37dbd feat(ota): implement build number suffix for firmware versioning
Enhanced the firmware versioning system by appending a build number
suffix when available, allowing for better tracking of published builds.
This change improves the OTA update process by providing clearer
versioning information in the embedded firmware string.
2026-06-23 12:55:07 -07:00
agessaman 004d308ea9 feat(ota): implement pull-based OTA from manifest for observer builds
Added functionality to support pull-based OTA updates by fetching firmware
from a manifest. The new `otaFromManifest` method allows the system to
check for available updates and flash the firmware if necessary. This
enhancement improves the update process for observer builds using the
MQTT bridge, ensuring a more seamless firmware management experience.
2026-06-21 11:57:05 -07:00
agessaman b45373a31f Update firmware build date format and enhance MQTT timestamp handling to always emit UTC with "+00:00" offset. Adjusted buffer sizes for timestamps in MQTTMessageBuilder and MQTTBridge to accommodate new format. 2026-06-06 20:29:52 -07:00
agessaman bf8a3a7a41 Refactor build script to improve project configuration handling and artifact management. Cache project config JSON for environment platform checks, streamline binary merging for ESP32, and ensure all generated artifacts are copied to the output folder. Enhance error handling during binary generation processes. 2026-03-21 08:20:41 -07:00
Ben Allfree 9844b541b6 fix: JSON parsing regression in build 2026-02-26 20:37:27 -08:00
taco 5df139f3d6 update build.sh to support RP2040 and STM32 2026-02-13 12:43:04 +11:00
Thane Gill 3ff1394dd2 build.sh: add list and -l to list firmwares available to build. 2026-02-08 14:49:57 -08:00
liquidraver a48b185189 DISABLE_DEBUG=1 env variable to build.sh 2026-01-13 12:48:53 +01:00
Devin Carraway d0caa3be04 Fix the sample RAK repeater build target name
The actual target doesn't capitalize the 'r' in repeater.
2025-10-31 22:11:24 -07:00
haxwithaxe 006af52776 Added more polished build.sh usage 2025-10-17 14:20:55 -04:00
Scott Powell 3335b49d9f Merge branch 'main' into dev
# Conflicts:
#	variants/heltec_vision_master_e290/platformio.ini
2025-09-28 19:21:48 +10:00
liamcottle 58ed14d971 build script should check for firmware type suffix 2025-09-28 15:00:45 +13:00
liamcottle e49eef5588 allow building multiple specific targets at same time 2025-09-26 22:59:20 +12:00
liamcottle 3fbdaf7ce6 don't overwrite existing platformio build flags in build script 2025-09-26 22:46:38 +12:00
Wesley Ellis 19fb7aae63 Use python3 not python in build.sh
Since the bin/uf2conv/uf2conf.py script uses python3, use python3 as the command instead of python.
On my ubuntu 24.04 machine, I don't have a python command in my path by default
2025-09-16 18:15:14 -04:00
kelsey hudson 022bfc4f4b Ikoka Stick: Use new UI, make repeater & room server work
* Enable the new UI on the BLE and USB Companion roles.
* Fix compilation issues with the repeater and room server roles.
* Remove ESP32-related alternate pinout cruft from the NRF build tree.
* build.sh: add build-matching-firmwares command to allow e.g. building
  all roles for a given variant by passing the variant name.
2025-08-16 15:09:42 -07:00
recrof 4f2aaa47d3 detect if we have nrf52 by probing for *.zip and *.hex output files 2025-04-27 10:24:38 +02:00
Scott Powell a9dde51a9b * build.sh: .uf2 step also for Faketec/ProMicro targets 2025-03-19 20:22:46 +11:00
Rastislav Vysoky 477f2e1d81 fix: added t114 and t-echo boards to uf2conv release workflow 2025-03-07 13:17:46 +01:00
Scott Powell 7832548714 * now suppressing 'cp' errors 2025-03-05 19:20:28 +11:00
Scott Powell 7b92e045a6 * build script change, for companion radio targets 2025-03-04 14:06:03 +11:00
liamcottle d48bc3a2f1 also build uf2 for t1000e 2025-03-03 21:13:55 +13:00
liamcottle 8a360bcc30 merge bins for esp32 boards 2025-03-03 18:51:27 +13:00
liamcottle 13bc6e4178 setup automated firmware builds with github actions 2025-03-03 17:58:15 +13:00