You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remote firmware management for RAK4631 Meshtastic nodes via ESP32-S3
Node out of reach? Firmware out of date? Just lazy? Manage your RAK4631 remotely -- config backup/restore, firmware flashing, SWD recovery, and more -- from the comfort of your couch, car, or bicycle.
Built for the RAK4630/4631 (nRF52840) module on a RAK19001 baseboard, this ESP32-S3 firmware connects via UART and SWD to provide a full-featured web-based management interface over WiFi.
Status: Active development. Core features are functional and tested. See Feature Status below.
Key Features
SWD Flash Backup -- Full 1MB flash dump via bitbang SWD. Back up your entire nRF52 firmware. No bootloader needed. (Restore is implemented but still being tested.)
Meshtastic Config Backup & Restore -- Full settings, channels, and encryption keys backed up via the native Meshtastic protobuf serial API. Restore to the same node or transfer to another.
Meshtastic Command Console -- Query and change Meshtastic settings from your browser. GET any config section, view channels, check device metadata, reboot, factory reset -- all through a web UI.
TCP Bridge (Port 4403) -- Transparent serial bridge compatible with the Meshtastic Python CLI. Use meshtastic --host <ip> as if directly connected via USB.
HTTP Bridge API -- Meshtastic-compatible REST endpoints (/api/v1/fromradio, /api/v1/toradio) for integration with Meshtastic web clients and tools.
Real-Time Serial Monitor -- Protocol auto-detection (Meshtastic protobuf, SLIP/DFU, NMEA, AT commands, plain text), hex and text display modes, bidirectional passthrough, WebSocket streaming.
SWD Recovery -- Mass erase, reflash bootloader and SoftDevice when your node is bricked. Direct memory read/write for debugging.
Web UI -- 7-page responsive dark-themed interface accessible from any device on WiFi. Embedded in firmware -- no separate filesystem upload needed.
WiFi AP + STA -- Creates its own hotspot, or joins your existing WiFi network for LAN access. Automatic fallback to AP if STA connection drops.
GPIO Control -- All pin assignments configurable via WebUI. Test individual pins, trigger reset, enter DFU mode.
Deep Sleep -- Auto-sleep after idle timeout with GPIO wake-on-signal for low-power remote deployments.
OTA Updates -- Update the ESP32-RAKFlasher firmware itself over WiFi.
Important: TXD1/RXD1 labels on the RAK19001 are from the baseboard's perspective. ESP32 TX goes to TXD1 (which routes to the RAK module's RX pin P0.15). All pin assignments are configurable via the web UI Settings page.
RAK4631 Configuration
For serial communication (backup/restore, command console), the RAK4631 must be configured:
Note: GPS mode must be set to NOT_PRESENT because P0.15/P0.16 are shared with the GPS UART on RAK4631. SWD operations (backup, erase, flash) do NOT require any serial configuration -- they work regardless of firmware state.
Getting Started
Build & Flash
# Clone the repository
git clone https://github.com/synssins/RAKFlasher.git
cd RAKFlasher
# Build firmware (auto-increments build number, embeds web UI)
pio run
# Flash via USB
pio run -t upload
# Or flash via OTA (if already running RAKFlasher)
curl -F "firmware=@.pio/build/seeed_xiao_esp32s3/firmware.bin" http://192.168.4.1/api/ota/update
First Connection
Power on the ESP32-S3
Connect to WiFi: RAKFlasher-XXXX (password: flasher123)
pio run # Build firmware (auto-embeds web UI)
pio run -t upload # Flash via USB
pio run -t clean # Clean build artifacts
pio device monitor # Serial console monitor
Web UI Development
The web UI is embedded directly into the firmware binary via tools/embed_webui.py. This script runs automatically during the build and gzip-compresses all HTML/CSS/JS files into a C header file (include/web_content.h). No separate uploadfs step is needed.
To modify the UI:
Edit files in data/www/
Run pio run -- the embed script regenerates the header automatically
Flash the new firmware
OTA Update
Once RAKFlasher is running, firmware updates can be pushed over WiFi:
# From the web UI: Settings page > OTA Update > Upload .bin file# Or via API:
curl -F "firmware=@.pio/build/seeed_xiao_esp32s3/firmware.bin" http://<ip>/api/ota/update
Security Notes
Change the default WiFi password (flasher123) on first use
Channel backups currently use XOR obfuscation -- not cryptographically secure. Do not rely on the password feature for sensitive key material until AES-256 is implemented.
No internet access -- the ESP32 does not make any external network calls
Local-only -- all communication is on the local WiFi network