Flash the ESP32-CAM
This guide walks through flashing the SmartPot firmware onto an ESP32-CAM module for the submerged vision unit.
Prerequisites
Section titled “Prerequisites”- ESP32-CAM (Ai-Thinker) module
- USB-to-serial adapter (FTDI FT232RL or CP2102)
- Jumper wires
- USB cable
- Computer with Arduino IDE or PlatformIO installed
Wiring
Section titled “Wiring”The ESP32-CAM doesn’t have a built-in USB port. Connect a USB-to-serial adapter:
| USB-Serial | ESP32-CAM |
|---|---|
| 3V3 | 3V3 |
| GND | GND |
| TX | U0R (GPIO3) |
| RX | U0T (GPIO1) |
For flashing mode: Connect IO0 to GND before powering on. This puts the ESP32 into bootloader mode. Remove the IO0-to-GND connection after flashing and press RESET to boot normally.
flowchart TD subgraph ser["USB-Serial Adapter"] S_3V3["3V3"] S_GND["GND"] S_TX["TX"] S_RX["RX"] end
subgraph cam["ESP32-CAM (Ai-Thinker)"] C_3V3["3V3"] C_GND["GND"] C_RX["U0R (GPIO3)"] C_TX["U0T (GPIO1)"] C_IO0["IO0"] end
S_3V3 --- C_3V3 S_GND --- C_GND S_TX --- C_RX S_RX --- C_TX C_IO0 -. "GND during flash" .-> C_GND
style ser fill:#e6f3f0,stroke:#2d7d6f style cam fill:#f0f4f8,stroke:#4a6785Install ESP32 Board Support
Section titled “Install ESP32 Board Support”Arduino IDE
Section titled “Arduino IDE”- Open File → Preferences
- Add to Additional Board Manager URLs:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Open Tools → Board → Board Manager
- Search for “esp32” and install esp32 by Espressif Systems
- Select Tools → Board → AI Thinker ESP32-CAM
PlatformIO
Section titled “PlatformIO”; platformio.ini[env:esp32cam]platform = espressif32board = esp32camframework = arduinomonitor_speed = 115200upload_speed = 921600Flash the Firmware
Section titled “Flash the Firmware”- Connect GPIO0 to GND (flash mode jumper)
- Connect USB-serial adapter to computer
- Power on the ESP32-CAM
- Select the correct COM/serial port
- Click Upload (Arduino IDE) or run
pio run -t upload(PlatformIO) - Wait for upload to complete (progress bar shows percentage)
- Remove the GPIO0-to-GND jumper
- Press the RESET button on the ESP32-CAM
Verify
Section titled “Verify”Open the serial monitor at 115200 baud. You should see:
SmartPot Submerged Unit v0.1Camera initialized: OV2640TFLite model loaded: species_v1.tfliteServo initialized: door UNLOCKEDWaiting for tether connection...Next Steps
Section titled “Next Steps”- Load the species classification model (see Train the Species Model)
- Connect to the smart buoy via tether cable
- Configure keeper thresholds for your target species