mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 15:42:20 +03:00
247
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "h4",
|
"type": "h4",
|
||||||
"title": "LittleFS version: 246"
|
"title": "LittleFS version: 247"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "hr"
|
"type": "hr"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
//=================Firmeare=================
|
//=================Firmeare=================
|
||||||
#define FIRMWARE_NAME "esp8266-iotm"
|
#define FIRMWARE_NAME "esp8266-iotm"
|
||||||
#define FIRMWARE_VERSION 246
|
#define FIRMWARE_VERSION 247
|
||||||
#define FLASH_4MB true
|
#define FLASH_4MB true
|
||||||
|
|
||||||
//=================System===================
|
//=================System===================
|
||||||
|
|||||||
@@ -40,12 +40,33 @@ void getLastVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void upgrade_firmware(int type) {
|
void upgrade_firmware(int type) {
|
||||||
|
String scenario_ForUpdate;
|
||||||
|
String devconfig_ForUpdate;
|
||||||
|
String configSetup_ForUpdate;
|
||||||
|
|
||||||
|
scenario_ForUpdate = readFile(String(DEVICE_SCENARIO_FILE), 4000);
|
||||||
|
devconfig_ForUpdate = readFile(String(DEVICE_CONFIG_FILE), 4000);
|
||||||
|
configSetup_ForUpdate = configSetupJson;
|
||||||
|
|
||||||
if (type == 1) { //only build
|
if (type == 1) { //only build
|
||||||
if (upgradeBuild()) restartEsp();
|
if (upgradeBuild()) restartEsp();
|
||||||
} else if (type == 2) { //only spiffs
|
}
|
||||||
if (upgradeFS()) restartEsp();
|
|
||||||
} else if (type == 3) { //spiffs and build
|
else if (type == 2) { //only spiffs
|
||||||
if (upgradeFS()) {
|
if (upgradeFS()) {
|
||||||
|
writeFile(String(DEVICE_SCENARIO_FILE), scenario_ForUpdate);
|
||||||
|
writeFile(String(DEVICE_CONFIG_FILE), devconfig_ForUpdate);
|
||||||
|
writeFile("config.json", configSetup_ForUpdate);
|
||||||
|
restartEsp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (type == 3) { //spiffs and build
|
||||||
|
if (upgradeFS()) {
|
||||||
|
writeFile(String(DEVICE_SCENARIO_FILE), scenario_ForUpdate);
|
||||||
|
writeFile(String(DEVICE_CONFIG_FILE), devconfig_ForUpdate);
|
||||||
|
writeFile("config.json", configSetup_ForUpdate);
|
||||||
|
saveConfig();
|
||||||
if (upgradeBuild()) {
|
if (upgradeBuild()) {
|
||||||
restartEsp();
|
restartEsp();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user