浏览代码

update demo/ota/esp32/main.lua.

Signed-off-by: Wendal <wendal1985@gmail.com>
Wendal 2 年之前
父节点
当前提交
1e357183c7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      demo/ota/esp32/main.lua

+ 1 - 1
demo/ota/esp32/main.lua

@@ -18,7 +18,7 @@ function ota_task()
         local dst_path = "/update.bin"
         os.remove(dst_path)
         local url = "http://site0.cn/api/esp32/ota?mac=" .. wlan.getMac()
-        local code = http.request("GET", url, nil, nil, {dst=dst_path})
+        local code = http.request("GET", url, nil, nil, {dst=dst_path}).wait()
         if code and code == 200 then
             log.info("ota", "OTA 下载完成, 3秒后重启")
             sys.wait(3000)