SETUP · 8 MIN READ

Flash and set up your device

Take a blank ESP32 board to a working motion sensor through either published browser images or a local CLI build. Both paths meet at the same provisioning, verification, and monitoring steps.

An ESP32 board connected to a laptop for browser flashing
Connect the board directly to the computer with a USB data cable before opening the browser flasher.

What you need

Step 1 — Choose your firmware

Pick the row that matches how you want to use the sensor. You can reflash later if your needs change.

If you...FlashYou get
Want a standalone sensor, browser tools, MQTT, or Home Assistant through an existing brokerNativeImprov Serial setup, broker-free Direct monitoring, optional MQTT, Home Assistant MQTT Discovery, and browser games
Want the most complete Home Assistant integration and YAML configurationESPHomeAuto-discovered device with motion, movement level, threshold slider, and recalibrate switch
Use a controller that supports Matter occupancy sensorsMatterA standard occupancy sensor; controller validation is still limited, so check the current validation notes
Want raw CSI data for researchStreamerRaw capture over UDP; not flashable from the browser, see the setup reference
Not sure? Pick Native, the default in the flasher: it works on its own, supports Home Assistant through MQTT Discovery, and can use every tool on this website. Pick ESPHome when you want YAML configuration and the full Home Assistant control surface.

Step 2 — Build or select an image, then flash

Browser path: install a published image

  1. Plug the board in

    Connect the ESP32 to your computer over USB. Close anything that may be using the serial port, such as a previous flasher tab, the Arduino IDE, or a serial monitor.

  2. Open the flasher

    Go to the Flash page, keep Latest Release selected unless you want a Release Preview from main or a Development image from develop, and choose the firmware from Step 1. The installer detects the chip over USB and selects the matching image.

  3. Connect

    Click Connect. The browser shows a list of serial ports: pick the one that appears when you plug the board in (on Windows a COMx port, on macOS/Linux something like usbserial, usbmodem, or ttyACM).

  4. Install

    Choose Install, confirm, and wait. Flashing takes one to three minutes; do not unplug the cable. When it finishes, the device reboots into ESPectre.

If the port never appears or the connection fails right away, hold the BOOT button on the board while plugging the cable in, then release it and click Connect again. That forces the chip into download mode.

CLI path: build, flash, and monitor

Prepare the repository environment once. Native, Matter, and Streamer prefer a local ESP-IDF installation and can use the pinned Docker build environment when it is absent; flashing still needs local serial tooling. ESPHome manages its own toolchain.

git clone https://github.com/francescopace/espectre.git
cd espectre
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

Choose the frontend from Step 1. The examples target ESP32-C3; replace c3 with c5, c6, s2, s3, or esp32 for another supported board. ESP32-S2 is supported by ESPHome, Native, and Streamer, but not Matter. --clean is optional: add it to a build when configuration or toolchain changes require a clean rebuild of that frontend and chip. Flashing resets the board and starts the application, so no frontend needs a separate run command. Flash, QR, and serial-monitor commands select the only connected device automatically or present a selection menu when several devices are available.

Native uses the shared ESP-IDF build environment. Flashing starts the application; the top-level monitor follows its serial output:

./espectre native build --chip c3 --clean
./espectre native flash
./espectre monitor --reset

Run ./espectre devices to inspect ESPectre endpoints advertised on the local network. The command recognizes Native, Streamer, first-party ESPHome, and Matter devices whose commissioning window is open; use --frontend when you need only one firmware type.

On Windows, use espectre.cmd instead of ./espectre; the setup reference and CLI reference cover complete prerequisites, explicit device overrides, --clean-all, and backend options.

Step 3 — Connect it to your network

Select the firmware you flashed and follow only that setup path.

  1. Provision Wi-Fi over USB

    After flashing, complete the standard Improv Serial prompt in Chrome or Edge. If the handoff cannot open the device automatically, keep the returned URL.

  2. Open Direct Configure

    Go to Configure and enter the device IP or its espectre-<device_id>.local hostname. From a repository checkout, ./espectre devices --frontend native lists Native endpoints advertised on the same mDNS-visible network; use the router lease table when multicast discovery is unavailable. Direct WebSocket can set an optional BSSID pin, edit the device label, and add or clear MQTT without returning stored passwords. A failed Wi-Fi change rolls back to the last-known-good network. Hold BOOT for 3 seconds when USB recovery is needed.

  3. Start sensing

    Open Monitor, keep Direct WebSocket selected, connect to the same endpoint, and start sensing without a broker. Choose MQTT only when you need Home Assistant, automation, a remote broker, or multiple devices. MQTT Monitor requires a browser-compatible WebSocket listener.

Tune from the MQTT shell

Run the shell on your computer with the broker address. It selects a single device automatically or presents a menu when several devices are online. Use help to see the available commands, then adjust the motion threshold or start a new calibration:

./espectre mqtt --broker 192.168.1.20
espectre> help
espectre> set_threshold 0.35
espectre> recalibrate

For a reproducible integrator image, Native also supports build-time Wi-Fi and MQTT defaults through its ESP-IDF Kconfig surface. Keep generated sdkconfig files and credentials local; the Native reference owns those options.

Step 4 — Let it calibrate, then test

The movement level is a 0.0–1.0 score specific to your room. If the sensor is too eager or too lazy, adjust the threshold slightly instead of expecting one universal value: the detection guide explains what the score represents.

Troubleshooting

No serial port appears

  • Try another USB cable; charge-only cables are a common cause.
  • Try another USB port, ideally directly on the computer.
  • Hold BOOT while plugging in, then retry Connect.

Flashing starts but fails midway

  • Close other tabs or programs using the port and retry.
  • Use a rear USB port or a powered hub: unstable power interrupts flashing.
  • Retry with Erase enabled to start from a clean flash.

The installer says the board is not supported

  • The connected chip has no published image for the selected firmware and channel.
  • The Flash page lists the chips that currently have firmware.
  • ESP32-S2 is available for ESPHome and Native, but not Matter; other variants outside the listed matrix cannot be flashed from the browser.

Device will not join Wi-Fi

  • Confirm that the selected band is available. Configure exposes 5 GHz and automatic selection only on capable ESP32-C5 devices, and a band change requires a restart.
  • Re-enter the exact SSID and password: both are case-sensitive.
  • Move the board closer to the access point for the first join.

Native Direct cannot find a previously configured device

  • Try its stable espectre-<device_id>.local hostname, then check the router lease table for its current address.
  • Forget the stale endpoint in Configure or Monitor before entering the current IP address or hostname.
  • Grant local-network access only to the ESPectre portal in a supported browser; an Origin or mixed-content error means that browser path is not available.

Native recovery or rollback is required

  • Hold BOOT for 3 seconds to clear saved Wi-Fi, then repeat Improv Serial provisioning over USB.
  • Reflash the full factory image when OTA cannot complete; this path does not require MQTT or the original browser profile.
  • Use an older factory image only when that release's migration notes explicitly allow the downgrade, and erase flash when its persisted configuration is incompatible.

Matter commissioning times out

  • Keep the phone within a meter of the board while pairing.
  • Make sure the phone's Bluetooth is on and the board is powered.
  • Power-cycle the board to reopen the commissioning window, then retry.

Native MQTT or Home Assistant discovery is missing

  • Check broker host, port, and credentials in Configure or Monitor.
  • Confirm Home Assistant and the device use the same broker.
  • Use Monitor and expand its Diagnostics section to verify telemetry; discovery config should also appear as retained topics under homeassistant/.