A promotion only carries filter commits, never upstream ones, while dev
tracks upstream dev and stable tracks upstream main. Between upstream
releases a path upstream changed in that gap differs between the two
branches even though no filter commit was lost, so the skip check failed
every promotion that skipped a pick (the mesh clock sync and !ack confirm
commits, whose stable copies were hand-resolved and no longer share a
patch-id). Exclude paths where the channels' upstream bases differ; the
skipped commits' own paths are still verified.
Verified against the failing promote-stable run #5: the same two skips
now pass the check and publish, a deliberately deleted skipped-commit
file is still reported, and the two skipped commits' 12 files match the
source on the published branch.
Append the node's RTC time to the clock mesh status as an ISO 8601 UTC timestamp (YYYY-MM-DDTHH:MM:SSZ), shown in both the off and on states.
The rendering lives in one formatIsoTime() helper in MyMesh; MeshClockSync receives the preformatted string so the unit stays free of RTClib and host-testable. MESHCLOCK.md and the native CLI tests are updated.
The release job runs four builds beside the restored PlatformIO cache on a
four-core runner. A target that fails on memory/disk pressure or a registry
hiccup currently stays missing until someone reruns it by hand, and its
per-target log dies with the runner.
- print the last 20 lines of a failed target's log into the job log
- report free disk and available memory at the start and end of a run
- prune a failed target's .pio trees with --prune, once it is given up on
(the transient retry keeps them for an incremental second attempt)
- treat OOM, disk-full and linker-crash signatures as transient, so those
retry inside the attempt loop
- add --retry-failed and a workflow step that rebuilds the first pass's
failures with two workers; a deterministic failure just fails again
Tested with bash -n, the build-tooling tests, a forced failing retry (the
RS232 bridge overflow) that printed the tail and pruned the tree, and
--retry-failed --dry-run, which leaves the previous state intact.
Heltec_ct62_repeater_bridge_espnow and the two Tenstar_C3 espnow
targets have never built (they are absent from filter-v1.18.0-r1 as
well): ESPNowBridge::recv_cb takes an int32_t where esp_now_recv_cb_t
wants an int, which only fails on the RISC-V toolchain.
Leave them to upstream rather than carrying the change in the fork; the
release ships without those assets.
The RXPS runtime pushed every STM32 repeater target past its 224 KB
flash region: Tiny_Relay and RAK_3x72 4.2 KB over, wio-e5 4.4 KB, and
wio-e5-mini 3.3 KB and the wio-e5 RS232 bridge 3.5 KB even with LTO.
The STM32WL radio has no receive duty cycle, so the runtime is dead
weight there: CommonRadioPrefs compiles it out under STM32_PLATFORM and
`radio.rxps` reports unsupported, which matches the hardware.
wio-e5_repeater is then 96 B short, so it joins the existing LTO
workaround in the release script (framework/libraries only, keeping the
.su files the stack gate needs).
Sizes recovered: Tiny_Relay/RAK_3x72 228,908 (468 B free), wio-e5-mini
227,996 (1,380 B), wio-e5 RS232 bridge 228,260 (1,116 B), wio-e5
225,916 (3,460 B). The native suites still pass.
POWER.md gains an Attribution section and the README/AGENTS entries point
at it, so the provenance is unambiguous: `powersaving` is upstream
MeshCore used unchanged, the RXPS duty-cycle subsystem (policy, level
ladder, preamble guard, CLI, wrapper integration and host tests) is
EasySkyMesh's work (IoTThinks/MeshCore, PowerSaving-v18, Kevin Le), and
this fork added the port, the persisted `cpu.freq`, the PowerProfile
glue, the pre-feature defaults and the guide.
The new suite needs its own env for source selection, like the other
feature suites; without the ignore entry `-e native` selected it and the
link failed, which showed up as 821/822 in the combined run.
Moves the twelve additive function definitions (arming, status, noise
floor calibration, receive-restart helpers) from between upstream's
functions to a single fork section at the end of RadioLibWrappers.cpp.
Behaviour is identical - verified by build, the 821-test host run, the
other-target builds, and on-air: direct CLI commands still ACK and the
node still idles at its duty-cycled current.
The point is conflict locality: upstream edits these files regularly
(23 commits in 12 months), and a hunk landing next to a 220-line fork
block produces a much worse conflict than one landing next to the 1-6
line hooks that remain in place.
Adds POWER.md, the PowerProfile/RXPowerSaving files and the new native
suite to the guide list, the code map, the test/build env lists and the
fork-owned set.
Adds a merge playbook for the RXPS layer: which upstream files carry fork
lines, how to resolve each kind of conflict, the on-air verification that
a radio-layer conflict needs (a wrong delegation makes the node deaf while
it still transmits), and the measured upstream churn behind the advice.
Brings over the 45 host tests that cover the duty-cycle policy — the
level ladder and its preamble guard, timer-condition validation, the
preset/raw CLI parsing and the `get radio.rxps` report — and wires them
into a native env (plus an ASan+UBSan twin). This is the coverage the
easyskymesh branch carries for the same subsystem; both envs pass.
The suite also pins the pre-power-feature default: a fresh config is
disabled with the balanced level carried for `set radio.rxps on`.
RX power saving is off and the CPU frequency defaults to 240 MHz, so an
installation that upgrades sees no behaviour change: continuous RX and the
board's usual clock until the operator opts in. Stored preferences are
untouched, so a node already running the profile keeps it.
POWER.md documents the defaults accordingly.
POWER.md documents the three knobs (`powersaving`, `radio.rxps`,
`cpu.freq`), the level scale and its preamble guard, the measured profile,
persistence, the `get/set` surfaces and what the profile deliberately does
not do. README links it next to the other guides.
The `cpu.freq` parsing/apply and the repeater's power defaults + radio
hook move out of CommonCLI and MyMesh into src/helpers/PowerProfile.*, so
those upstream files carry call sites only: 52 upstream lines removed, 6
call lines left.
`set cpu.freq 0|40|80|160|240` stores the clock under power.cpu_mhz,
applies it immediately and again from loadPrefs() at boot; `get cpu.freq`
reports it. 0 restores the frequency the board booted with. The observer
build no longer forces 80 MHz at compile time.
Repeater work is I/O-bound, so the cap costs no protocol timing: the
filter's TinyRegex budget is in steps, and WiFi needs only 80 MHz on the
S3. A UART console is re-initialised after a clock change so its baud
divider follows the new APB frequency.
Measured on the Xiao S3 WIO: the awake window drops from 54 mA at 240 MHz
to 32 mA at 80 MHz; the idle floor (light sleep + RXPS) stays at ~3.75 mA.
Brings the fork's RXPS subsystem over from custom-companion-easysky: the
receive duty cycle on SX126x/LLCC68/LR11x0, the level scale that keeps the
datasheet preamble-capture guarantee per preamble profile, the
`get/set radio.rxps` CLI, and the radio-wrapper state machine that re-arms
the cycle around TX, packet reception and noise-floor calibration.
RXPS is on by default at the balanced level; the observer build also caps
the CPU at 80 MHz (awake windows only, protocol timing is unaffected).
Measured on the Xiao S3 WIO (SX1262, SF7/62.5 kHz, 0-hop path, bench PSU):
idle, no sleep, continuous RX, 240 MHz 54 mA
powersaving on (light sleep) 6 mA
+ radio.rxps level 6 (37.6% duty) 4 mA
+ CPU 80 MHz 4 mA steady (3.75 mA on a DMM)
Delivery with rxps level 6: 8/8 direct CLI round trips ACKed.
Follow-ups before this leaves the work branch: host tests for the guard
math, user docs for the `radio.rxps` surface, and the wio-e5_repeater
flash overflow (~4 KB over; it fits on the base branch).
`start ota` could only use a station link that a broker slot had already
brought up, so on an observer with no broker the command always fell back to
the MeshCore-OTA setup hotspot — even with Wi-Fi credentials stored.
`start ota` now brings the station up itself when credentials are stored,
waits up to 10 s for the association, and leaves the link up so the update
page keeps answering on the LAN address. The hold is RAM-only, so the reboot
that ends an OTA session returns the node to its idle Wi-Fi-off state. The
common CLI still starts the server, so a node without credentials or a failed
association falls back to the hotspot exactly as before.
The decision is a pure policy (host-tested); the observer keeps ownership of
the Wi-Fi calls in the worker task.
The fork's v1.18.0-r2 code pushes wio-e5-repeater_bridge_rs232 152 B over
its 224 KB flash region (r1 still fit, with 432 B to spare). Build that
target with -flto for the framework/libraries and -fno-lto for project
sources, exactly as wio-e5-mini_repeater already is: it now uses 226,488
bytes (2,888 under the limit) and still emits the .su files the stack gate
checks. The override lives in the release script so the upstream variant
stays untouched.
Some targets never build (upstream variant bugs) and a hosted runner loses
a few more per release to transient registry/toolchain failures (r1 lost
19, r2 lost 8); the missing assets are recovered with a filtered rerun.
The release build job now passes the script's new
`--allow-build-failures`: the failed targets are still listed, but the job
passes, so a release ships the targets that did build. A run that never
completed a target, or an upload that failed, still exits non-zero.
A source-side squash gives a commit a fresh patch-id, so `git cherry` keeps
listing a commit whose content is already on stable under another hash;
cherry-picking it then conflicts with stable's own copy and the whole
promotion aborts (issue #9: the clock and !ack-confirm commits).
Skip a pick that conflicts and keep going, then prove the skip lost nothing:
every path the source changed since its upstream merge base must match the
source revision before the gate runs. A real loss still fails the promotion,
and the issue now lists the skipped commits next to the drifted files. The
same source promoted twice now finds nothing to pick instead of conflicting.
filter-release-build.yml builds a named release by invoking
scripts/local-release-build.sh -- the same script, flags and code path used
locally -- instead of the retired per-target matrix. One job with the
script's own build pool (4 workers = the runner's vCPUs), --prune so the
disk holds, and a PlatformIO-home cache so the toolchain download is paid
once.
Inputs: release URL or tag, workers, target filter, and build-only (the
artifacts become a workflow artifact instead of release uploads).
--prune deletes .pio/build/<target> and .pio/libdeps/<target> once the
target's artifacts are in out/, so a full release peaks near one target's
tree instead of ~50 GB (27 GB of libdeps alone on a 173-target release).
Opt-in: without it the worktree stays incremental for reruns.
The broker can keep closing an in-process reconnect even with a resumed
session and a rebuilt client. After five consecutive `closed` failures,
reset the Wi-Fi station so both slots get fresh TCP/TLS state, as a
reboot would, without rebooting the repeater. `mqtt recover` forces the
same reset on demand. This is a fallback, not a substitute for the
clean-session fix.
Reconnecting with clean_session=true asks the broker to discard the
session; some brokers close the new connection while the old client-id
session is still settling. Resume the session instead with the stable
client id.
The clean-session flag and credentials only take effect on a fresh
client: reusing the started client leaves the previous state in place,
so rebuild it whenever the configuration changes.
Record the MQTT client's transport error (esp-tls, stack, certificate
flags, socket errno) and the observer's own attempt outcomes. A broker
that closes the session without a transport error is reported as
`closed`, so an identity/auth refusal stays distinguishable from a
network failure.
Expose the last error plus attempts, consecutive failures, age and the
next retry as `get mqttN.diag`. The last error survives a reconnect, so
a recovered slot still explains what happened; `get mqttN.status` is
unchanged.
`start ota` always brought up the `MeshCore-OTA` setup AP and replied with
192.168.4.1, even on an observer that already holds a station link. Use the
station address when the link is up and keep the AP as the fallback, so the
reply URL points somewhere the operator can actually reach from their own
network. Companion builds with Wi-Fi get the same behaviour.
Squashes repeater-filter-fleet-reply-budget (41 commits).
Replies
- CLI_REPLY_MAX is 157, leaving room for the core's "xx|" companion-radio
prefix inside the 160-byte buffers a reply is written into; CliBuf is the
one bounded writer, cliCutReply() the one cut marker, cliPrepare() the one
command entry point.
- The filter, battery, fleet, clock and observer CLIs all write through
them, so no reply can overrun the core's buffer and a cut reply says so.
Fleet
- A reply is byte-identical across the ack retry: the room derives from the
frozen node name, so the same name and body make the same packet.
- A refused send stops retrying, a re-sent !at job counts as a duplicate,
the job key is validated before it is echoed, and the receive path no
longer copies the directive tail onto the loop task's stack.
- FLEET_ACK_RETRY=0 is compiled and run (native_fleet_noack), and every
fleet deadline is pinned across the millis() rollover.
Observer
- The mqtt*/wifi* CLI moved into a host-tested MQTTObserverCli unit; broker
health and publish accounting are reworked, and a topic template with an
unknown placeholder is refused.
Clock
- The deadband is inclusive, and the status line no longer claims a set
clock when the clock is unset.
Build & CI
- The promotion gate runs every host suite; the local release builder
accepts bash 5.x, fails when a target or an upload does not succeed, and
reports a missing conflict list instead of throwing; observer targets
are part of build-all.
Docs: FILTER.md, FLEET.md, MESHCLOCK.md, MQTT_OBSERVER.md and AGENTS.md
follow the code.
The ESP-IDF keepalive timer is refreshed by every outbound write, so a busy
observer can sit on a half-open socket with the local connected flag still
true forever. Track one outstanding QoS 1 probe per broker: the status message
is the probe while status is enabled, and with status off one packets/raw
publish per mqtt.interval is promoted to QoS 1. A probe left unacknowledged
for 60 s force-stops the slot and reconnects on the normal backoff ladder.
The observer redirects mbedTLS allocations to PSRAM when the board has it,
but the connect headroom gate still measured the internal heap. On a PSRAM
board a fragmented internal heap could therefore defer a second TLS slot
indefinitely (until a reboot) even though the TLS context would fit in PSRAM.
Apply the secure thresholds to PSRAM when it serves mbedTLS, and keep the
plaintext internal floor for the MQTT/lwIP allocations.
The fork's code pushes wio-e5-mini_repeater ~4.5 KB over its 224 KB
flash region. Build that target with -flto for the framework/libraries
and -fno-lto for project sources: it now uses 225,284 bytes (4,092
under the limit) and still emits the .su files the stack gate checks.
The override lives in the release script so the upstream variant stays
untouched.
A target that fails on a PlatformIO registry/toolchain download
(HTTPClientError etc.) now gets up to 3 attempts with jittered backoff;
compile and link errors still fail on the first attempt. The first
filter-v1.18.0-r1 local release run lost 19 of 173 targets to these
transient failures and needed a manual filtered rerun.
The status message omitted fields other MeshCore observers publish, so analyzer
UIs showed the model as "MeshCore Repeater" and left Relay, Uptime and Noise
Floor blank. Report the board name as `model`, this node's relay state as the
top-level `repeat` flag, and battery/uptime/noise floor under `stats`, sourced
live from the repeater through a registered callback.
arduino-esp32 2.x's arduino_esp_crt_bundle_attach() verifies nothing until a
bundle has been loaded (setCACertBundle), so every mqtts://, wss:// handshake
failed with -0x7680 (MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED) and no broker ever
connected on ESP-IDF 4. Point the ESP-MQTT config at ESP-IDF's
esp_crt_bundle_attach() on IDF < 5, which falls back to the certificate bundle
embedded in the binary.
`pio project config` prints one line per option, so an env that extends
another emits `extends = env:<base>` as well as its section header. Matching
`env:` anywhere on the line therefore returned that option line as an
environment.
Every observer target in observer_targets.ini extends a repeater env, so
`build.sh list` reported 190 repeater targets instead of 173 — 17 of them
named "extends = <base>_repeater". `build-repeater-firmwares` and
the local release builder then fed those phantoms to `pio run -e` (the
release builder built them one per bogus "platform", serially, and failed).
Only the column-0 section headers are environments: anchor the match.
The esp-tls/MQTT_CLIENT transport errors that a failing or flapping broker
connect produces were printed on the same serial console as the CLI, burying
replies (and confusing any automation reading them). Silence the MQTT client
and PsychicMqttClient log tags; connection state is already visible via the
mqtt* CLI and status feed.
MQTTObserver.cpp is its own translation unit and never saw FIRMWARE_VERSION
(defined in simple_repeater/MyMesh.h), so status/client_version and the JWT
client claim fell back to "unknown" on any build that does not inject the
macro. Pass the version from MyMesh::begin, which already has it.
ParsesAReasonableDate compared its own meshclock::buildEpoch() expansion
against MeshClockSync::buildFloor(). Both parse __TIME__, so when the test
TU and MeshClockSync.cpp compile in different seconds the two values
differ; at -O1 each call site folds per-TU while the -O0 native envs
resolved both through one out-of-line definition. Only the sanitizer suite
could expose it. Check the range via buildFloor(), buildEpoch()'s sole
production caller, and drop the near-vacuous cross-TU equality.
Add MQTT_OBSERVER.md to the guides, examples/mqtt_observer/ + observer_targets.ini
to the code map and fork-owned set, the native_mqtt_observer(-san) envs and the
observer flash target to the build notes, the observer release inclusion, the
observer capture hooks in MyMesh, and the observer-compat invariants.
Restructure MQTT_OBSERVER.md in the FILTER/FLEET user-guide mold: what it does,
firmware targets, quick start, setup (Wi-Fi/time, identity, addresses/TLS,
auth, capture switches, topics), a full command reference, payload schemas,
delivery behaviour, recipes, a status/troubleshooting table, the security
model, and limits. Add an MQTT observer section to README.md pointing at it.
Document the TX uplink and retained offline last will, the reference JWT claim
set (publicKey/aud/iat/exp/client + owner/email, hex signature) that matches
the downstream observers, duplicate publishes from the pre-dedup receive hook,
and the MQO1 config magic that isolates this fork's /mqtt_prefs from the others.
Ship the optional MQTT observer firmware in the same release as the plain
repeaters instead of a separate channel: local-release-build.sh now includes
observer envs in its default target list and drops the --observers flag (use
--filter _repeater_observer to build only observers). Updates the release-target
test and the observer manual.