Wykres commitów
158 Commity
Autor SHA1 Wiadomość Data
Valentin V. Bartenev 89a59d5a2e Web: enable TLS session tickets for faster session resumption
Rename arch/esp32/tls_cipher_restrict.c → arch/esp32/tls_server_config.c.
The file now handles two aspects of TLS server configuration via the
existing __wrap_mbedtls_ssl_config_defaults() intercept, so the old name
no longer described its full scope.

Add TLS session ticket support (RFC 5077).  Browsers can now resume
HTTPS sessions without a full RSA handshake, reducing connection latency
on repeated connections.

A static mbedtls_ssl_ticket_context is initialized once on first server
start using the ESP32 hardware RNG (esp_fill_random), then registered via
mbedtls_ssl_conf_session_tickets_cb().  The context must be static because
mbedTLS stores the pointer for the lifetime of the server, analogous to
kServerOnlyCipherSuites.  If mbedtls_ssl_ticket_setup() fails, the flag
remains unset and session tickets are silently skipped rather than
registering callbacks against an uninitialized context.

CONFIG_MBEDTLS_SSL_SESSION_TICKETS is enabled by default in the pre-built
arduino-esp32 framework, so no build system changes are required beyond
the filename update in platformio.ini.
2026-05-13 04:48:15 +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
Valentin V. Bartenev 2f69718cfe ESP32: fix HTTPS task watchdog by restricting TLS to RSA cipher suites
Browsers negotiate ECDHE cipher suites by default.  On ESP32-S3 the
hardware RSA accelerator handles RSA key exchange efficiently, but
there is no ECP hardware accelerator.  ECDHE requires the server to
compute an ephemeral key pair: ecp_precompute_comb() builds a comb
table through many sequential ECP point doublings, each dispatched
to the hardware bignum unit (esp_bignum.c), but the ECP layer has
no RTOS yield points between iterations.  The entire computation runs
to completion on CPU 0 without ever resetting the task watchdog.

A single handshake does not exceed the watchdog timeout on its own,
but two consecutive handshakes (e.g. a browser retry after a failed
attempt) accumulate enough uninterrupted runtime to starve IDLE0:

  E (54924) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x0050
  E (57208) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7280
  E (57638) task_wdt: Task watchdog got triggered.
  E (57638) task_wdt:  - IDLE0 (CPU 0)
  E (57638) task_wdt: Tasks currently running:
  E (57638) task_wdt: CPU 0: httpd

The crash occurs in ecp_precompute_comb() → ecp_double_jac() →
mbedtls_mpi_mul_mpi() during the ServerKeyExchange step.

Fix by wrapping mbedtls_ssl_config_defaults() via the linker --wrap
mechanism.  The wrapper intercepts server-side SSL config init
(MBEDTLS_SSL_IS_SERVER) and replaces the cipher suite list with
RSA key exchange only, routing handshakes through the hardware RSA
accelerator and eliminating the ECDH path entirely.  MQTT connections
(MBEDTLS_SSL_IS_CLIENT) are unaffected.

Also switch the self-signed cert generator from EC (prime256v1) to
RSA 2048 so the generated certificate matches the restricted cipher
suites.

Changes:
- arch/esp32/tls_cipher_restrict.c: new file implementing the
  mbedtls_ssl_config_defaults wrap; restricts server cipher suites
  to RSA_WITH_AES_{128,256}_{GCM,CBC}_SHA{256,384}
- platformio.ini: add -Wl,--wrap=mbedtls_ssl_config_defaults and
  include tls_cipher_restrict.c in the esp32_base build
- arch/esp32/extra_scripts/generate_web_panel_cert.py: switch key
  generation from `openssl ecparam -name prime256v1` to `openssl
  genrsa 2048`
2026-05-06 21:50:13 +03:00
Valentin V. Bartenev eb2c6d0bb8 ESP32: pin all tskNO_AFFINITY tasks to core 0 via linker wrap
On dual-core ESP32-S3 (ARDUINO_RUNNING_CORE=1), the Arduino loop and
LoRa processing run exclusively on core 1.  ESP-IDF v4 creates mqtt_task
with tskNO_AFFINITY, meaning FreeRTOS may schedule them on core 1 under
load, preempting the LoRa loop.

ESP-IDF v4 provides no public API to change a task's core affinity after
creation (vTaskCoreAffinitySet is IDF v5+ only), and the esp_mqtt_client
config struct has no task_core_id field.  The precompiled Arduino-ESP32
framework cannot be patched via sdkconfig.

Instead, use the GCC/LD --wrap linker mechanism to intercept every call
to xTaskCreatePinnedToCore.  Any task created with tskNO_AFFINITY is
redirected to core 0.  Tasks that are already explicitly pinned (Wi-Fi
driver, LwIP, httpd, esp_timer, ipc0/ipc1) are passed through unchanged.

We intentionally do not filter by task name.  Pinning all unpinned tasks
makes the approach robust against internal ESP-IDF task name changes and
catches any future tasks that may be added with tskNO_AFFINITY.

Verified task layout after the change:
  loopTask  pri=1  core=1   (Arduino loop / LoRa — unchanged)
  mqtt_task pri=5  core=0   (was tskNO_AFFINITY, now pinned)
  httpd     pri=2  core=0   (core_id set explicitly in WebPanelServer)
  tiT       pri=18 core=0   (LwIP, already pinned by ESP-IDF)
  wifi      pri=23 core=0   (Wi-Fi driver, already pinned)
  esp_timer pri=22 core=0   (already pinned)
  ipc0/ipc1 pri=24 core=0/1 (IPC, already pinned per-core)

The -Wl,--wrap flag and arch/esp32/task_pinning.c are added only to
[esp32_base] (IDF v4).  The ESP32-C6 pioarduino target (IDF v5) is
unaffected and can use vTaskCoreAffinitySet() if needed in the future.
2026-05-05 21:58:58 +03:00
Jared Dohrman 2646d7177e Merge upstream/dev into develop 2026-04-19 12:21:01 +10:00
Jared Dohrman 3919a6e36f fix: clean up web panel build filters and tune /stats signal meters 2026-04-15 17:59:23 +10:00
Petr Kracik 3a9e1086af SDK3.x: Fix OTA includes, bump Async version 2026-04-14 15:28:11 +02:00
Jared Dohrman b5374a705a feat(web,mqtt): add repeater dashboard, MQTT settings, and stabilise HTTPS/TLS startup 2026-04-10 15:18:19 +10:00
Jared Dohrman ca63ea923a fix: generate web panel certs per build and clean up mqtt env flags 2026-04-09 15:19:46 +10:00
Andy ShinniGitHub fb726e48c2 Allows us to have custom PlatformIO envs and configs (#2234) 2026-04-04 17:34:29 +13:00
Wessel Nieboer 7829c51898 Bump to RadioLib 7.6.0 2026-03-23 14:26:56 +01:00
Rastislav VysokyiGitHub b777a7c635 Update default preset to EU/UK (Narrow) 2026-02-24 11:28:23 +01:00
taco 77675ab496 add -D ESP32_PLATFORM to esp32_base 2026-02-13 12:01:04 +11:00
Rastislav Vysoky 84e68cf4cb initial port of M5Stack Unit C6L, update pioarduino to newer bugfix release 2026-02-02 22:58:55 +01:00
liamcottle d13bc446de added build flag to enable/disable boot advert 2026-01-26 22:39:39 +13:00
1a3f7a7ea9 Fix BLE semaphore leak in Bluefruit library
Patches Bluefruit library to fix semaphore leak bug that causes device lockup
when BLE central disconnects unexpectedly (e.g., going out of range, supervision timeout).

Co-authored-by: Liam Cottle <liamcottle@users.noreply.github.com>
Co-authored-by: oltaco <oltaco@users.noreply.github.com>
2025-12-04 11:47:41 +01:00
ripplebiziGitHub 920ac51c8c Merge pull request #998 from tahnok/bmp085-sensor
Add support for bmp085/bmp180 temperature/pressure sensor
2025-11-03 10:58:22 +11:00
recrof 377f9ff67d renamed esp32c6 variants, so they are not included in release. added disclaimer about pioarduino builds 2025-10-29 13:22:11 +01:00
Liam CottleiGitHub 6288a5d11a Merge pull request #1002 from wel97459/dev-CayenneLPP
Updated CayenneLPP to 1.6.1
2025-10-23 20:24:49 +13:00
Winston Lowe 2e249e24dc Updated CayenneLPP to 1.6.1 2025-10-22 23:55:51 -07:00
Wesley Ellis ac15131296 Add support for bmp085/bmp180 temperature/pressure sensor 2025-10-22 16:17:06 -04:00
recrof a421215e84 all nrf52 devices: force framework-arduinoadafruitnrf52 version to 1.10700.0 2025-10-18 23:42:28 +02:00
ripplebiziGitHub 666447eafc Merge pull request #955 from liquidraver/dev
Add simple BME680 support to RAK (RAK1906)
2025-10-18 15:06:05 +11:00
fdlamotteiGitHub ece40716da Merge pull request #956 from recrof/uf2_pio_task
added custom pio task "Create UF2 file"
2025-10-17 17:24:32 +02:00
recrof 24ed5b377f added custom pio task "Create UF2 file" 2025-10-17 16:25:58 +02:00
liquidraver 0e7486552d Add simple BME680 support to RAK with adafruit library 2025-10-16 10:17:23 +02:00
Woodie-07 8426fddcb7 workaround for LR1110 shift issue
it seems that if the LR1110 radio hears a packet corrupted in a specific way, it'll report a packet of 0 length and with the header error IRQ set. every packet received afterwards will then be shifted to the right by 4 bytes on top of the radio's reported offset. this can occur multiple times with the shift increasing by 4 bytes each time. thus, this patch will read from an additional offset after hearing the trigger packet.
transmitting seems to reset the shift - unsure exactly what operation resets it but standby() is called after tx so patch assumes shift is 0 after standby(). more investigation may be needed here.
2025-10-12 16:09:57 +01:00
Florent 757ff9fb55 stm32: force the use of Adafruit BusIO v1.17.2 as 1.17.3 won't compile on this platform 2025-09-20 08:54:30 +02:00
João Brázio 7fca20475a Merge remote-tracking branch 'upstream/dev' into jbrazio/2025_3f11ad35 2025-09-08 02:04:14 +01:00
João Brázio 0051ccef26 Refactor bridge implementations to inherit from BridgeBase 2025-09-08 02:03:08 +01:00
taco 8521b0eb08 new version of CustomLFS lib 2025-09-07 19:54:42 +10:00
taco accd1e0a97 nrf52 targets: increase limits for contacts and channels 2025-09-06 14:15:40 +10:00
taco c5180d4588 initial commit: CustomLFS 2025-09-06 14:15:40 +10:00
Scott Powell c28001d1e2 * ESP platform ver > 6.11.0 seems to break Github Actions 2025-09-01 14:29:40 +10:00
recrof 7a00f3060e downgrading pioarduino because build issues 2025-08-31 14:33:49 +02:00
Alex Wolden c636536599 Add INA226 to rak 2025-08-20 22:23:54 -07:00
Scott Powell a9d4cf1d21 * various repeaters: fix for missing MomentaryButton module 2025-08-19 23:14:11 +10:00
recrof 6861b0702f create sensor template in platformio.ini, update heltec v3 and rak4631 to use new template 2025-08-02 21:40:56 +02:00
recrof 8d3bdc6945 pin the pioarduino version to last working one 2025-08-02 16:26:21 +02:00
recrof 6be8e19a9f move radiolib wrappers to dedicated directory 2025-07-13 11:37:33 +02:00
recrof 854a8dfe2f move rak to nrf52_core, remove nrf52840_core 2025-07-12 20:06:56 +02:00
Scott Powell 3d70a0d02c * added RADIOLIB_EXLUDE_'s for faster builds 2025-07-04 21:33:07 +10:00
ripplebiziGitHub e30eef73f7 Merge pull request #396 from jbrazio/jbrazio/2025_5dba32d2
Adds support for the Waveshare RP2040-LoRa board
2025-06-18 14:57:45 +10:00
João Brázio 52acae1fe7 Set default upload protocol 2025-06-16 02:01:04 +01:00
João Brázio 8f6b2b75d7 Waveshare RP2040-LoRa board support 2025-06-15 23:48:49 +01:00
recrof e44f1eebb1 fix duplicate flag 2025-06-08 17:02:34 +02:00
Rastislav VysokyiGitHub 9d1c85526e Merge branch 'ripplebiz:dev' into dev 2025-06-07 09:39:36 +02:00
Scott Powell 7dd7b715cd * enabling _PRIVATE_KEY import/export for ALL companions. 2025-06-07 14:20:59 +10:00
Rastislav VysokyiGitHub 7deb82823c Merge branch 'ripplebiz:dev' into dev 2025-06-06 12:35:00 +02:00
Rastislav VysokyiGitHub 6e5c865c21 Disable LFS_ASSERT to stop freezing the boards on LFS errors 2025-06-06 00:23:57 +02:00