我有很多 ESP32 设备分发给我的客户端,但手动更新代码并不容易。 最好的办法是让Arduino通过http下载(通过指令).bin文件并使用OTA自行更新。 谁能给我一个代码示例
谢谢你
这里有一些教程的链接,可以满足您的需求。
Renzo Mischianti 的一些教程。
“使用受信任的自签名证书在 HTTPS (SSL/TLS) 中进行 ESP32 自 OTA 更新 – 3” https://mischianti.org/esp32-self-ota-update-in-https-ssl-tls-with-trusted-self-signed-certificate-3/
“使用 FTP 客户端更新 ESP32 固件和文件系统 – 2” https://mischianti.org/esp32-firmware-and-filesystem-update-with-ftp-client-2/
另一个例子是 ESP8266/ESP32 的 AutoConnect 库 在“OTA 更新”->“使用更新服务器的 OTA”部分中 https://hieromon.github.io/AutoConnect/otaupdate.html
最后是 Espressif Arduino-esp32 更新库示例: https://github.com/espressif/arduino-esp32/tree/master/libraries/Update/examples https://hieromon.github.io/AutoConnect/otaserver.html