Commit Graph

931 Commits

Author SHA1 Message Date
agessaman 1d52161332 Merge branch 'restore/upstream-duty-cycle' into restore/fem-rxgain 2026-07-09 17:54:45 -07:00
agessaman 1c9c6292e5 fix(mqtt): shed retransmissions, not capture, when duty cycle starves the pool
Load-testing the restored token bucket at 'set dutycycle 1' showed MQTT
capture dropping to exactly the TX rate. Queued retransmissions hold static-
pool packets with no expiry, so throttling parks the whole pool in the send
queue; Dispatcher::checkRecv() then discards received packets before logRx()
ever feeds the bridge — each completed TX frees exactly one packet for
exactly one more RX.

Observer builds now use RxReservePacketManager (fork-owned header): once the
free pool drops below a quarter of the pool, outbound packets are refused and
freed, so RX allocation and MQTT capture continue at full rate while the node
sheds repeat load it has no TX budget for anyway. Non-observer builds keep
upstream pool behavior via the same factory; StaticPoolPacketManager stays
byte-identical to upstream.
2026-07-09 17:54:38 -07:00
agessaman b2e79d4735 fix(radio): drop companion FEM wiring; wire t096 + tracker_v2 FEM overrides
companion_radio has its own NodePrefs without radio_fem_rxgain (matching
upstream, which doesn't wire companion either), so the startup call added in
e905451d broke every companion build:
  MyMesh.cpp:973: error: 'struct NodePrefs' has no member named 'radio_fem_rxgain'
It went unnoticed behind the pre-existing companion build failures.

Also port upstream's FEM LNA overrides for heltec_t096 and heltec_tracker_v2
verbatim (board overrides + isLNAEnabled/const getters), so all three boards
upstream wires now match instead of reporting unsupported. Both variant files
compile; those targets still fail overall on the pre-existing non-observer
MQTT-source build-config issue (unchanged with this work stashed).
2026-07-09 12:25:23 -07:00
agessaman e905451dce feat(radio): drive LoRa FEM RX gain from radio_fem_rxgain (heltec_v4)
Completes the FEM RX-gain restoration begun in the CAD/prefs change, which
persisted radio_fem_rxgain but didn't yet drive the hardware. Also dropped
by the 22eb9b87 revert; restored to match upstream.

- MainBoard: setLoRaFemLnaEnabled()/canControlLoRaFemLna()/isLoRaFemLnaEnabled()
  virtuals (default: can't control — non-FEM boards report unsupported)
- heltec_v4: board overrides driving loRaFEMControl; LoRaFEMControl gains the
  isLNAEnabled() getter (it already tracked lna_enabled and drove the FEM)
- CLI: `set radio.fem.rxgain on/off` / `get radio.fem.rxgain` (guarded by
  canControlLoRaFemLna, so it reports "unsupported" on non-FEM boards)
- app startup applies the persisted pref: board.setLoRaFemLnaEnabled(
  _prefs.radio_fem_rxgain), beside setRxBoostedGainMode

Default is ON (upstream), so on FEM boards the LNA is enabled after upgrade —
a real reception behavior change to confirm on hardware. The other FEM
variants (heltec_t096/tower_v2/tracker_v2) need the same small board-override
addition; until then `radio.fem.rxgain` reports unsupported there (no
regression — status quo).

Builds: heltec_v4 repeater-observer + room-observer (FEM board), Heltec_v3
repeater (non-FEM, base virtuals no-op). NEEDS on-device validation on a
Heltec V4.
2026-07-09 11:20:07 -07:00
agessaman df90673d18 feat(radio): restore CAD support + radio_fem_rxgain persistence (upstream parity)
Continues restoring features dropped by the 22eb9b87 revert. Both were
upstream-tested code, not intentional fork removals.

CAD (hardware Channel Activity Detection / listen-before-talk before TX),
fully restored and functional:
- NodePrefs.cad_enabled + `set cad on/off` / `get cad` CLI (default off)
- RadioLibWrapper: _cad_enabled + setCADEnabled() + the scanChannel()/CAD
  branch in isChannelActive() (Phase 1 already restored the Dispatcher hook)
- getCADEnabled() overrides in the repeater/room/sensor apps (return the
  pref) and companion (always on, matching upstream)

radio_fem_rxgain: the NodePrefs field + /com_prefs persistence are restored
here at upstream's exact offsets (293 fem, 294 cad), which makes /com_prefs
byte-identical to upstream through the tail. The field is persisted and
defaults on (upstream default), but the per-board LNA *driving* + the
`radio.fem.rxgain` CLI are deferred to the FEM-hardware change (they depend
on board methods and want per-board bench testing).

The new-format /com_prefs tail grows from 3 to 5 bytes; the old-format
detection threshold and the host migration harness are updated accordingly
(all scenarios pass, incl. the non-MQTT-build variant).

Builds: Heltec_v3 repeater, repeater-observer, room-observer. (sensor /
plain-room / companion fail only on the pre-existing Timezone.h include
issue, unrelated to these changes.)
2026-07-09 11:12:57 -07:00
agessaman 2eb41baeda refactor(mqtt): migrate observer settings to MQTTPrefs structure
Refactored the handling of observer-related settings by moving them from
NodePrefs to a new MQTTPrefs structure. This change centralizes MQTT,
WiFi, timezone, SNMP, and alert configurations, improving code organization
and maintainability. The new structure allows for better separation of
concerns and prepares the codebase for future enhancements.
2026-06-26 08:59:48 -07:00
agessaman 7416d632b9 feat(mqtt): add NTP server configuration and diagnostics commands
Implemented new commands for configuring and diagnosing NTP server
settings in the MQTT bridge. Users can now set a custom NTP server
and probe connectivity to configured servers. This enhancement
improves time synchronization reliability for JWT authentication
and provides better diagnostics for NTP connectivity issues.
2026-06-24 17:14:11 -07: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 c1885fcc15 feat(ota): implement deferred OTA update scheduling and handling
Added support for deferred OTA updates in the MyMesh class, allowing
the system to schedule firmware updates to occur after a confirmation
reply is sent. This change improves the user experience by ensuring
that the update process does not block the main application loop,
allowing for smoother operation during firmware updates.
2026-06-22 22:33:57 -07:00
agessaman 985fda1382 Add AlertReporter integration to MyMesh 2026-06-17 20:02:39 -07:00
agessaman dcc8f826db Merge upstream/dev into mqtt-bridge-implementation-flex
Pick up 97 commits from upstream/dev, resolving conflicts in
CommonCLI prefs layout, board definitions, docs, and T-Beam Supreme
platformio config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 09:29:16 -07:00
Scott Powell 8c0d5c5b24 * version 1.16.0 2026-06-06 21:09:38 +10:00
Scott Powell 8fc2da5c98 * default now 8, per the will of the peoples. 2026-06-06 21:00:58 +10:00
Scott Powell 5f6821bb66 * new CLI config: flood.max.advert (default 16) 2026-06-06 13:09:24 +10:00
Liam Cottle da21d42a2e Merge pull request #2672 from meshcore-dev/non-contact-requests
Non contact requests
2026-06-04 16:05:47 +12:00
Liam Cottle b83355e702 Merge pull request #2671 from sefinek/fix/typos-grammar-formatting
Fix typos and formatting in documentation and comments
2026-06-04 15:57:48 +12:00
ripplebiz 6be398d748 Merge pull request #2663 from oltaco/no-autoshutdown-when-powered
Disable auto-shutdown when externally powered, add auto-shutdown warning for OLED displays
2026-06-04 13:42:00 +10:00
ripplebiz 999e20a4c2 Merge pull request #1687 from IoTThinks/MCdev-PowerSaving-for-all-esp32-repeaters-202602
Added PowerSaving for all ESP32-based repeaters
2026-06-04 13:31:51 +10:00
Sefinek cc05ae555a docs: fix typos, grammar, and formatting in FAQ and code comments 2026-06-02 22:12:18 +02:00
taco e449af1723 bypass auto-shutdown delay for e-ink devices 2026-06-02 18:37:18 +10:00
Scott Powell 83ad3a6dc0 * direct/zero hop by default 2026-06-02 15:32:28 +10:00
Scott Powell f66c1d0258 * simplified the new flood.max.unscoped pref 2026-06-02 14:15:33 +10:00
ripplebiz 09349c5b28 Merge pull request #2661 from mrzarquon/mrz/flood_max_unscoped
Implement flood.max.unscoped to allow selective repeating of unscoped messages
2026-06-02 14:00:33 +10:00
Liam Cottle 94063f6833 Merge pull request #2636 from sefinek/fix/cmd-device-query-typo
fix: rename CMD_DEVICE_QEURY to CMD_DEVICE_QUERY
2026-06-02 12:41:57 +12:00
Chris Barker a33f3011a5 Feat: Adds flood.max.unscoped setting
Before this commit, there was no way to set a different max hop count
for unscoped messages.

Now with this change, by defaul it tracks the flood.max setting, until
a user provides a flood.max.unscoped value, which tax precidence for
packets if ROUTE_TYPE_FLOOD is true.
2026-06-01 21:30:17 +01:00
taco 3ce1cf404e NRF52: disable autoshutdown if powered, add auto-shutdown warning for oled 2026-06-02 00:55:25 +10:00
Scott Powell 760bb5951d * Bug fix: adding neighbor when path_mode != 0 2026-06-01 23:08:39 +10:00
Scott Powell bc5d648204 * contacts sync fix
* fix for reusing transient/anon contacts only
2026-06-01 19:04:42 +10:00
Scott Powell d9df8307ca * first draft 2026-06-01 16:49:31 +10:00
ripplebiz d8686b224d Merge pull request #2643 from disq/companion-display-keep-on-when-powered
companion_radio: Add optional `KEEP_DISPLAY_ON_USB` flag to keep display on while powered 🤖🤖
2026-06-01 13:18:34 +10:00
Scott Powell b259fbd01b * power saving: hasPendingWork() now also checks if there's a pending contacts write 2026-05-31 18:52:42 +10:00
ripplebiz 54c111609a Merge pull request #2286 from IoTThinks/MCdev-PowerSaving-for-nrf52-companion-202604
Added Power Saving for NRF52 companions to have extra 30% battery life
2026-05-31 18:49:46 +10:00
Kemal Hadimli bb781ff10a companion_radio: opt-in KEEP_DISPLAY_ON_USB to keep OLED on while powered
AUTO_OFF_MILLIS is a power-save feature aimed at battery use. When the
board reports isExternalPowered() == true (USB or other DC source),
blanking the screen serves no purpose — there's nothing to conserve.

But OLEDs are vulnerable to burn-in with static content, so this
behaviour is gated behind a new build flag KEEP_DISPLAY_ON_USB. Default
is unchanged from upstream — the display blanks after AUTO_OFF_MILLIS
on USB or battery. Variants that ship with an LCD instead of an OLED
(e.g. heltec_t096) can opt in by adding -D KEEP_DISPLAY_ON_USB to
their env, gaining always-on-while-powered without exposing OLED users
to burn-in risk.

When the flag is enabled, the implementation refreshes _auto_off every
loop iteration while externally powered, so the timer naturally counts
a fresh AUTO_OFF_MILLIS window from the moment power is removed —
no instantaneous-blank-on-unplug.

Applied to all three companion_radio UI flavours (ui-new, ui-tiny,
ui-orig). Boards without an isExternalPowered() override use the
base-class default in MeshCore.h (returns false), so battery-powered
behaviour is unchanged everywhere.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 11:25:48 +01:00
Sefinek bbe41eb375 fix: rename CMD_DEVICE_QEURY to CMD_DEVICE_QUERY 2026-05-28 14:39:12 +02:00
Kevin Le 36a44de119 Reduced time drift from 60s/day to 7s/day for ESP32-based repeaters with power saving. 2026-05-28 15:13:14 +07:00
Kevin Le a3d20d6209 Let ESP32-based repeaters to sleep immediately receiving and process a LoRa packet 2026-05-28 15:10:36 +07:00
AtlavoxDev e5dab6b999 Rename bootComplete() to onBootComplete() for naming consistency
Matches the existing event-style lifecycle hooks on MainBoard
(onBeforeTransmit, onAfterTransmit) per @liamcottle's review feedback.
2026-05-25 09:50:28 -04:00
AtlavoxDev 39a69b86c3 Add MainBoard::bootComplete() hook for boot-indicator LED feedback
Framework for upcoming variant-specific PRs that add LED feedback during boot. The hook gives users visual cues that the device is busy and
shouldn't be interacted with until startup completes.
2026-05-25 09:04:47 -04:00
Adam Gessaman d669d4dbd4 Add new MQTT presets for Mesh Core CA and update compile-time defaults
- Introduced two new MQTT presets: `meshcore-ca-1` and `meshcore-ca-2`.
- Updated documentation to reflect compile-time configuration options for MQTT defaults, including slot presets, IATA, and timezone settings.
- Removed legacy default MQTT settings from the code, now relying on the new configuration approach.
2026-05-24 12:50:55 -07:00
Adam Gessaman 5a99492c1a Merge upstream/dev into mqtt-bridge-implementation-flex
Pick up meshcore-dev changes since last upstream merge.
2026-05-23 13:12:39 -07:00
ripplebiz 26d0001301 Merge pull request #2608 from recrof/flood-advert-interval-47
Set flood advert interval to 47h for new installs
2026-05-23 15:37:31 +10:00
Rastislav Vysoky a37078f6c5 Companion repeat: update to more usable default EU frequency
869.495 is in 869.4 to 869.65 range which does have 10% duty cycle and 500mW ERP.
2026-05-22 17:04:19 +02:00
Kevin Le da7663a6fb Fixed hasPendingWork for BLE companions 2026-05-22 10:58:21 +07:00
Kevin Le 280213d41f Fixed to put hasPendingWork out of ENV_INCLUDE_GPS 2026-05-22 10:58:21 +07:00
Kevin Le 6b1099161c Added Power Saving for NRF52 companions 2026-05-22 10:58:17 +07:00
Rastislav Vysoky 01500e55d8 Change room server flood advert interval to 47 hours 2026-05-21 14:53:49 +02:00
Rastislav Vysoky 40180b8fe6 Update repeater flood advert interval to 47 hours 2026-05-21 14:50:58 +02:00
taco 26c641bc63 tiny ui rendering fixes 2026-05-21 19:58:10 +10:00
taco 9f683975c1 add torch 2026-05-21 19:58:10 +10:00