mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
исправил баг обновления по воздуху
This commit is contained in:
@@ -92,20 +92,18 @@ void restartEsp() {
|
||||
|
||||
const String getBinPath(String file) {
|
||||
String path = "error";
|
||||
if (file != "") {
|
||||
int targetVersion = 0;
|
||||
String serverip;
|
||||
if (jsonRead(errorsHeapJson, F("chver"), targetVersion)) {
|
||||
if (targetVersion >= 400) {
|
||||
if (jsonRead(settingsFlashJson, F("serverip"), serverip)) {
|
||||
if (serverip != "") {
|
||||
path = jsonReadStr(settingsFlashJson, F("serverip")) + "/iotm/" + String(FIRMWARE_NAME) + "/" + String(targetVersion) + "/" + file;
|
||||
}
|
||||
int targetVersion = 0;
|
||||
String serverip;
|
||||
if (jsonRead(errorsHeapJson, F("chver"), targetVersion)) {
|
||||
if (targetVersion >= 400) {
|
||||
if (jsonRead(settingsFlashJson, F("serverip"), serverip)) {
|
||||
if (serverip != "") {
|
||||
path = jsonReadStr(settingsFlashJson, F("serverip")) + "/iotm/" + String(FIRMWARE_NAME) + "/" + String(targetVersion) + "/" + file;
|
||||
}
|
||||
}
|
||||
}
|
||||
SerialPrint("i", F("Update"), "path: " + path);
|
||||
}
|
||||
SerialPrint("i", F("Update"), "path: " + path);
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user