# Reflashing and Factory Reset

When a MeshCore repeater becomes unreachable, misconfigured, or boot-loops, reflashing is the recovery option. This page covers reflash procedures for all common device families.

## When to reflash vs. when to reconfigure

<table id="bkmrk-symptomtry-firstif-t"><thead><tr><th>Symptom</th><th>Try first</th><th>If that fails</th></tr></thead><tbody><tr><td>Node working but wrong settings</td><td>Reconfigure via meshcore-cli or the serial CLI</td><td>Factory reset + reconfigure</td></tr><tr><td>Boot-looping or immediate crash</td><td>Power cycle; hold reset during boot</td><td>Reflash firmware</td></tr><tr><td>BLE not discoverable</td><td>Power cycle; V3: check BLE antenna</td><td>Reflash</td></tr><tr><td>Firmware corruption after interrupted flash</td><td> - </td><td>Reflash (required)</td></tr><tr><td>Unknown configuration state</td><td>Factory reset via serial: `erase` (destructive — wipes the device filesystem)</td><td>Reflash if serial inaccessible</td></tr></tbody></table>

## Before reflashing: document your current config

If the device is still accessible, record its configuration before wiping. There is no single config-dump command in the MeshCore CLI — read each value with its own `get` command (typed into the serial console, or via the `meshcore-cli` host tool) and save the output:

```
# Capture each setting and save to a file
get name
get role
get freq
get radio
get tx
get lat
get lon
get flood.advert.interval
# Copy the console output into node_config_backup.txt
```

## Reflash via MeshCore web flasher (recommended)

1. Connect device to PC via USB
2. Open [flasher.meshcore.io](https://flasher.meshcore.io/) in Chrome or Edge (WebSerial required)
3. Click "Connect" and select your device's serial port
4. Select device type and firmware variant (Repeater)
5. Click Flash and wait (~2 minutes)
6. Device reboots automatically when complete

## Entering bootloader/DFU mode (when auto-detect fails)

### ESP32-based devices (Heltec V3, V4, T-Beam)

Hold the BOOT button, press and release RESET, then release BOOT. The device enters download mode and should appear as a serial port. Some devices require the BOOT button held while inserting the USB cable.

### nRF52840-based devices (RAK4631, T-Echo, Nano G2 Ultra)

Double-tap the reset button quickly. The device enters DFU mode and appears as a USB drive named "BOOT" or similar. Copy the .uf2 firmware file to this drive to flash.

Alternatively, use the web flasher which handles DFU automatically for most nRF52840 devices.

### Station G2

**Power requirement:** The Station G2 generally expects a higher input than a standard 5V USB cable (commonly a 9–19V DC or USB-C PD source). Confirm the exact input-voltage range against the manufacturer's datasheet for your unit before powering it — feeding the wrong voltage can destroy hardware. If a board fails to flash on a plain 5V cable, an under-powered supply is a likely cause.

## Post-reflash configuration

After flashing, the device has factory defaults. Note that the repeater **role is determined by the firmware variant you flashed** (flash the Repeater build) — there is no command to change the role; you can only read it with `get role`. Reconfigure the radio and identity using the serial console (or `meshcore-cli`):

```
# Apply the USA/Canada radio plan (910.525 MHz / BW 62.5 kHz / SF7 / CR5).
# You can select the preset in the MeshCore app, or set the raw params directly:
set radio 910.525,62.5,7,5
reboot

# Confirm the role (set by the flashed firmware, read-only):
get role

# Set name (use your documented name)
set name "REPEATER-NAME"

# Set position (latitude and longitude are separate commands;
# there is no altitude setting in the firmware):
set lat 47.6062
set lon -122.3321

# Advertisements: send one flood advert now, and set the periodic
# flood advert interval in HOURS (default 12, range 3-168):
advert
set flood.advert.interval 12

# Set TX power in dBm. Real command is "set tx" (documented range 1-22 dBm;
# the SX1262 PA tops out near 22 dBm). 22 matches the build guides.
# Total EIRP = TX power + antenna gain - feedline loss; keep it within the
# FCC 47 CFR 15.247 limits for 902-928 MHz. With an antenna over 6 dBi you
# must reduce conducted power dB-for-dB, so lower this below 22 as gain rises.
set tx 22

# Verify the key settings:
get role
get radio
get freq
get tx
get name

# Reboot
reboot
```

## When the device is completely unresponsive

If USB serial doesn't appear and the device shows no activity:

1. **Try a different USB cable.** Many micro-USB and USB-C cables are charge-only and have no data lines. Use a known-good data cable.
2. **Try a different USB port.** USB hubs can cause issues; try a direct port on the computer.
3. **Check the USB driver if needed:** The Heltec V4 (ESP32-S3) uses native USB and does *not* require a CH340/CP210x bridge driver — it enumerates as a standard USB CDC serial device on Windows 10/11. (The V3 used a CP2102 bridge.) RAK4631 and T-Echo also use standard USB CDC. If a unit fails to enumerate, check the cable and DFU/download mode rather than a bridge driver.
4. **Check for physical damage:** Inspect the USB port for bent pins or corrosion. A damaged USB port prevents flashing.
5. **Last resort:** Some boards can be recovered via JTAG/SWD with a debug probe. Consult the manufacturer's documentation.