Commit Graph
1249 Commits
Author SHA1 Message Date
agessaman 622e123f53 fix(sensor): run the deferred OTA restart from the sensor loop 2026-11-11 08:38:24 -08:00
agessaman 159e115147 observer: run ota check off the loop task
Cache manifest checks in a short-lived task so slow HTTP requests do not stall mesh service. Serialize checks with pull updates and keep results independent of bridge lifetime.
2026-11-11 07:49:38 -08:00
agessaman 7bc8651971 Defer self-heal during pending OTA and config saves
Scheduled updates and an open upload portal must hold off self-heal before flash writes begin. Treat config batches as busy for at most two minutes so saves can finish without an abandoned batch blocking recovery forever.
2026-11-10 23:01:50 -08:00
agessaman 6d6889e326 Merge branch 'feat/observer-stability-selfheal' into test/observer-stability-integration
# Conflicts:
#	src/helpers/MQTTMessageBuilder.cpp
#	src/helpers/MQTTMessageBuilder.h
#	src/helpers/MQTTPayloadBuilder.cpp
#	src/helpers/MQTTPayloadBuilder.h
#	src/helpers/bridges/MQTTBridge.cpp
2026-11-10 19:01:16 -08:00
agessaman 51e001606e observer: confirm self-heal reboots and respect OTA and bridge restarts
The driver treats an OTA upload or the manifest update sequence as
in progress, is told about every bridge start, stop, restart and slot
restart, and reboots only when a second fresh sample still shows the cause.
2026-11-10 18:42:08 -08:00
agessaman baefed3a3f observer: drive the MQTT self-heal policy from the bridge control poll
ObserverBridgeControl::poll now ticks the self-heal policy about every 10 s
on the main loop, whether or not the bridge exists or runs. An alert is
logged and sent on the mesh alert channel when alerts are on; a reboot first
records the cause and count in RTC no-init memory, then reboots through the
board. A healthy period clears the record. Adds the mqtt_selfheal_enabled
runtime pref, default on.
2026-11-10 18:12:52 -08:00
agessaman eeb8cf7b2b Merge branch 'feat/observer-stability-coredump' into test/observer-stability-integration 2026-11-10 16:42:35 -08:00
agessaman a54ac3996f observer: report the last panic from the flash core dump
At boot the repeater and room server read the core dump summary once
into a 72-byte static record (the summary itself is heap-borrowed and
freed). `get crash` prints it, and every status message this boot
carries it as a `crash` field, formatted into the unused tail of the
publish scratch buffer so the bridge task stack is untouched. The flash
dump is erased by the bridge task after a status carrying it has been
published, or immediately by `clear crash`, so it survives boots where
MQTT never connects. Xtensa observer builds only.
2026-11-10 16:42:34 -08:00
agessaman b9caad298e observer: move bridge lifecycle sequencing out of MyMesh
Both roles forward setBridgeState, restartBridge, restartBridgeSlot, the
config batch callbacks, the loop poll and the deferred OTA to
ObserverBridgeControl. OTA now resumes only a bridge that was meant to be
running, and SNMP is attached on every start in both roles.
2026-11-10 16:42:34 -08:00
agessaman c6a43bb49f observer: settle after a clean MQTT stop inside MQTTBridge::end() 2026-11-10 14:53:20 -08:00
agessaman f19e2b79e4 fix: realign files left behind by an old upstream-merge revert
Revert 22eb9b87a kept rolling back upstream changes to files the fork never
modified. Take upstream's version for those 24 files: nRF52 board RAM limits,
SenseCAP Solar LED/GPS pins, T1000-E signed NTC table, secure_chat airtime
default, devcontainer.
2026-11-10 10:12:24 -08:00
agessaman b6b624ad5f Merge upstream/dev into observer-firmware-dev (2026-11-10, f678f6ac) 2026-11-10 10:04:31 -08:00
fdlamotte f678f6ac15 Merge pull request #3784 from Maxwell456/feature/repeater-history
Add min/max/avg history queries to repeaters
2026-11-10 12:42:53 -04:00
fdlamotte b8ae75d258 Merge pull request #3770 from lihardyextreme/feature-mdns
feat: mDNS ESP32 - enable local network discovery over mDNS
2026-11-10 12:07:18 -04:00
fdlamotte 2367886a4c Merge pull request #3724 from akalinin-softvelum/feature/eink-busy-hook-v2
companion: keep mesh/BLE running during e-ink refresh
2026-11-10 08:40:43 -04:00
fdlamotte d6d51333c2 Merge pull request #3762 from wmacgreg/feature/nucleo-wl55jc
Add variant for ST Nucleo-WL55JC1 (STM32WL55JC) 🤖🤖
2026-11-10 08:14:51 -04:00
fdlamotte e6d141d6f7 Merge pull request #3785 from AlexandrTyshchenko/feature/companion-adc-multiplier
Companion: set/get adc.multiplier CLI command
2026-11-10 08:11:33 -04:00
fdlamotte 62ae611afd Merge pull request #3753 from fdlamotte/gps_refactor
Big GPS refactor
2026-11-10 07:44:00 -04:00
Olexandr Tyshchenko 8c7e1a8f5d GPS guard: gps guard on/off, saved in the GPS prefs 2026-11-09 23:50:48 +02:00
Olexandr Tyshchenko d72f67d37b GPS guard: save gps fence in the GPS prefs 2026-11-09 23:16:29 +02:00
Olexandr Tyshchenko da1828fd9d Companion: set/get adc.multiplier CLI command, persisted in prefs
Repeaters, room servers and sensors already let the battery ADC multiplier be tuned with 'set adc.multiplier' (CommonCLI). The companion firmware had no equivalent, so a board whose divider differs from the build default (common on DIY ProMicro / Faketec boards) always reported a wrong battery voltage.

Adds the same command to the companion CLI. The value is stored in the companion prefs (comp.adc_mult, 0 = board default) and applied at startup via MainBoard::setAdcMultiplier().
2026-11-08 18:07:58 +02:00
Maxwell 25c1867bbd Add min/max/avg history queries to repeaters
Move TimeSeriesData from simple_sensor into src/helpers and drive it with
monotonic uptime, so RTC changes cannot stall recording or break queries.
Keep the old RTCClock* overloads as deprecated for custom sensor sketches.

Record 24h of battery, noise floor, TX/RX airtime % and MCU temperature on
repeaters and answer the existing 0x04 min/max/avg request using the same
format as sensor nodes. No packets are sent by this feature.
REPEATER_HISTORY_SLOTS=0 removes it; default off on STM32/RP2040.

Add native tests for TimeSeriesData and document the request and channels.
2026-11-08 16:34:54 +02:00
Florent 6eea5e7185 ui_task: let user choose if enter in gps screen toggles or triggers gps 2026-11-08 08:47:35 -04:00
Florent 3fd36e7ac6 gps: adapt ui-new and the sensor managers 2026-11-08 08:47:34 -04:00
Florent fe6a47d0c9 gps: move the gps CLI to GpsPrefs and convert all targets 2026-11-08 08:47:34 -04:00
Florent df5a768c5d gps: add GpsDriver, handle the hardware and software switches in the drivers 2026-11-08 08:47:34 -04:00
anders-dc 9fd02ff3bc fix(companion): guard null _serial in contact overwrite and full callbacks 2026-11-08 11:01:05 +01:00
agessaman 322cd638fb Merge remote-tracking branch 'upstream/dev' into feat/kiss-agc-fem-control 2026-11-06 20:38:01 -08:00
Li Hardy Extreme 9a2230b60e feat: mDNS ESP32 - enable local network discovery over mDNS 2026-11-06 00:10:59 +01:00
agessaman fd3306c7f1 feat(mqtt): per-slot neighbors override (mqttN.neighbors auto|on|off)
Each slot gains a neighbors setting. auto (default) follows the node:
mqtt.neighbors on sends to the slot, and auto sends only if the slot's
preset asks for neighbor data. on and off override that for the slot,
so a custom broker can receive neighbors without every other slot, and
a listed preset can be opted out. mqtt.neighbors off still stops
periodic snapshots on every slot; a slot set off is also skipped by a
manual discover.scopes.

The periodic cycle runs only while some slot would receive it. The mesh
now hands the bridge a slot bitmask with each snapshot instead of a
mode, so the MQTT task never reads prefs. Stored as slotN.neighbors in
/mqtt.json (missing = auto; older firmware ignores the key). Web config
gains a per-slot select; the bridge logs each slot a snapshot reaches.
2026-11-04 20:18:46 -08:00
agessaman 30d56837c0 fix(mqtt): keep explicit neighbors off across rollback; review fixes
- Store the mode as neighbors.mode in /mqtt.json and keep
  neighbors.enabled as the 0/1 older firmware validates (1 only for on).
  Older firmware no longer repairs and rewrites the file, so an off set
  here survives a rollback and re-upgrade. A file without mode maps
  enabled 0 to auto and 1 to on without counting as a repair, so the
  upgrade does not rewrite every node's file.
- Out-of-range values repair to off instead of auto.
- Abandon a periodic scope pass when collection turns off mid-run, so it
  stops querying neighbors for a snapshot no slot would receive.
- Pass the mode a snapshot ran under to the bridge instead of having the
  MQTT task read the live pref across cores.
- Webconfig mock server handles auto/on/off; test README lists the new
  suite; replace a serializer assertion that could not fail with
  round-trip, legacy-file, repair, and normalize tests.
2026-11-04 18:24:52 -08:00
agessaman c5d087b003 feat(mqtt): per-preset automatic neighbors publishing
mqtt.neighbors gains an auto mode, now the default. In auto the periodic
neighbor cycle runs only while a slot uses a preset whose broker asks for
neighbor data, and the periodic snapshot goes only to those slots. comchan
is the first preset to opt in (MQTTPresetPolicy.h, keyed by name so
MQTTPresets.h stays identical across channels).

Stored values: 0 = auto (was off), 1 = on, 2 = off. Nodes that never
touched the setting upgrade to auto; older firmware repairs 2 to 0, so a
rollback keeps neighbors off. on keeps its old behavior (every slot), and
a manual discover.scopes still publishes to every connected slot in any
mode.

The web config toggle becomes an auto/on/off select, and the config JSON
reports the mode name.
2026-11-04 17:45:37 -08:00
Will MacGregorandClaude Opus 5 bb3e77dc36 Enable simple_room_server on the STM32 platform
The room server gated its filesystem paths on NRF52_PLATFORM only, so an
STM32 build fell through to the ESP32 branch and failed to compile:

  MyMesh.cpp:147: no matching function for call to
    'Adafruit_LittleFS::open(const char*&, const char [2], bool)'
  main.cpp:69:   'store' was not declared in this scope

STM32 uses the same InternalFS / Adafruit_LittleFS API as nRF52, including
append semantics (FILE_O_WRITE opens LFS_O_RDWR|LFS_O_CREAT and then seeks
to the end), so the nRF52 branch is already correct for it. Add
STM32_PLATFORM alongside NRF52_PLATFORM in the four remaining gates;
saveIdentity() already did this.

This unblocks the room_server example on the existing STM32WL boards
(wio-e5-mini, wio-e5-dev, rak3x72, tiny_relay) as well as new ones.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-04 09:46:27 -05:00
Liam Cottle 77d81d1f82 Merge pull request #3603 from A13xB0/companion-buzzer-cli
Add CLI command to toggle the buzzer for companions
2026-10-30 12:53:18 +13:00
akalinin-softvelum 1df6262d58 companion: enable e-ink refresh loop only with EINK_REFRESH_LOOP
Only builds that define EINK_REFRESH_LOOP install the busy hook; for now
the T-Echo companion BLE/USB envs.
2026-10-29 13:21:11 +00:00
akalinin-softvelum 05423e516a companion: keep mesh/BLE running during e-ink panel refresh
Use GxEPD2's busy callback to run the mesh, interface and sensor loops
(loopCore(), shared with loop()) while the panel refreshes, instead of
blocking the main loop. Covers the partial refresh in endFrame(), the
full wipe in startFrame(), and the sleep icon / blank refresh on turnOff().
2026-10-29 12:38:30 +00:00
fdlamotte 04d72b1049 Merge pull request #3687 from fdlamotte/display_prefs
ui: add some parameters to the cli (mostly regarding eink behaviour)
2026-10-29 08:35:36 -04:00
Florent 5d7100ae7d ui: add some parameters to the cli (mostly regarding eink behaviour) 2026-10-29 08:34:41 -04:00
ripplebiz 42ded8da64 Merge pull request #3688 from Blake-Latchford/fix/stats-dup-count-wrap
Saturate duplicate packet stats instead of wrapping
2026-10-28 17:06:21 +11:00
Liam Cottle fd56b1a36c Merge pull request #3615 from radek-sixi/fix/common-radio-prefs-signed-tx-power
Fix unsigned conversion of negative TX power in CommonRadioPrefs
2026-10-27 22:44:04 +13:00
Blake LatchfordandClaude Opus 5.5 26e438904e Saturate duplicate packet stats instead of wrapping
Tested on a Heltec V4 repeater with the counter seeded at 65530.

Fixes #3255

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 21:45:10 -04:00
ripplebiz 46216b2d0d Merge pull request #3617 from aXistem-dev/feat/tz-offset-quarter-hours
Show quarter-hour timezone offsets with two decimals
2026-10-26 12:27:10 +11:00
ripplebiz 55abbe72b2 Merge pull request #3667 from Blake-Latchford/fix/kiss-modem-usbcdc-tx-buffer
Fix broken KISS modem build on 6 ESP32-S3 platforms
2026-10-26 12:02:57 +11:00
fdlamotte ea8e95447f Merge pull request #3659 from fdlamotte/elecrow_eink_refactor
Elecrow eink refactor
2026-10-24 19:50:03 -04:00
Florent da98f5318d UiTask: better cleaning of eink screens when hibernating 2026-10-24 10:16:56 -04:00
agessaman 45cf7eb74f feat(wifi): runtime WiFi TX power control (wifi.txpower)
Adds `set/get wifi.txpower default|2..20` so the WiFi TX power cap can be
changed per node without a rebuild.

- Stored as whole dBm in MQTTPrefs (/mqtt.json wifi.tx_power). 0 means the
  build's MQTT_WIFI_TX_POWER, so saving prefs never pins today's default and
  a later build can still move a board's default. Files without the key load
  as board default; out-of-range values are repaired to it.
- WifiTxPowerPolicy holds parsing, the build-default clamp to the SDK's
  [8, 84] quarter-dBm range, and formatting. No quantization table: replies
  report esp_wifi_get_max_tx_power() readback, since rounding is per chip.
- Applied via esp_wifi_set_max_tx_power() right after WiFi.mode(WIFI_STA)
  (so association is capped), after every association, immediately from the
  CLI, and when the setup AP starts and tears down back to STA.
- WebConfig: TX power selector with the radio's reported value; config JSON
  gains wifi.txpower and wifi.txpower_applied; key allowlisted; mock server
  and CLI audit updated.
- Host tests for the policy and for serializer round-trip/repair.
2026-10-22 16:06:12 -07:00
Blake Latchford 47259633f2 Fix broken KISS modem build on 6 ESP32-S3 platforms
Broken out from PR #3496 which has been open for a month.
2026-10-22 17:57:33 -04:00
Marcel Verdult 56b5f4e9c6 fix(chat): refuse a negative text length for a group message
CMD_SEND_CHANNEL_TXT_MSG reads txt_type, channel_idx and a 4 byte timestamp, so
the frame needs 7 bytes before the text starts, and the branch had no length
guard. For a shorter frame "len - i" is computed in size_t, wraps, and reaches
sendGroupMessage() as a negative int. The clamp there tests
"text_len + prefix_len > MAX_TEXT_LEN", which a negative value passes, and the
following memcpy() converts the length back to a size_t: a 3 byte frame asks for
4294967292 bytes into a 197 byte stack buffer.

Two guards, because there are two mistakes. The branch now states its minimum
like most other branches of handleCmdFrame do, so a frame below 7 bytes is
answered through the existing path instead of being parsed. And
sendGroupMessage() refuses a negative length the way sendGroupData() in the same
file already does, which protects every other caller.

A frame of exactly 7 bytes keeps working and sends an empty message, as before.

Evidence. On a T-Echo running dev 428a95c6, built with
FIRMWARE_BUILD_DATE "f1-dev" and confirmed by "ver => v1.18.0 (Build: f1-dev)":

  CH_TXT len=7    -> RESP_CODE_OK
  GET_STATS core  -> uptime=78s
  CH_TXT len=3    -> NO REPLY
  DEVICE_QUERY    -> NO REPLY  (three times over 8 s, node never came back)
2026-10-22 09:33:07 +00:00
Florent 408d674ace DisplayDriver: fixing alignment issue in vtable for nrf52 and epd display 2026-10-21 17:13:27 -04:00
Florent a31e2c92df refactoring eink devices behaviour 2026-10-21 14:08:56 -04:00