mirror of
https://github.com/meshtastic/firmware.git
synced 2026-08-01 10:58:30 -04:00
144b07986bea4e19d135a39527d587725b1dbf55
* Fix ESP32-S3 USB CDC: post-disconnect task-WDT reboot from blocking console log writes When a serial API client disconnects (USB cable still attached), the host stops draining the USB-Serial/JTAG CDC buffer. The next raw-text debug log write can then block the main loop task indefinitely (measured: a single write blocked 52.4 s). The loop task stops feeding the app task watchdog (APP_WATCHDOG_SECS = 90 s, trigger_panic), so the device reboots with esp_reset_reason = ESP_RST_TASK_WDT ~97 s after every serial disconnect. On 2.7.x (arduino-esp32 2.x / IDF 4.4) the reboot also re-enumerated USB; since the Arduino 3.x migration the reboot is silent (USB stays enumerated), making it look like a random reboot ~90 s after using the CLI. Fix: on USB CDC targets, keep console TX in non-blocking mode (txTimeout 0, drop-oldest) whenever no API client is provably alive, and restore the normal bounded timeout while a client is connected so protobuf API frames are never truncated. Toggle points: boot, handleToRadio (host sent bytes), and onConnectionChanged (set non-blocking before disconnect handling emits more log lines to a dead port). Repro/validation on HELTEC_WIRELESS_TRACKER_V2 (macOS + Linux hosts): open+close any meshtastic-python session, wait 150 s: reboot_count +1 every time on unpatched builds; flat with this fix. Max observed log write stall drops from 52405 ms to 30 ms. * Condense comments per review feedback --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Overview
This repository contains the official device firmware for Meshtastic, an open-source LoRa mesh networking project designed for long-range, low-power communication without relying on internet or cellular infrastructure. The firmware supports various hardware platforms, including ESP32, nRF52, RP2040/RP2350, and Linux-based devices.
Meshtastic enables text messaging, location sharing, and telemetry over a decentralized mesh network, making it ideal for outdoor adventures, emergency preparedness, and remote operations.
Get Started
- 🔧 Building Instructions - Learn how to compile the firmware from source.
- ⚡ Flashing Instructions - Install or update the firmware on your device.
Join our community and help improve Meshtastic! 🚀
Stats
Languages
C++
70.9%
C
25.7%
Python
2.2%
Shell
0.7%
Batchfile
0.2%
Other
0.2%
