Commit Graph
4133 Commits
Author SHA1 Message Date
agessaman 45d8f15098 Merge branch 'feat/ota-branch-switch' into merge/ota-branch-into-observer-firmware-dev 2026-10-03 15:52:39 -07:00
agessaman 8ec31dda71 fix(ota): skip the bare compat search literal when scanning an image
Every image also holds "ota-compat:" with no value (the search string);
finding it first made every channel switch look untagged.
2026-10-03 15:52:21 -07:00
agessaman a0856bed72 feat(ota): dev stores /mqtt.json, so its state generation is 2
Builds that only read /mqtt_prefs (gen 1) are refused as channel-switch
targets until they can read /mqtt.json.
2026-10-03 15:47:01 -07:00
agessaman baf01a5c16 Merge branch 'feat/ota-branch-switch' into merge/ota-branch-into-observer-firmware-dev
# Conflicts:
#	examples/simple_repeater/MyMesh.cpp
2026-10-03 15:47:01 -07:00
agessaman ed8af1b7ca fix(ota): refuse a channel switch to a build that cannot carry this node
A switch can land on an older build: e.g. prod cannot read dev's /mqtt.json,
and prod's M7 image has no Ethernet. Each image carries an ota-compat tag
(state generation + transports). A switch is flashed without rebooting, the
new image's tag is read (bounded by its length), and boot is pointed back at
the running image unless the target keeps this node's state and transports.
CI now requires the tag in every published binary.
2026-10-03 15:46:46 -07:00
agessaman f652e7d185 fix(ota): flash the channel ota update checked, not a later ota branch
The deferred flash re-read the channel preference ~2.5 s after ota update
acknowledged its target; capture it when the update is scheduled.
2026-10-03 15:37:49 -07:00
agessaman a1943a8eac fix(ota): always offer another channel's image, even from the same commit
Prod and beta are often built from one commit (e.g. after a dev->prod merge),
so a hash match does not mean the images are the same: the native base differs.
After the flash the target channel is native, so this cannot loop.
2026-10-03 15:37:49 -07:00
agessaman ee88192acb Merge branch 'feat/ota-branch-switch' into merge/ota-branch-into-observer-firmware-dev
# Conflicts:
#	.github/workflows/build-observer-firmwares.yml
#	examples/simple_repeater/MyMesh.cpp
#	examples/simple_room_server/MyMesh.cpp
#	src/helpers/ESP32Board.cpp
#	src/helpers/ESP32Board.h
#	test/test_config_serializer/test_config_serializer.cpp
2026-10-03 15:24:33 -07:00
agessaman 65d80bc908 ci(ota): verify each published binary's native channel by tag
Every observer build now carries both channel URLs, so checking for a URL's
presence or absence can no longer tell prod from beta (and the old checks would
reject every build). Read the ota-base-* tags from every .bin in out/ instead
of a single ELF, with URLs shared by build.sh and both workflows.
2026-10-03 15:24:11 -07:00
agessaman 9c65e198f1 feat(ota): prod/beta channel names for ota branch, with stable/dev aliases
Report the selected channel and the build's own channel, tag each baked-in
base for CI, and list ota branch in the CLI docs and portal autocomplete.
2026-10-03 15:19:06 -07:00
agessaman 4afb3f7e3f build(ota): point the stable/dev channel bases at observer.gessaman.com 2026-10-03 15:17:46 -07:00
agessaman 2633b4267c fix(ota): compare by commit hash when targeting another channel
Build counters are per channel, so a cross-channel build number is not
comparable: a switch to a channel with a lower counter reported up to date
and never happened. Off the native channel, update unless the hash matches.
2026-10-03 15:17:46 -07:00
Elektr0Vodka 763ba835c1 build(ota): bake stable + dev manifest bases into observer builds
(cherry picked from commit 29011959170db757ec5364de88f6beeaae82b995)
2026-10-03 15:17:36 -07:00
Elektr0Vodka ea541e182a feat(ota): add 'ota branch [stable|dev|default]' command
(cherry picked from commit 240804999edb284fd276489e6898ccad8a19a8e7)
2026-10-03 15:17:36 -07:00
Elektr0Vodka 942a19eb63 feat(ota): pass runtime manifest base through otaFromManifest
(cherry picked from commit 0bee84c0546780b2e7147148c32087e92d894ac0)
2026-10-03 15:17:36 -07:00
Elektr0Vodka 3910489414 feat(ota): persist ota_channel selector in NodePrefs
(cherry picked from commit db1db5b57ecce408c7441cb6aa70f29608b09603)
2026-10-03 15:17:36 -07:00
Elektr0Vodka f04d163bea feat(ota): channel-base resolver + arg parser with native tests
(cherry picked from commit 52a4ccc39093891b64e3752316fe7c191fd9b9ca)
2026-10-03 15:17:36 -07:00
Adam Gessaman 1e23d7c1e4 Merge branch 'feat/mqtt-connection-health' into observer-firmware-dev 2026-09-26 14:19:06 -07:00
agessaman 7d0a602b20 fix(mqtt): exclude unready slots from slot health and keep cf monotonic
A slot waiting on a token/IATA/credential stays enabled but never attempts a
connection, so it held mqtt_slots_up below mqtt_slots_total (and down= at 1)
permanently -- a standing false alert on a node that is merely unconfigured.
slots_total and down= now count only ready slots, matching the CLI's "wait".

mqtt_connect_failures summed only enabled slots, so disabling a failing slot
made it drop. It now sums every slot, monotonic within a boot.

cf: moves after the error tail in mqttN.diag so a clamped 160-byte reply
loses the count rather than the refusal/TLS detail. A failed start now clears
the attempt flag instead of restoring a possibly stale one. Outage comments
corrected: the clock starts at a slot's first DISCONNECTED, not first connect.
2026-09-26 13:54:43 -07:00
agessaman f37445f8a7 fix(mqtt): count only failed starts, not rejected reconnects, in cf
reconnect() on a started client returns ESP_FAIL while an attempt is already
in progress. On a Heltec V3, a live reconfigure hit exactly that and the
attempt then connected, yet cf read 1. Count start_failures only when
connect() on a stopped client fails, and restore the attempt flag to its
prior value on any failed call so the in-progress attempt is still judged by
its own outcome.
2026-09-26 12:48:44 -07:00
agessaman 6390763c71 fix(mqtt): count failed starts and ignore bounced sessions in cf
connect()/reconnect() returning an error started no attempt, so no event
arrived and the failure went uncounted -- the low-heap case the counter exists
for. Counted now in a bridge-task-only start_failures, summed into cf: and
mqtt_connect_failures.

A renewal or corrected-clock bounce whose softDisconnect() times out gets its
old session's DISCONNECTED after the new attempt raised the flag. That session
is still marked connected until the handler runs, so the gate now also
requires !connected. An ignored late CONNECTED clears the flag too.

cf: no longer depends on dc being non-zero. Comments corrected for the
PSRAM-fallback stack cost and heap_largest's sampling point; the worst-case
test now models 6 slots.
2026-09-26 12:25:53 -07:00
agessaman 73098a44b6 fix(mqtt): count connect failures from a flag set before the attempt
The Starting-state gate raced the event task: client_state becomes Starting
only after connect()/reconnect() returns, so a fast failure could deliver
DISCONNECTED first and go uncounted, while a deliberate stop of an attempt in
flight was counted as a failure. A per-slot flag is now raised before the call
and cleared by onConnect, a failed start, or stopSlotClient().

Also stops zero-valued connect_failures/slots_breaker from creating an empty
stats object.
2026-09-26 11:53:54 -07:00
agessaman 7004b81c0c feat(mqtt): count connect failures and report tripped breakers
Two gaps remained after the first connection-health commit.

A slot retrying into a heap that cannot satisfy its TLS allocation moved no
counter at all. disconnect_count rose, but it also rises for dropped live
sessions, so it could not separate "actively failing to connect" from "was
connected, dropped once". Adds a per-slot connect_failures, incremented in
onDisconnect when the event arrives while the client is Starting -- meaning
it ended an attempt that never reached onConnect. Late events from a stopped
or quarantined client, and soft-disconnects of a live session, are in other
states and are not miscounted.

A slot parked by the circuit breaker also looked identical to one still
retrying, despite being materially worse: the breaker only probes every 30
minutes, so recovery is far slower and an operator may need to intervene.

Surfaces both:
- `mqttN.diag` gains `cf:<n>` beside the existing `dc:<n>`.
- the status payload gains `mqtt_connect_failures` (summed across slots) and
  `mqtt_slots_breaker` (count of tripped slots), each emitted only when
  non-zero so a healthy board's payload does not grow.

The counter is what distinguishes a retrying slot from a quiet one: while a
slot is down its publish counters cannot move by definition, so this is the
only value that shows the device is still trying.

Both suggested by adversarial review.
2026-09-26 11:10:13 -07:00
agessaman 383339eccc fix(mqtt): size the status buffer for real field maxima
The worst-case test added with the connection-health fields did not model
production maxima -- it used a 28-byte model and a 24-byte firmware string,
while MQTTBridge permits _origin[32], _device_id[65], _board_model[64],
_firmware_version[64] and derives a 63-byte client version. isValidName()
rejects [ ] / \ : , ? * but permits '"', so a 31-character node name of
quotes is legal and every quote escapes to two bytes.

Measured at those real maxima:

  without connection-health fields   762 bytes
  with connection-health fields      851 bytes
  buffer                             768 bytes

So the 768-byte buffer already had only six bytes of headroom before this
work, and the four new fields overflow it. Overflow is silent:
serializeComplete() returns 0 and clears the buffer, and the bridge
publishes only a positive length, so a device would simply stop publishing
status with no error anywhere -- the same blindness the connection-health
fields exist to remove.

Raises STATUS_JSON_BUFFER_SIZE to 1024 and corrects the test to use the
actual maxima. Status serializes into the shared 2048-byte publish scratch
buffer, so this costs no extra RAM; only the PSRAM-allocation-failed stack
fallback grows by 256 bytes. A static_assert keeps the status ceiling within
the shared buffer.

Found by adversarial review of the preceding commit.
2026-09-26 11:09:21 -07:00
agessaman f7ed2f176d feat(mqtt): report slot connection health so an outage is visible
A slot that cannot establish TLS reported nothing. The per-slot counters
track publish successes and failures, and a slot that never connects never
attempts a publish -- so its ok count freezes and its error count stays at
zero for the entire outage. Observed on hardware: a slot sat dead for over
five hours while `sN=` showed 0 errors and the published status payload
carried no indication at all.

Two surfaces gain the missing signal:

- `get mqtt.stats` gains `down=<n>` (omitted when zero, like `filt=`) and
  marks each disconnected slot with a trailing `!`. The marker goes after
  the counts so existing "s(\d)=(\d+)/(\d+)" parsers keep matching.
- The published status payload gains `mqtt_slots_up`, `mqtt_slots_total`,
  `heap_largest`, and `mqtt_outage_secs`. These ride on every healthy slot's
  status message, because the slot that is down cannot report itself.

`mqtt_slots_up < mqtt_slots_total` is the condition to alert on.
`mqtt_outage_secs` is detail: it is present only when the outage has a known
start, so its absence does not imply health -- a slot that has never
connected since boot has no outage start time.

`heap_largest` is included because free heap alone does not predict a failed
connection. A slot needs one contiguous 16,384-byte block for its TLS record
buffers; measured immediately before an attempt this value predicted the
outcome in every observed case, while total free heap was 85 KB throughout a
multi-hour outage. A low value with every slot up is normal rather than a
fault -- established sessions already hold their buffers.

Publish-error semantics are unchanged: connect failures are not folded into
them.

Adds host coverage for the new fields, for the outage key's presence rule,
and for worst-case payload size. That last one matters because
serializeComplete() returns 0 and clears the buffer on overflow and the
bridge publishes only a positive length, so exceeding the 768-byte status
buffer would silently stop status publication -- the same blindness this
change exists to remove.
2026-09-26 11:05:40 -07:00
agessaman 43b55de26f Merge branch 'fix/mqtt-omit-unknown-snr-rssi' into observer-firmware-dev 2026-09-26 10:52:15 -07:00
agessamanandACETyr a91009e3dd fix(mqtt): omit SNR/RSSI instead of publishing placeholder values
The reconstruction-less fallback path in buildPacketJSON (queued packet
with no captured raw frame that cannot be re-serialized) published
fabricated SNR 12.5 / RSSI -65 that consumers could not distinguish
from real radio readings. It now passes NAN / MQTT_RSSI_UNKNOWN, and
buildPacketMessage omits the SNR/RSSI keys entirely when no measurement
exists, mirroring the existing score omission.

Ports the fix from ACETyr's PR #13 (0a037040) on mqtt-bridge-implementation.

Co-Authored-By: ACETyr <35745290+ACETyr@users.noreply.github.com>
2026-09-26 10:46:11 -07:00
agessaman 91d9db9c7f Merge branch 'feat/observer-more-esp32-boards' into observer-firmware-dev 2026-09-26 10:08:18 -07:00
agessaman 33f1b1096d feat(observer): add dev-preview observer envs for 11 more ESP32-S3 boards
Repeater + room-server observer builds for Heltec RC32 (with and without
display), Wireless Tracker v1.0, Wireless Paper, Vision Master E213/E290,
Meshnology W12, LilyGo T-ETH Elite (WiFi only), T3S3 SX1276, Xiao S3 and
Ebyte EoRa-S3. The 4 MB boards (T3S3 SX1276, EoRa-S3) use min_spiffs and
omit SNMP; non-PSRAM boards opt into MQTT_NEIGHBORS_WITHOUT_PSRAM.
2026-09-26 10:03:48 -07:00
agessaman 6baffa753c Merge upstream/dev into observer-firmware-dev
Picks up 35 upstream commits through 988d017a: board loop() hook,
sensor SUBSCRIBE/telemetry push, companion MyMesh::Listener UI refactor,
agc.reset.interval widened to uint16, LR1121 DC-DC, ThinkNode M4 and
Muzi Base boards, M7 companion WiFi.
2026-09-26 09:32:09 -07:00
Liam Cottle 988d017abb Merge pull request #3497 from meshcore-dev/companion-telem-push
Companion Telemetry push support
2026-09-26 20:51:39 +12:00
Liam Cottle 618b2ef467 Merge pull request #3500 from liamcottle/board/wio-tracker-l1-1watt
disable hibernate ui on 1watt wio tracker variant
2026-09-25 16:57:59 +12:00
liamcottle aa1c46e1db disable hibernate ui on 1watt wio tracker variant 2026-09-25 16:55:17 +12:00
Scott Powell b204f9a114 * changed onUnhandledResponse() to return true if handled/consumed
* unhandled responses (eg. push telemetry) now sent to app as PUSH_CODE_BINARY_RESPONSE frames
2026-09-24 13:49:57 +10:00
Liam Cottle c423dece36 Merge pull request #3490 from liamcottle/fix/heltec-ct62
Fix Heltec CT62 boot loop
2026-09-23 17:48:04 +12:00
liamcottle c13b312188 fix heltec ct62 boot loop 2026-09-23 15:04:51 +12:00
Scott Powell 69f3022a5e Merge commit '140178728b34c821b5169665c1f6f5ede2b9f543' into dev 2026-09-22 18:02:33 +10:00
Scott Powell 560fb847d5 missing board.loop() in companion, room server, kiss modem. 2026-09-22 18:01:15 +10:00
ripplebiz 140178728b Merge pull request #3427 from Dom4n/feat/lr1110-dcdc-dev
Enable DC/DC for LR1110 radios
2026-09-22 17:57:09 +10:00
ripplebiz a76d511ff4 Merge pull request #3131 from liekmarflow/feature/board-api-hooks
Add board loop hook for periodic work
2026-09-22 16:43:18 +10:00
Wolfram Keil 61be70849a Add board loop hook for periodic work 2026-09-22 08:01:48 +02:00
ripplebiz 5e9d80df38 Merge pull request #3464 from lbibass/lr1121_dcdc
LR1121 DC-DC & Misc Updates
2026-09-22 15:12:56 +10:00
ripplebiz 7faf87682c Merge pull request #3469 from Blake-Latchford/issue/3409/constrain-agc-interval
Constrain `agc.reset.interval` and allow intervals > 255s
2026-09-22 15:03:03 +10:00
Blake Latchford 0c3fe356d0 Constrain agc.reset.interval and allow intervals > 255s 2026-09-21 12:26:36 -04:00
fdlamotte be371634d0 Merge pull request #3468 from weebl2000/thinknodem4_fixes
Thinknode m4 - don't touch crystal and OTA name
2026-09-21 11:09:55 -04:00
Wessel Nieboer b5787757a7 Thinknode m4 - don't touch crystal and OTA name 2026-09-21 15:55:44 +02:00
fdlamotte f4ae72dc12 Merge pull request #3436 from Blake-Latchford/wio-e5-fix
WIO-E5 Fix: Pin Radiolab for stm32 and replace ltoa
2026-09-21 05:50:12 -04:00
ripplebiz 65737d48f4 Merge pull request #3402 from meshcore-dev/sensor-improvements
Sensor improvements
2026-09-21 19:03:18 +10:00
Ev Lbibass 84f1e11d29 update structure of LR1121 to match LR1110 files. Implement DC-DC on LR1121 radio. saves about 30% power consumption at idle. 2026-09-20 20:38:05 -04:00
fdlamotte f8f9bd4daf Merge pull request #3463 from fdlamotte/thinknode_m4
Thinknode m4
Doing the merge now as it doesn't touch anything outside its own variant dir and its board file ;)
2026-09-20 16:22:47 -04:00