mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 03:49:13 +03:00
Исправил баг с обновлением по воздуху
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
;To choose board please use one of definition:
|
;To choose board please use one of definition:
|
||||||
;esp8266_1mb , esp8266_4mb , esp32_4mb
|
;esp8266_1mb , esp8266_4mb , esp32_4mb
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = esp8266_1mb
|
default_envs = esp8266_4mb
|
||||||
|
|
||||||
|
|
||||||
[common_env_data]
|
[common_env_data]
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#include "Upgrade.h"
|
|
||||||
|
|
||||||
#include "FileSystem.h"
|
|
||||||
|
|
||||||
#include "Class/NotAsync.h"
|
#include "Class/NotAsync.h"
|
||||||
|
#include "FileSystem.h"
|
||||||
|
#include "Upgrade.h"
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
#include "ESP8266.h"
|
#include "ESP8266.h"
|
||||||
#else
|
#else
|
||||||
@@ -45,12 +43,10 @@ void getLastVersion() {
|
|||||||
#endif
|
#endif
|
||||||
if (tmp == "error") {
|
if (tmp == "error") {
|
||||||
lastVersion = -1;
|
lastVersion = -1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lastVersion = tmp.toInt();
|
lastVersion = tmp.toInt();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lastVersion = -2;
|
lastVersion = -2;
|
||||||
}
|
}
|
||||||
jsonWriteInt(configSetupJson, "last_version", lastVersion);
|
jsonWriteInt(configSetupJson, "last_version", lastVersion);
|
||||||
@@ -97,7 +93,7 @@ bool upgradeFS() {
|
|||||||
Serial.printf("Start upgrade %s, please wait...", FS_NAME);
|
Serial.printf("Start upgrade %s, please wait...", FS_NAME);
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
ESPhttpUpdate.rebootOnUpdate(false);
|
ESPhttpUpdate.rebootOnUpdate(false);
|
||||||
t_httpUpdate_return retFS = ESPhttpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp8266/") + FS_NAME + "/"+ FS_NAME+ ".bin");
|
t_httpUpdate_return retFS = ESPhttpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp8266/littlefs/littlefs.bin"));
|
||||||
#else
|
#else
|
||||||
httpUpdate.rebootOnUpdate(false);
|
httpUpdate.rebootOnUpdate(false);
|
||||||
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp32/littlefs/spiffs.bin"));
|
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp32/littlefs/spiffs.bin"));
|
||||||
|
|||||||
Reference in New Issue
Block a user