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();
});

  

最新文章

  1. CentOS 伪装安装TSA for DB2
  2. PHP导出CSV UTF-8转GBK不乱码的解决办法
  3. java动态代理(JDK和cglib)
  4. 如何解除Windows XP的IIS连接数限制
  5. Silverlight形状、画笔、变换、图像处理、几何图形
  6. wamp下修改mysql root用户的登录密码
  7. 使用MATLAB生成模糊控制的离线查询表
  8. Hadoop集群(第5期副刊)_JDK和SSH无密码配置
  9. python运维开发之第五天
  10. centos7安装codeblocks教程
  11. next_permutation(全排列算法)
  12. css常用居中
  13. SQL Server事务遭遇网络异常时的处理机制浅析
  14. wkt转换geojson
  15. CentOS恢复系统启动grub1.5,2阶段
  16. CSS 使用absolute 是<div>居中
  17. Android逆向破解表单登录程序
  18. Linux:常用命令【转载】
  19. Python之Pandas知识点
  20. 奔跑吧DKY——团队Scrum冲刺阶段-Day 3

热门文章

  1. Java IO模型
  2. 如何将视频导入到ipad中并播放
  3. 开源库支付库Magicodes.Pay发布
  4. [十九]JavaIO之PipedReader 和 PipedWriter
  5. Python SQLalchemy的学习与使用
  6. SpringMVC集成rabbitmq:优化秒杀下单环节
  7. xshell连接虚拟机详解--技术流ken
  8. Docker安装nginx
  9. Java开发笔记(十)一元运算符的技巧
  10. WordPress在Centos下Apache设置伪静态方法