ESP8266 代码
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>
#define USE_SERIAL Serial
const char* ssid = "hhahhah";//填上wifi账号
const char* password = "hahahh";//填上wifi密码
ESP8266WiFiMulti WiFiMulti;
void setup() {
USE_SERIAL.begin(115200);
// USE_SERIAL.setDebugOutput(true);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
for(uint8_t t = 4; t > 0; t--) {
USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
USE_SERIAL.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP(ssid, password);
}
void loop() {
// wait for WiFi connection
if((WiFiMulti.run() == WL_CONNECTED)) {
t_httpUpdate_return ret = ESPhttpUpdate.update("http://192.168.1.5/api/health/check_update"); // 编译好的固件文件
USE_SERIAL.println("************* s

本文介绍了如何利用django框架建立一个webserver,实现ESP8266设备通过HTTP进行Over-the-Air (OTA)固件更新。参考了多个资料,包括官方文档和社区教程,为ESP8266的自动更新提供了详细步骤。
最低0.47元/天 解锁文章
1048

被折叠的 条评论
为什么被折叠?



