Граф коммитов
896 Коммитов
Автор SHA1 Сообщение Дата
Valentin V. Bartenev 1817248d97 Add LoRa FEM RX-path LNA control via CLI; restore enabled default
Ported from meshcore-dev/MeshCore#2140 (Quency-D <hj_zzns@163.com>).

The upstream v1.16.0 merge changed the Heltec FEM LNA to disabled by
default (upstream commit 696aae6e).  This patch restores the enabled
default for repeater via the new "radio.fem.rxgain" preference
(defaulted to 1), while also making the setting user-configurable
and persisted across reboots.
2026-06-07 15:36:19 +03:00
Valentin V. Bartenev 6aef34567e Merge official v1.16.0 firmware and resolve conflicts 2026-06-06 21:55:43 +03: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иGitHub da21d42a2e Merge pull request #2672 from meshcore-dev/non-contact-requests
Non contact requests
2026-06-04 16:05:47 +12:00
Liam CottleиGitHub 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иGitHub 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иGitHub 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иGitHub 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иGitHub 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иGitHub 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иGitHub 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
Valentin V. Bartenev 9c8f884f11 ESP32: add reset reason to boot event, CLI, and web panel
Implement getResetReason() and getResetReasonString() for ESP32Board,
covering all esp_reset_reason_t values: power-on, external reset,
software reset, panic/exception, interrupt watchdog, task watchdog,
generic watchdog, deep sleep wake, brownout, and SDIO reset.

Extend the pwrmgt.bootreason CLI command to support ESP32 alongside
NRF52. On ESP32 only the reset reason is reported (no shutdown reason).

Pass the reset reason as the value field when recording the
HISTORY_EVENT_BOOT stats event so the reason is stored in the in-memory
ring buffer and persisted to the archive events log.

Add bootReasonLabel() to the web panel and update renderEventsSection()
to annotate boot events with the human-readable reset reason string,
e.g. "boot (panic/exception)", when a non-null value is present.
2026-05-31 02:41:57 +03:00
Kemal HadimliиClaude Opus 4.7 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
ripplebizиGitHub 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иGitHub 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иGitHub 01500e55d8 Change room server flood advert interval to 47 hours 2026-05-21 14:53:49 +02:00
Rastislav VysokyиGitHub 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
taco 8540c98947 add tinyui for lilygo t-echo card 2026-05-21 19:58:10 +10:00
Valentin V. Bartenev e11d14e6cc Fix: expand HistorySample::recv_errors from uint16_t to uint32_t
The error_rate graph showed all zeros after ~65535 receive errors had
accumulated.  Root cause was a two-part bug:

1. In MyMesh::updateStatsHistory(), recv_errors was clamped to 0xFFFF
   via min<uint32_t>(..., 0xFFFF).  Once the counter reached 65535,
   every subsequent sample stored the same constant value, making the
   per-interval delta always zero and therefore error_rate always zero.

2. HistorySample::recv_errors was declared as uint16_t while the
   underlying counter (n_recv_errors) is uint32_t.  parseSummaryLine()
   also truncated the restored value back to uint16_t.

Fix:
- Remove the clamp in MyMesh::updateStatsHistory(); assign
  getPacketsRecvErrors() (uint32_t) directly.
- Change HistorySample::recv_errors from uint16_t to uint32_t,
  moving it next to the other uint32_t fields.
- Update both parseSummaryLine() code paths to cast recv_errors to
  uint32_t instead of uint16_t.

The archive format is unchanged: recv_errors is written as %u and
read back into an unsigned local, which is correct for a 32-bit
value on ESP32.
2026-05-20 19:53:12 +03:00
Liam CottleиGitHub 6325a85336 Merge pull request #2493 from Rococo88/complex-wifi-reconnect
Refactor WiFi auto-reconnect to use non-blocking polling
2026-05-15 21:21:16 +12:00
Scott Powell c588540b1b * new CMD_SEND_RAW_PACKET 2026-05-13 13:28:56 +10:00
Valentin V. Bartenev a9273f02bb Redesign approach for CPU usage tracking
The previous implementation maintained three exponential moving averages
(1/5/15-minute) of CPU busy-fraction, sampled every 5 seconds. This had
two problems:

1. Wrong semantics: the metric was labelled "load_avg" (a Unix concept
   measuring run-queue depth), but the tracker actually measures CPU
   busy-time as a fraction of FreeRTOS ticks — i.e. utilization, not
   load.  The name was misleading.

2. Poor responsiveness: the 1-minute EMA (DECAY = exp(-5/60) ≈ 0.920)
   has a ~60-second time constant.  On a live web panel, this made the
   metric appear frozen, especially during short bursts of activity
   (e.g. an HTTP request from the panel itself).

This commit replaces the EMA with a 64-sample simple moving average
(SMA) over a compact uint8_t circular buffer. The sample interval is
60 s / 64 = 937,500 µs, so the window covers exactly 60 seconds:

Algorithm:
- Every 937,500 µs (= 60 s / 64), the FreeRTOS tick delta (busy vs
  idle ticks on core 0) is computed and stored as a uint8_t
  (0–255 = 0–100% utilization).
- The circular buffer holds 64 samples, spanning exactly 60 seconds
  (64 × 937,500 µs = 60,000,000 µs). The timer interval is derived
  directly from the window size: 60 000 000 / SMA_WINDOW µs.
- The index wraps with a bitwise AND (& 63) instead of modulo, since
  64 is a power of 2.
- The running sum is a uint16_t (max 64 × 255 = 16 320, fits easily).
- The result _sma_avg is a volatile float written atomically by the
  esp_timer task (core 0) and read from the main loop (core 1).
  No spinlock is needed: on Xtensa LX7, a 32-bit aligned float store
  is a single instruction.

The 60-second window smooths out short bursts (e.g. WiFi/HTTP spikes)
while reacting to sustained load changes within ~10–15 seconds.

Naming:
- The public API is now getCore0Util() returning a float in [0.0, 1.0].
  The name explicitly identifies which core is measured (core 0, which
  runs WiFi, MQTT, HTTP, and LwIP — see task_pinning.c).
- JSON keys: "load_avg" (array) → "core0_util" (scalar float, percent)
- HistorySample field: load_avg1_pct → core0_util_pct
- StatsHistory series key: "cpu_load" → "core0_util"
- Web panel label: "Load Avg" → "Core0 Util"

The history snapshot (once per minute) reads the same _sma_avg value,
which at that point represents the rolling average of the last 60
seconds — exactly one history interval.
2026-05-10 06:26:08 +03:00
Valentin V. Bartenev eaf3c4c263 Stats: add CPU load trend series to history and web panel
Wire the 1-minute CPU load average into the stats history pipeline:

- Rename HistorySample::reserved to load_avg1_pct (uint8_t, 0-100);
  struct size unchanged.
- Populate load_avg1_pct in updateStatsHistory on ESP32 from
  _cpu_tracker.getLoadAvg1() * 100.
- Register "cpu_load" series in buildPointValue / seriesTitle /
  seriesUnit so buildSeriesJson serves it via
  /api/stats?series=cpu_load.
- Persist load_avg1_pct as a 29th CSV column in flushSummaryLog.
  parseSummaryLine accepts both 28-column (old, load_avg1_pct=0)
  and 29-column (new) formats for backward compatibility.
- Add "cpu_load" to the web panel trend card order with orange
  sparkline color (#e07b39), "N %" hover formatting, and a Y-axis
  floored at 0 with a 10% minimum ceiling.
2026-05-09 22:31:02 +03:00
Valentin V. Bartenev a6f01d544e ESP32: add CPUUsageTracker – core-0 load averages (1/5/15 min)
Track CPU utilisation on core 0 using a FreeRTOS tick hook that
increments per-tick idle/busy counters, sampled every 5s by an
esp_timer callback.  Exponential moving averages with Linux-style
time constants (1 / 5 / 15 min) are maintained in software:

  DECAY1  = exp(-5/60)  ≈ 0.9200  (1-minute window)
  DECAY5  = exp(-5/300) ≈ 0.9835  (5-minute window)
  DECAY15 = exp(-5/900) ≈ 0.9945  (15-minute window)

Core 1 is excluded intentionally: it runs the Arduino loopTask at
100% load for LoRa packet processing, so its figure is always 1.0
and carries no diagnostic value.  All other tasks are pinned to
core 0 by task_pinning.c, so core-0 load reflects the true system
utilisation.

New files:
  arch/esp32/CPUUsageTracker.h   – class declaration
  arch/esp32/CPUUsageTracker.cpp – tick hook + esp_timer sampling

Integration:
  MyMesh::begin() calls _cpu_tracker.begin() on ESP32 builds.
  formatStatsReply() emits "load_avg":[<1m>,<5m>,<15m>] in the
  compact stats JSON payload.
  formatWebStatsSummaryJson() adds the same field to the web-panel
  stats endpoint under core.load_avg.
  The web-panel HUD gains a "Load Avg" metric tile showing all
  three values side-by-side; the core-metrics grid is widened from
  4 to 5 columns.  The tile is rendered conditionally so older
  firmware (or non-ESP32 builds) that omit the field degrade
  gracefully.
  CPUUsageTracker.cpp is added to the esp32_base build_src_filter
  in platformio.ini.
2026-05-09 17:26:27 +03:00
Liam CottleиGitHub 56d4671c2c Merge pull request #2490 from tuzzmaniandevil/dev
Enhance KissModem frame processing and timeout handling
2026-05-08 23:23:14 +12:00
liamcottle 841db56595 add build flag to configure allowed repeat freq range 2026-05-08 20:16:45 +12:00
tuzzmaniandevil ffa76016ff Address two comments from PR 2026-05-08 11:14:22 +12:00
Rococo88 a0cc3bab4b Refactor WiFi auto-reconnect to use non-blocking polling 2026-05-07 12:24:06 +02:00