| title | OTA Updates | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| summary | Over-The-Air firmware update guide for the ESP32 Pool Controller — WebUI upload, GitHub Release auto-updates, PlatformIO serial flashing, and security best practices | ||||||||
| date | 2026-06-07 | ||||||||
| lastmod | 2026-06-07 | ||||||||
| draft | false | ||||||||
| toc | true | ||||||||
| type | docs | ||||||||
| tags |
|
||||||||
| menu |
|
The Pool Controller supports Over-The-Air (OTA) firmware updates, allowing you to update the device remotely without physical access to the hardware.
- WebUI firmware upload: Flash a signed
.binvia the dashboard - GitHub Release updates: Check for new versions and install automatically
- PlatformIO serial upload: Flash via USB for development
- Status feedback: Progress indication via WebUI + MQTT
The simplest method — no tools needed beyond a web browser:
- Open the Pool Controller dashboard in your browser
- Go to System tab
- Choose one of:
- Manual Firmware Upload: Select a
.binfile and flash - Check for Updates: Automatically fetches latest release from GitHub
- Manual Firmware Upload: Select a
- Follow the progress bar — device reboots when done
Firmware is built and published automatically on each GitHub release:
- In the System tab, click Check for Updates
- If a newer version is found, Install Update appears
- Click to download and flash the latest firmware directly from GitHub
- Progress is shown in the UI; device reboots on completion
For development:
# Build and upload via USB
pio run -e esp32dev --target upload
# Or with project venv
./venv/bin/pio run -e esp32dev --target upload# Build firmware without uploading
pio run -e esp32dev
# Binary location
.pio/build/esp32dev/firmware.bin- Use WPA2/WPA3 Wi-Fi encryption
- Isolate IoT devices on separate VLAN if possible
- Only flash firmware from trusted sources (official GitHub releases)
- Verify firmware builds before uploading to production
- Test on development device first
- Keep backup of working firmware version
Problem: Upload fails with timeout error
Solutions:
- Verify device is online:
ping pool-controller.local - Ensure device has sufficient free memory (>50KB)
- Try increasing timeout in
upload_flags
Problem: Device not visible in network ports
Solutions:
- Check mDNS is working:
avahi-browse -a(Linux) or Bonjour (Windows) - Use IP address instead of mDNS hostname
- Restart device and wait for Wi-Fi connection
- Check device is on same network/subnet
Problem: Upload completes but device doesn't reboot or run new firmware
Solutions:
- Check serial console for boot errors
- Verify firmware was built for correct platform (ESP32)
- Ensure firmware size fits in flash memory
- Check for memory issues in serial log
- Perform manual reboot
Problem: OTA fails due to insufficient memory
Solutions:
- Free memory is critical for OTA
- System monitor will prevent OTA if memory < 8KB
- Reboot device before OTA attempt
- Reduce logging during update
- WebUI OR GitHub: User triggers update via dashboard or automated check
- Firmware Download: Binary fetched from local upload or GitHub release
- Flash Writing: New firmware written to OTA partition (ESP32 Update library)
- Verification: Firmware signature and integrity checked
- Reboot: Automatic restart with new firmware
- ESP32: Minimum 100KB free heap for OTA
- Flash: Sufficient space for dual boot partitions
The project uses PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY flag to optimize
network stack memory usage, ensuring reliable OTA updates.
OTA progress is visible in the WebUI progress bar and via serial console.
# PlatformIO monitor
pio device monitor
# Look for log messages
[OTA] Start
[OTA] Progress: 25%
[OTA] Progress: 50%
[OTA] Progress: 75%
[OTA] SuccessIf OTA update fails and device becomes unresponsive:
-
Physical Access Recovery:
- Connect via USB serial
- Upload firmware via serial:
pio run -e esp32dev --target upload
-
Bootloader Recovery:
- ESP32 bootloader allows serial recovery
- Hold BOOT button during power-on
- Upload firmware via esptool
-
Factory Reset:
- In WebUI: System tab → Factory Reset
- Or serial command: clear NVS + LittleFS
- Web-based OTA update interface (System tab)
- Automatic update checking from GitHub releases
- Rollback capability to previous firmware
- A/B partition updates for safer updates
- Update scheduling via MQTT commands
For OTA-related issues:
- Open issue: https://github.com/smart-swimmingpool/pool-controller/issues
- Discussions: https://github.com/smart-swimmingpool/smart-swimmingpool.github.io/discussions
Note: OTA is implemented using the ESP32 Arduino Update library integrated
into the WebPortal. GitHub release builds are handled by the CI pipeline
(release.yml).