ESP8266远程OTA升级
2024-10-19 23:36:36
https://blog.csdn.net/xh870189248/article/details/80095139
https://www.wandianshenme.com/play/arduino-ota-arduino-ide-ota-upgrade-esp8266-application/
我这里详细地说下这里包含了啥信息!
由下面可得,不同的8266模块,其外部falsh大小决定了编译时候的user.bin路径,所以大家在此OTA升级,必须要摸清楚你买的模块是哪个falsh大小的,注意1M = 8Mbit!!!安信可的 32Mbit 其实就是 4M的falsh,类似 25Q32这样的存储芯片。
server.on("/", HTTP_GET, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", serverIndex);
});
server.on("/update", HTTP_POST, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
ESP.restart();
}, []() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
Serial.setDebugOutput(true);
WiFiUDP::stopAll();
Serial.printf("Update: %s\n", upload.filename.c_str());
uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
if (!Update.begin(maxSketchSpace)) { //start with max available size
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_WRITE) {
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
} else {
Update.printError(Serial);
}
Serial.setDebugOutput(false);
}
yield();
});
最新文章
- CentOS 伪装安装TSA for DB2
- PHP导出CSV UTF-8转GBK不乱码的解决办法
- java动态代理(JDK和cglib)
- 如何解除Windows XP的IIS连接数限制
- Silverlight形状、画笔、变换、图像处理、几何图形
- wamp下修改mysql root用户的登录密码
- 使用MATLAB生成模糊控制的离线查询表
- Hadoop集群(第5期副刊)_JDK和SSH无密码配置
- python运维开发之第五天
- centos7安装codeblocks教程
- next_permutation(全排列算法)
- css常用居中
- SQL Server事务遭遇网络异常时的处理机制浅析
- wkt转换geojson
- CentOS恢复系统启动grub1.5,2阶段
- CSS 使用absolute 是<;div>;居中
- Android逆向破解表单登录程序
- Linux:常用命令【转载】
- Python之Pandas知识点
- 奔跑吧DKY——团队Scrum冲刺阶段-Day 3