Root cause of the beta_31 periodic 1-2s freezes with Wi-Fi on: every
received mesh packet pushes an RX-log frame to all connected TCP/WS
companion clients from the loop thread, and writeAllBytes called
WiFiClient::write() unguarded — against a stale peer (phone asleep,
half-open socket) that blocks in the framework's 1s select() retries.
The 120ms app timeout only bounded attempts, not the first call.
- TCP+WS servers: probe writability (zero-timeout select on the client
fd) before every write; lwIP reports writable only with ~2.8KB free,
a whole frame is ~180B, so probed writes complete instantly.
- Reap clients whose writes fail continuously for 10s (half-open
sockets previously stayed "connected" forever, eating the write
budget on every pushed frame).
- Chat-history ring: chunked writer + wider flush spacing (same
treatment saveContacts got in beta_30).
- Stall tracer: 16-entry ring of >=0.2s loop stalls, shown in About.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Decoded a T-Deck coredump (Task WDT, loopTask stuck in spiffs_gc_clean under
DataStore::saveContacts): a contact save on a churned SPIFFS can trigger a
multi-second garbage-collection pass that starves core 0 and trips the task
watchdog, giving a reboot loop.
- Route contacts/channels to SD when a card is present, even on upgraded
devices whose data is still on SPIFFS (main.cpp mounts SD every boot; if not
fully adopting SD, store.setSecondaryFS(&SD)). DataStore::begin() migrates the
existing /contacts3 + /channels2 to the card once; identity/prefs stay put.
- Move the ref-counted WdtHeavyGuard into a shared header so the core
DataStore::saveContacts shares one count with the UI history/backup saves, and
wrap saveContacts with it (guaranteed fix for card-less devices).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New: stable/test update channels with an opt-in "Get test builds (beta)" toggle on
OTA devices (switches both the update check and what you install); experimental
opt-in MQTT bridge (consent-gated, payload encryption, direct messages off by
default); Portugal (Narrow) region preset (#74); saved-contacts counter in the
Contacts overflow menu (#72).
Fixed: the signal probe is now strictly zero-hop so a repeater can't re-flood it;
the contact list sorts before capping so the most relevant contacts show, with a
"+N more — search to narrow" footer (#73); the blocked-users list opened from
Contacts shows the two-line title bar with a back button; the Contacts overflow
popup fits the screen again.
Also lands the two-channel release tooling (scripts/release.sh stable/beta modes +
gen-flasher-meta channel arg), the docs site, and the MQTT reference decryptor.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New: Spectrum analyzer app; custom notification sounds (SD WAV per event);
saved Wi-Fi networks with auto-join; unified chat settings screen; per-channel
mute; Heltec V4.3 high-gain receiver (FEM LNA) toggle; Apps button on the V4
home screen; Blocked list reachable from Contacts + chat settings; Portuguese
(BR) UI language.
Fixed: touch-screen flood adverts now region-scoped so region repeaters relay
them (#68); channel sends matched by name so a message can't go out on the
wrong channel's key; opt-in "scope direct messages to region" so room-server
logins work through a region-only path (#64); Wi-Fi scan no longer cancelled
by the reconnect retry (empty SSID list).
Under the hood: flood-scope rework (channel vs direct floods); Spectrum owns
the SX1262 while open and restores mesh RX on exit; wifiScanIsActive() gate;
FEM KCT8103L LNA wired; TouchPrefsStore migrations for the new prefs. Adds the
previously-untracked device_caps.h.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
the_mesh was the single biggest static internal-DRAM consumer at 42 KB (dominated
by the MAX_CONTACTS=100 ContactInfo array inside it). Internal DRAM (~320 KB) is the
scarce resource on the ESP32-S3 — Wi-Fi/BLE DMA + heap fight over it, and the V4 was
hitting ~99% on map-tile load (issue #47b). PSRAM (8 MB) is plentiful.
Place the whole the_mesh object in PSRAM via placement-new into a heap_caps_malloc
(MALLOC_CAP_SPIRAM) block and bind a reference, so every the_mesh.foo() call site is
unchanged. The constructor still runs at the SAME static-init point as the old direct
global (PSRAM is already up then), so timing and behaviour are identical; only the
address moves off internal DRAM. Falls back to internal RAM if PSRAM is absent.
ESP32-only (STM32/RP2040 keep the plain global). The contacts array rides along
inside the object — no vendored-core change.
Measured on heltec_v4 (.dram0.bss): 124160 -> 82000 B = ~41 KB internal DRAM freed.
Verified on the T-Deck: clean boot, [BOOT] mesh ok, reason=0, zero panic markers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Decoded coredumps (device + the beta_16 ELFs) are all task-watchdog panics:
CPU0=IDLE0 CPU1=IDLE1, core 0 in spi_flash_op_block_func. A legitimate-but-slow
flash burst (SPIFFS GC, or a bulk DataStore save = thousands of writes) parks both
cores with the cache disabled, starving both IDLE tasks past the ~5s default so the
TWDT panics. The burst can't be chunked under the limit easily and the per-core
WdtHeavyGuard only covers core 0, so re-init the TWDT with a 20s grace (still
catches a genuine multi-second hang) instead. esp_task_wdt_init re-init reconfigures
the running TWDT (old API on this arduino-esp32).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Post-beta_12 touch-UI fixes (T-Deck / Tanmatsu keyboard nav + composer):
Keyboard navigation
- Chat composer auto-edits on open (cursor shows, type immediately); every
OTHER field stays in navigate mode so the letter-nav keys keep working —
press select/Enter to edit it. Enter (or Esc/X on Tanmatsu) on an empty
composer drops back to navigate mode.
- Menu-bar tab-hotkey letters no longer fire while a text field is the focused
element (fixes a stray tab-jump while typing); directional nav still moves.
- New "Show menu-bar letters" setting (off by default) for the tab hotkeys.
Accent box
- The tap-to-pick accent box no longer steals the keyboard-nav focus group
(NAV_SKIP_FLAG) — it's a passive hint, so typing continues and a keybind no
longer navigates. Ready to wire arrow-key selection later.
Composer
- Dedicated "Special characters" picker (% $ @ # & ... currency/math/accents),
separate from the emoji picker.
- Long-press a sent message -> Resend.
Misc
- 12-hour clock honoured everywhere (top bar, chat bubbles, lock screen), not
just the chat overview.
- GPS UART RX buffer enlarged only when GPS is enabled (restores V4 RAM).
- Derive time-of-day from received mesh message timestamps when Wi-Fi/GPS off.
- Self-record the task-watchdog context on a TWDT reset for the crash report.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The GPS NMEA UART used Arduino's default 256-byte RX ring (~66 ms of slack at
38400 baud). On the busy touch UI a single long LVGL/map frame stalls the loop
past that window, dropping bytes and corrupting NMEA ephemeris subframes — each
loss costs the receiver ~30 s, turning a ~1-minute fix into several minutes or,
with frequent stalls, never acquiring. Confirmed on-device: peak UART backlog
hit 448 B at idle, well past the 256 B default. Bump the ring to 4096 B (~1 s of
slack) before the core opens Serial1 in sensors.begin(). App-side (no core
re-tag); gated to ENV_INCLUDE_GPS so both touch boards get it. A -DGPS_BUF_DEBUG
backlog probe is included (compiled out of releases).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Opt-in Idle power-save for the T-Deck: when parked (screen off, on battery, no
companion client, Wi-Fi+BLE off, mesh idle) the main loop is throttled with
vTaskDelay so the FreeRTOS idle task can halt the CPU between ticks, on top of the
existing 80 MHz screen-off downclock — without ever stopping mesh RX. Default OFF
(Settings -> Lock, persisted TouchCfg v8 sleep_idle); status-bar moon indicator +
idle stats. Heltec V4 compiles (gate never passes there). A plain scheduler throttle
rather than esp_light_sleep_start(), which trips INT_WDT in this build.
Co-authored-by: Dan Vybiral <dan.vybiral@greencode.cz>
Core bump: lib_deps -> meshcomod core-v1.16.3 (BLE advertises the node
name not "NimBLE"; GPS won't push a pre-fix ~1902 date).
Tim's quick-wins: Enter-key-sends toggle, 12-hour clock, lock-when-screen-off,
reverse scrollball.
Launcher / map: fix Wi-Fi tiles never downloading under Launcher (the SD-fallback
cache made tilesFsLowSpace() read the unmounted LittleFS as "full"); plot contact
markers before the tile decode so dots aren't ~2s late.
RTC / time: anchored-time guard re-applies UTC when the clock reads garbage
(GPS clobber); blank pre-2020 timestamps so empty channels don't show 1969/1970;
timezone picker (named zones with correct DST) replacing the CET-only base, with
a v2->v3 config migration mapping prior manual offsets onto a Custom zone.
BLE: persist the random pairing PIN (was re-rolled every boot).
Chat: don't auto-jump to latest on a new message when scrolled up; block-by-name
for non-contact room/channel senders (un-blockable room bots).
Power: drop CPU to 80 MHz when the screen is off; enable Wi-Fi modem-sleep only
once associated (enabling it on the unassociated STA broke the setup-wizard scan).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Theme reverting on reboot: the boot wordmark reads a pref (UI rotation) BEFORE
SdNvsPrefs::useFile() switches the backend to files, so the settings blob got
cached from legacy NVS and file-saved values (accent, brightness, language…)
were ignored every boot. Add touchPrefsReload(), called right after useFile(),
to re-read from the file backend. (main.cpp now quote-includes TouchPrefsStore.h
so it sees the new decl, not the monorepo lib's stale copy.)
- Control center: a settings page opened via a chip long-press now returns to the
dropdown (not Home) when you tap the bar to go Back — tracked with
s_settings_from_cc.
- Control center now follows the theme accent: brightness slider indicator/knob
and the toggle chips use COLOR_ACCENT (chips: solid on / faint off) instead of
a fixed green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make the touch app's own prefs filesystem-backed instead of NVS, so it no longer
contributes to the tiny 20 KB NVS partition whose exhaustion (esp. under
Launcher) triggered boot loops. main.cpp calls SdNvsPrefs::useFile() once after
the storage decision: SD (/meshcomod) when a card is the active data store, else
SPIFFS (/prefs); V4 always SPIFFS (no SD). The radio stack + Launcher still use
NVS (not ours to remove).
Backward compatible / in-place update:
- Read-through migration: in file mode each getter falls back to the old NVS
value (read-only), so existing settings + Wi-Fi creds still load and move to
the file on their next save — nothing is lost, no re-entry needed. Gated by a
one-time 'does NVS have our data' probe so fresh devices don't log-spam.
- New writes only ever touch the file; NVS is never written in file mode.
- On-disk .kv format unchanged, so existing /meshcomod/<ns>.kv files keep working.
- Legacy NVS-or-SD path kept intact for before useFile() runs (early boot read)
and as a fallback, so the device stays byte-compatible if it's never reached.
- factory-reset (clear) also wipes the legacy NVS copy so it's permanent.
main.cpp includes SdNvsPrefs.h quoted to pick wadamesh's src/ copy over the
monorepo lib's stale one.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- MyMesh.cpp: strcpy(p->name, contact.name) could overrun the 32-byte advert_paths
name field when an over-the-air advert carries a 32-char (unterminated) name,
corrupting the recently-heard/Found table. Bounded with strncpy + NUL-terminate.
- main.cpp: log nvs_free_entries at boot so a filling NVS (the boot-loop trigger
under Launcher) is visible in serial before it goes catastrophic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
First board lands. wadamesh builds the LVGL touch firmware as its own project,
consuming the MeshCore core via lib_deps @ git tag (ALLFATHER-BV/MeshCore
#v1.16.0-wada.0) — no vendored core in this repo. Output is byte-identical to the
in-tree meshcomod build (delta = embedded build-path strings only).
Contents: companion_radio app (MyMesh/main/DataStore), ui-touch LVGL UI,
variants/heltec_v4 board glue, boards/heltec_v4.json, lv_conf, the bundled
ed25519 lib, AsyncElegantOTA, partition table, and a flattened platformio.ini
for env heltec_v4_tft_companion_radio_usb_tcp_touch.
MeshCore-derived files (app glue) remain MIT; ui-touch is GPL — see NOTICE.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Kaj Schittecat <kaj@schittecat.com>