Commit Graph
2876 Commits
Author SHA1 Message Date
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
Valentin V. Bartenev e99cee2a1b Web: pin HTTPS and redirect server tasks to core 0 at low priority
Set task_priority = tskIDLE_PRIORITY + 2 and core_id = 0 for both the
HTTPS server and the HTTP-to-HTTPS redirect server. This keeps web
serving off core 1, which handles radio and application logic, reducing
interference with time-sensitive operations.
2026-05-05 21:00:13 +03:00
Valentin V. Bartenev 58258aa673 Adjust tag name for triggering repeater builds 2026-05-04 04:35:47 +03:00
Valentin V. Bartenev ccd5a588a2 Adjust firmware GitHub building actions 2026-05-04 02:08:02 +03:00
Valentin V. Bartenev dd90afba1d NetworkService: keep hasTimeSync() true for 24h after WiFi drops
_have_time_sync is reset to false whenever WiFi disconnects, even
though the ESP32 RTC continues to hold accurate time after a
successful SNTP sync. This caused hasTimeSync() to return false
during transient WiFi outages, unnecessarily tearing down MQTT
broker connections and suppressing packet publishing.

Introduce _last_time_sync to record the wall-clock time of the
most recent confirmed sync. Move hasTimeSync() out of the header
into NetworkService.cpp and extend its logic: in addition to the
existing _have_time_sync flag, return true if the system clock is
still sane (>= kMinSaneEpoch) and no more than kMaxOutOfSync (24h)
has elapsed since the last confirmed sync.

This makes the MQTT uplink resilient to brief WiFi dropouts without
requiring any changes to callers of hasTimeSync().

Also bump kMinSaneEpoch from 2025-01-01 to 2026-01-01.
2026-05-03 22:10:32 +03:00
Valentin V. Bartenev 80851b9c25 Use Russian NTP servers 2026-05-03 20:09:57 +03:00
Valentin V. Bartenev c2074fc996 Docs: reorder items in userguide list 2026-05-02 21:46:35 +03:00
Valentin V. Bartenev 12a9d3b8dc Docs: translate title 2026-05-02 21:43:36 +03:00
Valentin V. Bartenev 85ad6a2852 Docs: fix building due to missing quotes around string with colon in yaml 2026-05-02 21:41:52 +03:00
Valentin V. Bartenev 2d47eef756 Docs: switch theme language and localize the rest 2026-05-02 21:39:52 +03:00
Valentin V. Bartenev 9bdca82e48 Docs: shorter menu title for firmware building 2026-05-02 21:32:54 +03:00
Valentin V. Bartenev fdd6ef7b0b Docs: fixes and menu translation 2026-05-02 21:31:14 +03:00
Valentin V. BartenevandGitHub 0b6501f874 Heading for features lists in README.md 2026-05-02 20:48:45 +03:00
Valentin V. BartenevandGitHub 194e004186 Add info about fan control feature to README.md 2026-05-02 20:13:36 +03:00
Valentin V. BartenevandGitHub 3b017b42f0 Even shorter heading README.md 2026-05-02 20:12:19 +03:00
Valentin V. BartenevandGitHub fa2f1fc1b5 Shorter heading in README.md 2026-05-02 20:11:05 +03:00
Valentin V. BartenevandGitHub dedffa6dc2 Update README.md 2026-05-02 20:08:45 +03:00
Valentin V. Bartenev 5cc794ce1b Slightly refresh docs index 2026-05-02 19:53:12 +03:00
Valentin V. Bartenev 28d43e964d Adopt and translate documentation 2026-05-02 19:47:10 +03:00
Valentin V. BartenevandGitHub fda92915d4 Reorganize web-panel feature list in README.md 2026-05-02 18:54:58 +03:00
Valentin V. Bartenev a6a6b4f43f Slightly crop web-panel app screenshot
To make it equally sized with the stats one, which gives better look
when they are side-by-side on the README page.
2026-05-02 17:19:56 +03:00
Valentin V. BartenevandGitHub 80c83423fa Adjust web-panel features and screenshots in README.md 2026-05-02 17:02:17 +03:00
Valentin V. Bartenev 9e964d3b23 Update web-panel screenshots to MeshCoreTel variant
Format is changed to WebP for better compression and reduced loading time.
2026-05-02 16:50:58 +03:00
Valentin V. BartenevandGitHub d129846acd Add screenshots of web-panel to README.md 2026-05-02 04:22:36 +03:00
Valentin V. Bartenev c4e7a43639 Adjust GitHub-pages site logo 2026-05-02 01:34:02 +03:00
Valentin V. Bartenev 18a0db8d42 Adjust GitHub-pages site configuration for MeshCoreTel-firmware 2026-05-02 01:30:25 +03:00
Valentin V. Bartenev 4c95fb11d4 Remove migaration docs page
It's about migration from older EastMesh firmware:

 - https://github.com/xJARiD/MeshCore

and  not relevant to MeshCoreTel at all.
2026-05-02 01:13:54 +03:00
Valentin V. Bartenev ea3f676a3a Replaced EastMesh to MeshCoreTel across all the docs 2026-05-01 20:45:40 +03:00
Valentin V. BartenevandGitHub 3ae2aab8ed Fix EastMesh firmware URI in README.md 2026-05-01 20:30:13 +03:00
Valentin V. BartenevandGitHub ef65791d72 Additional correction in README.md 2026-05-01 20:23:13 +03:00
Valentin V. BartenevandGitHub b0ead9e695 Fix README.md 2026-05-01 20:21:07 +03:00
Valentin V. BartenevandGitHub 729f5c45e4 Adjust heading in README.md 2026-05-01 20:00:14 +03:00
Valentin V. BartenevandGitHub d0b9c82464 Update README.md 2026-05-01 19:59:14 +03:00
Valentin V. BartenevandGitHub fe8e0556df Translated README.md 2026-05-01 19:51:18 +03:00
Valentin V. Bartenev 89aec17b68 Remove Station G2 repeater build with logging
There's no known reason why additional firmware build of this board
with serial logging enabled was needed.

So, removing it for now to optimize building process and cleanup
firmware list.
2026-05-01 15:34:23 +03:00
Valentin V. Bartenev d74d99c7f1 Add DIY ESP32S3 N16R8 E22 Back2back board support
This closes #1.
2026-05-01 15:29:56 +03:00
Valentin V. Bartenev afd5fc2f98 Unify firmware version format with release builds. 2026-04-29 01:07:11 +03:00
Valentin V. Bartenev 79550a7f81 Update building script for MeshCoreTel release. 2026-04-28 18:18:13 +03:00
Valentin V. Bartenev a99196c3ce Do not tokenize HW model in JSON payload.
Tokenization replaces dots and spaces with underscores
making it look ugly on the MeshCoreTel website.
2026-04-28 03:27:49 +03:00
Valentin V. Bartenev 68e951e204 Work around IDFv4 heap canary corruption on early connect failure.
When the MQTT WebSocket handshake fails before a connection is fully
established (e.g. "Sec-WebSocket-Accept not found"), the IDF v4
transport teardown path writes only 3 of the 4 bytes of the heap block
tail canary (expected 0xbaad5678, actual 0xbaad5600).  The subsequent
esp_mqtt_client_destroy() call frees that block, causing multi_heap_free
to detect the broken canary and abort:

  CORRUPT HEAP: Bad tail at 0x3fcb42a4. Expected 0xbaad5678 got 0xbaad5600
  assert failed: multi_heap_free multi_heap_poisoning.c:259 (head != NULL)

The fix is to check heap integrity with heap_caps_check_integrity_all(false)
between esp_mqtt_client_stop() and esp_mqtt_client_destroy().  If corruption
is detected, scan internal SRAM (0x3FC00000–0x3FD00000) for the truncated
canary pattern and restore it to the correct value before
destroy() runs.

The scan is a no-op when the heap is clean and is compiled out entirely
on IDF v5+, where the underlying bug does not exist.

This fixes crash-on-reconnect observed with ESP32-S3 + IDF v4 + WSS transport.
2026-04-28 03:01:37 +03:00
Valentin V. Bartenev 03c365124b Fix truncation of LWT message.
It's just too small to fit the whole JSON that is put there
in refreshBrokerState().
2026-04-28 02:11:59 +03:00
Valentin V. Bartenev 46b0df7a4b Removed EastMesh MQTT broker support.
It's intended for Eastern Australia repeaters only.  Using original EastMesh
firmware is prefered in this case.
2026-04-28 00:52:26 +03:00
Valentin V. Bartenev 64cebbc750 Updated readme and licence for this fork. 2026-04-27 03:15:43 +03:00
Valentin V. Bartenev f1912ff184 Added support for MeshCoreTel broker. 2026-04-27 03:15:00 +03:00
xJARiDandGitHub 41a29975a4 Merge pull request #48 from xJARiD/develop
update docs
2026-04-23 09:50:10 +10:00
Jared Dohrman e31c19a848 update docs 2026-04-23 09:49:51 +10:00
xJARiDandGitHub 2b1eb2df56 Merge pull request #47 from xJARiD/develop
fix: PMU web stats display and `start ota` command consistency
2026-04-23 09:43:46 +10:00
Jared Dohrman d75e9b140c docs: add repeater-mqtt-eastmesh-v1.3.11 release notes 2026-04-23 09:37:29 +10:00
Jared Dohrman 4b83142b9e fix: start ota is now consistent across command sources 2026-04-23 09:27:48 +10:00
Jared Dohrman 9085265637 fix: add missing USE_SX1262 for TBeam 1W 2026-04-23 09:18:52 +10:00