Open annak1n opened 4 years ago
Hi Can u help me.. I try to use u code.. But if i upload new version on the server esp32 all time restart..
Hello, that happens because current firmware binary files include this lines "esp32-arduino-lib-builder�������18:44:35��������Jan 20 2020�����v3.3.1" and that v3.3.1 confuses the server.py script when parsing the uploaded file version. It's an easy fix tho.
And how i can fix it ?
This my Code:
#include <HTTPClient.h>
#include <HTTPUpdate.h>
#include <WiFi.h>
#define VERSION "v1.0.7"
#define HOST "Chase"
const char *urlBase = "http://192.168.178.5:5000/update";
void setup()
{
Serial.begin(115200);
WiFi.begin("SSID", "PASSWD");
}
void loop ()
{
if ((WiFi.status() == WL_CONNECTED)) {
String checkUrl = String(urlBase);
checkUrl.concat("?ver=" + String(VERSION));
checkUrl.concat("&dev=" + String(HOST));
Serial.println("INFO: Checking for updates at URL: " + String(checkUrl));
WiFiClient client;
t_httpUpdate_return ret = httpUpdate.update(client, checkUrl);
switch (ret)
{
default:
case HTTP_UPDATE_FAILED:
Serial.println("ERROR: HTTP_UPDATE_FAILD Error (" + String(httpUpdate.getLastError()) + "): " + httpUpdate.getLastErrorString().c_str());
break;
case HTTP_UPDATE_NO_UPDATES:
Serial.println("INFO: HTTP_UPDATE_NO_UPDATES");
break;
case HTTP_UPDATE_OK:
Serial.println("INFO status: HTTP_UPDATE_OK");
break;
}
}
}
And This Console Log: rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5828 entry 0x400806ac INFO: Checking for updates at URL: http://192.168.178.5:5000/update?ver=v1.0.7&dev=Chase abort() was called at PC 0x40130059 on core 1
Backtrace: 0x4008e8b0:0x3ffb1c10 0x4008eae1:0x3ffb1c30 0x40130059:0x3ffb1c50 0x40089593:0x3ffb1c70 0x400d39a9:0x3ffb1c90 0x40136190:0x3ffb1cb0 0x40136428:0x3ffb1cd0 0x400d2f3e:0x3ffb1cf0 0x400d3592:0x3ffb1d40 0x400d382e:0x3ffb1e30 0x400d13cb:0x3ffb1ee0 0x400d5af5:0x3ffb1fb0 0x4008aff9:0x3ffb1fd0
Rebooting... ets Jun 8 2016 00:22:57
Hi Can u help me.. I try to use u code.. But if i upload new version on the server esp32 all time restart..