ESP32 OTA & Gestion du Firmware

VérifiéSûr

Permet de gérer le firmware des ESP32 via l'interface web du workbench : téléversement, liste et suppression de binaires. Déclenche des mises à jour OTA sur les appareils connectés au WiFi, idéal pour le développement itératif sans bloquer le port série.

Spar Skills Guide Bot
DeveloppementIntermédiaire
8002/06/2026
Claude Code
#ota#firmware#esp32#over-the-air-update#workbench

Recommandé pour

Notre avis

Cette compétence gère les mises à jour de firmware par liaison radio (OTA) pour un poste de travail ESP32, incluant le téléversement, la liste, la suppression de fichiers firmware et le déclenchement des mises à jour OTA sur les appareils.

Points forts

  • Permet un développement itératif sans bloquer le port série
  • Propose un workflow complet du téléversement au suivi
  • Inclut des conseils de dépannage pour les problèmes courants
  • Supporte à la fois le relais HTTP et le suivi des logs UDP

Limites

  • Nécessite que l'appareil supporte l'OTA et soit connecté au réseau
  • Ne peut pas flasher les bootloaders ou les tables de partition
  • Dépend d'une adresse IP fixe du poste de travail (192.168.0.87)
Quand l'utiliser

Utilisez-la lorsque vous devez mettre à jour le firmware d'un ESP32 qui exécute déjà un firmware compatible OTA et se trouve sur le même réseau que le poste de travail.

Quand l'éviter

Ne l'utilisez pas si l'appareil est brické, ne supporte pas l'OTA, ou si vous devez flasher des composants de bas niveau du firmware.

Analyse de sécurité

Sûr
Score qualité92/100

The skill instructs HTTP requests (curl) to a local workbench server for legitimate OTA firmware management. No destructive commands, exfiltration, or obfuscation beyond trivial base64 encoding for payload transmission. Risks are minimal as all actions target the user's own devices and network.

Aucun point d'attention détecté

Exemples

Upload firmware to workbench
Upload the firmware binary from build/firmware.bin to the ESP32 workbench for project 'sensor-v2'.
Trigger OTA update on an ESP32
Trigger an OTA update on the ESP32 at http://192.168.4.2/ota with firmware URL http://192.168.0.87:8080/firmware/sensor-v2/firmware.bin and monitor the progress via UDP logs.
List and delete firmware files
List all firmware files uploaded to the workbench, then delete the file named 'old-firmware.bin' from project 'sensor-v2'.

name: esp32-workbench-ota description: OTA firmware upload, listing, deletion, and over-the-air update for the Universal ESP32 Workbench. Triggers on "OTA", "firmware", "update", "upload", "binary", "over-the-air".

ESP32 OTA & Firmware Repository

Base URL: http://192.168.0.87:8080

When to Use OTA (vs Serial Flashing)

Use OTA when:

  • Device already runs firmware with an OTA HTTP endpoint
  • Device is on the WiFi network (connected to workbench's AP or same LAN)
  • You want to update firmware without blocking the serial port
  • You're doing iterative development (build → upload → trigger → monitor cycle)

Do NOT use OTA when:

  • Device is blank/bricked — use serial flashing (see esp32-workbench-serial-flashing)
  • Device firmware has no OTA support — use serial flashing
  • Device has no WiFi connectivity — use serial flashing
  • You need to flash a bootloader or partition table — only esptool can do this

Endpoints

| Method | Path | Purpose | |--------|------|---------| | POST | /api/firmware/upload | Upload firmware binary (multipart/form-data) | | GET | /api/firmware/list | List all uploaded firmware files | | DELETE | /api/firmware/delete | Delete a firmware file | | GET | /firmware/<project>/<file> | Download URL (ESP32 fetches from here during OTA) |

End-to-End OTA Workflow

Step 1: Upload firmware to workbench

curl -X POST http://192.168.0.87:8080/api/firmware/upload \
  -F "project=my-project" \
  -F "file=@build/firmware.bin"

Response: {"ok": true, "project": "my-project", "filename": "firmware.bin", "size": 456789}

Step 2: Verify upload

curl -s http://192.168.0.87:8080/api/firmware/list | jq .

Step 3: Ensure device is on the network

The device must be able to reach http://192.168.0.87:8080. Use enter-portal to provision if needed (see esp32-workbench-wifi).

Step 4: Clear UDP log buffer (for clean monitoring)

curl -X DELETE http://192.168.0.87:8080/api/udplog

Step 5: Trigger OTA on the ESP32 via HTTP relay

OTA_BODY=$(echo -n '{"url":"http://192.168.0.87:8080/firmware/my-project/firmware.bin"}' | base64)

curl -X POST http://192.168.0.87:8080/api/wifi/http \
  -H 'Content-Type: application/json' \
  -d "{\"method\": \"POST\", \"url\": \"http://192.168.4.2/ota\", \"headers\": {\"Content-Type\": \"application/json\"}, \"body\": \"$OTA_BODY\", \"timeout\": 30}"

Step 6: Monitor OTA progress

# Via UDP logs (preferred — non-blocking)
curl "http://192.168.0.87:8080/api/udplog?limit=50"

# Or via serial monitor (see esp32-workbench-logging)
curl -X POST http://192.168.0.87:8080/api/serial/monitor \
  -H 'Content-Type: application/json' \
  -d '{"slot": "slot-1", "pattern": "OTA.*complete", "timeout": 60}'

Managing Firmware Files

# List all uploaded firmware
curl http://192.168.0.87:8080/api/firmware/list

# Delete a firmware file
curl -X DELETE http://192.168.0.87:8080/api/firmware/delete \
  -H 'Content-Type: application/json' \
  -d '{"project": "my-project", "filename": "firmware.bin"}'

# The download URL for ESP32 to fetch:
# http://192.168.0.87:8080/firmware/<project>/<filename>

Troubleshooting

| Problem | Fix | |---------|-----| | Upload returns "expected multipart/form-data" | Use -F flags (not -d) for multipart upload | | File not in list after upload | Check project/filename; .. and / are rejected | | ESP32 can't download firmware | Device must reach workbench at 192.168.0.87:8080; check WiFi | | OTA trigger times out | Check device's OTA endpoint URL; increase HTTP relay timeout | | No progress in UDP logs | Device may not send UDP logs — check serial monitor instead (see esp32-workbench-logging) | | OTA trigger returns error | Verify device firmware has OTA endpoint; check relay response body |

Skills similaires