Flashing the Firmware
This guide explains how to flash (upload) the compiled firmware to your ESP32 device.
Connect Your ESP32
Section titled “Connect Your ESP32”- Connect your ESP32 to your computer via USB
- The device should appear as a serial port:
- Windows:
COM3,COM4, etc. - macOS:
/dev/cu.usbserial-*or/dev/cu.SLAB_USBtoUART - Linux:
/dev/ttyUSB0or/dev/ttyACM0
- Windows:
Installing Drivers
Section titled “Installing Drivers”If your ESP32 isn’t detected, you may need to install USB-to-serial drivers:
- CP2102 chip: Silicon Labs drivers
- CH340 chip: CH340 drivers
Flashing
Section titled “Flashing”Using VS Code
Section titled “Using VS Code”- Open the project in VS Code with PlatformIO
- Click the Upload button (right arrow icon) in the bottom toolbar
- PlatformIO will automatically detect the port and upload
Using Command Line
Section titled “Using Command Line”cd blinqr-firmwarepio run --target uploadSpecifying a Port
Section titled “Specifying a Port”If automatic detection fails:
pio run --target upload --upload-port /dev/cu.usbserial-0001Expected Output
Section titled “Expected Output”Connecting........_Chip is ESP32-D0WDQ6 (revision 1)Features: WiFi, BT, Dual Core, 240MHzUploading stub...Running stub...Stub running...Changing baud rate to 921600Changed.Configuring flash size...Writing at 0x00001000... (100 %)Writing at 0x00008000... (100 %)Writing at 0x0000e000... (100 %)Writing at 0x00010000... (100 %)Wrote 819200 bytes in 10.2 seconds (643.2 kbit/s)Hash of data verified.Verify the Upload
Section titled “Verify the Upload”Monitor Serial Output
Section titled “Monitor Serial Output”pio device monitorOr use the VS Code PlatformIO Serial Monitor.
Expected Startup Messages
Section titled “Expected Startup Messages”=================================blinqr Reminder Box - Starting...=================================
[Main] Initializing hardware... LED 0 -> GPIO 2 LED 1 -> GPIO 4 LED 2 -> GPIO 5 LED 3 -> GPIO 18 LED 4 -> GPIO 19 BTN 0 -> GPIO 12 BTN 1 -> GPIO 13 BTN 2 -> GPIO 14 BTN 3 -> GPIO 27 BTN 4 -> GPIO 26[HwController] Initialization complete
[Main] Initializing BLE...[BLE] Initializing NimBLE...[BLE] Service created and started Service UUID: 12340001-0000-1000-8000-00805F9B34FB reminder_state UUID: 12340002-0000-1000-8000-00805F9B34FB button_events UUID: 12340003-0000-1000-8000-00805F9B34FB
[Main] Starting BLE advertising...[BLE] Advertising started
[Main] Ready! Waiting for connections...Troubleshooting
Section titled “Troubleshooting””A fatal error occurred: Failed to connect”
Section titled “”A fatal error occurred: Failed to connect””- Hold the BOOT button on your ESP32 while uploading
- Release after “Connecting…” appears
- Some boards require this for initial flash
”Permission denied” (Linux/macOS)
Section titled “”Permission denied” (Linux/macOS)”Add your user to the dialout group:
# Linuxsudo usermod -a -G dialout $USER
# macOSsudo dseditgroup -o edit -a $USER -t user adminLog out and back in for changes to take effect.
”Port is busy”
Section titled “”Port is busy””Close any other applications using the serial port (Arduino IDE, other terminals, etc.).
Upload succeeds but device doesn’t work
Section titled “Upload succeeds but device doesn’t work”- Check serial monitor for error messages
- Verify wiring matches pin configuration
- Try a full erase and re-flash:
pio run --target erasepio run --target uploadNext Steps
Section titled “Next Steps”After successfully flashing:
- Open the mobile app
- Go to the Device tab
- Tap “Connect” to pair with your blinqr device
- Test LEDs and buttons using the simulator (in dev mode) or scheduled reminders