Skip to content

Flashing Your Device

Download the latest release from GitHub Releases and flash your ESP32 over USB. You only need to do this once — after that you can update over WiFi.


What's in a Release

Each release ships three binaries:

File When to use
sqmeter-complete-flash-vX.Y.Z.bin Fresh ESP32 — everything in one file
sqmeter-firmware-vX.Y.Z.bin OTA update via web UI
sqmeter-littlefs-vX.Y.Z.bin Web UI update only

For a brand-new device, you only need sqmeter-complete-flash-*.bin.


Prerequisites

Install esptool:

pip install esptool

One command, one file. Flashes bootloader, partition table, firmware, and web UI filesystem all at once:

esptool.py --chip esp32 --port PORT --baud 115200 \
  write_flash 0x0 sqmeter-complete-flash-v0.0.1.bin

Replace PORT with your serial port:

/dev/cu.usbserial-*   # macOS
/dev/ttyUSB0          # Linux
COM3

Finding your port

esptool.py --chip esp32 chip_id
esptool will scan and print the detected port.

Standard or Bluetooth build?

Each release has two builds:

Build Files Choose it if
Standard sqmeter-complete-flash-*.bin, sqmeter-firmware-*.bin You don't need Bluetooth - recommended
Bluetooth sqmeter-ble-complete-flash-*.bin, sqmeter-ble-firmware-*.bin You want the phone alarm or BLE broadcasts (Bluetooth)

The Bluetooth build uses a different partition layout, so the first install has to be a USB flash of sqmeter-ble-complete-flash-*.bin at 0x0, as above. After that it updates over the web UI like the standard build. Going back to the standard build is also a USB flash.


Selective Updates (Existing Devices)

Prefer OTA updates from the web UI — no cable needed. But if you need USB:

Firmware only

esptool.py --chip esp32 --port PORT --baud 115200 \
  write_flash 0x10000 sqmeter-firmware-v0.0.1.bin

Web UI filesystem only

esptool.py --chip esp32 --port PORT --baud 115200 \
  write_flash 0x310000 sqmeter-littlefs-v0.0.1.bin

On the Bluetooth build the firmware goes to 0x10000 too, but the web UI filesystem lives at 0x380000.

NVS is safe

Firmware and filesystem updates never touch the NVS partition where your WiFi credentials and settings are stored.


Flash Memory Map

Partition Offset Size Contents
nvs 0x9000 20 KB WiFi credentials, settings
otadata 0xe000 8 KB OTA boot slot indicator
app0 0x10000 1.5 MB Firmware
app1 0x190000 1.5 MB OTA update slot
spiffs 0x310000 512 KB Web UI (LittleFS)