Skip to content

Flashing Tutorial ​

Three flashing methods are listed in order of recommendation. Read the Hardware Selection Guide first and match the chip, Flash and PSRAM environment.

1. Online Flashing (Zero Tooling) ​

Open the online flashing tool — the browser talks to the device serial port directly, no tool installation required. See Online Flashing Tool for details.

2. PlatformIO Single Device (Daily Development) ​

  1. Install VSCode + PlatformIO, or the PlatformIO CLI.
  2. Connect the board and note the serial port (e.g. COM6).
  3. From the FastBee-Arduino repo root:
powershell
# Windows
powershell -ExecutionPolicy Bypass -File scripts\deploy.ps1 -Env esp32-F4R0 -Port COM6

# Linux / macOS (requires pwsh)
pwsh -File scripts/deploy.ps1 -Env esp32-F4R0 -Port /dev/ttyUSB0
ParameterDescription
-MonitorOpen serial monitor after flashing
-BuildOnlyCompile without flashing
-SkipFsSkip filesystem upload
-SkipDoctorSkip environment diagnostics

Safe Factory Template

Release firmware contains a safe template with no device identity or STA/MQTT credentials, and peripherals and rules are disabled by default. No code change is required, but first boot still requires network provisioning and hardware-specific peripheral setup or import of a matching configuration example. See Network Best Practices.

3. One-Click Batch Flashing (Mass Production) ​

deploy-all.ps1 auto-detects every connected ESP32 serial port and flashes the merged factory-with-fs.bin (firmware + filesystem) at address 0x0 in parallel:

powershell
# Auto-detect ports, flash all devices (default env esp32-F4R0)
powershell -ExecutionPolicy Bypass -File scripts\deploy-all.ps1

# Specific env / ports
powershell -File scripts\deploy-all.ps1 -Env esp32c3-F4R0 -Ports COM5,COM7

# List detected ports only
powershell -File scripts\deploy-all.ps1 -ListPortsOnly

# Dry run
powershell -File scripts\deploy-all.ps1 -DryRun
ParameterDefaultDescription
-Envesp32-F4R0Build environment
-PortsautoComma-separated port list
-MaxParallel2Parallel flash jobs
-Baud921600Drop to 460800 if unstable
-SkipBuildoffReuse existing build artifacts

Detection matches CP2102 / CH340 / FTDI / ESP32 USB-CDC descriptions and common VID:PID (10C4:EA60, 1A86:7523, 303A).

Troubleshooting

  • Port busy: close serial monitors and other tools holding the port
  • Flash write fails: lower -Baud to 460800; hold BOOT while powering S3 boards
  • Device not detected: swap the USB cable (some are charge-only); install CP210x/CH340 drivers (see the Downloads Center)

4. Manual esptool (Advanced / CI) ​

powershell
python -m esptool --port COM6 --baud 921600 write_flash 0x0 .pio\build\esp32-F4R0\factory-with-fs.bin

5. Post-Flash Verification ​

  1. Open a serial monitor at 115200 baud and confirm a clean boot log.
  2. Connect to the fastbee-ap hotspot (first boot) and open http://192.168.4.1.
  3. Default login: user admin, password admin123.
  4. Continue with Quick Start.

FastBee | fastbee.cn