firmware update progress

This commit is contained in:
Bogdan Pilyugin 2023-01-23 16:51:09 +02:00
parent 9e9ee84ab2
commit 219acd010d
7 changed files with 418 additions and 405 deletions

View File

@ -7,5 +7,8 @@
"mqtt2st":"~mqtt2st~",
"defadp":"~defadp~",
"freeram":"~freeram~",
"minram":"~minram~"
"minram":"~minram~",
"fver":"~fver~",
"fverav":"~fverav~",
"updstat":"~updstat~"
}

View File

@ -316,6 +316,7 @@ textarea {
height: 4.0rem;
margin:auto;
vertical-align: top;
min-width: 350px;
}
.stg td{width:auto;padding:1px;margin:0}

View File

@ -40,19 +40,19 @@
<div class="mlpc">
<form name="syst" method="post">
<div class="mlhdr">FIRMWARE UPDATE</div>
<table class='cntr'><script>
PrintCheckBox('Reset config on OTA update','otarst','~otarst~',null);
PrintCheckBox('Enable OTA auto update','ota','~ota~',null);
PrintInt('Auto update check period','otaint','~otaint~',1,65534);
</script></table>
<table class='cntr'><tr><td align="center">Update firmware URL:</td></tr></table>
<table class='cntr'><tr><td><textarea type="text" raws="5" name='otaurl' title="64 символа" ">~otaurl~</textarea></td></tr>
</table><table class='cntr'>
<tr><td class='rl lab'>Current firmware version:</td><td><span id='fvr'>?</span></td></tr>
<tr><td class='rl lab'>Available firmware version:</td><td><span id='afvr'>?</span></td></tr>
<tr><td class='rl lab'>Current status:</td><td><span id='upst'>?</span></td></tr>
</table>
<table class='cntr'><script>
PrintLabel('Current firmware version:','~fver~');
PrintLabel('Available firmware version:','~fverav~');
PrintLabel('Current status:','~updstat~');
</script></table>
<button type="submit" class ='btn' name='chkfrm' value='prs'>Check manual</button>
<button type="submit" class ='btn' name='upd' value='prs'>Update manual</button>
<button type="button" class ='btn' name='upd' onclick="fwupd()">Update manual</button>
<script>PrintSaveBtn('syst'); PrintApplyBtn('syst');</script>
</form>
</div>
@ -102,10 +102,12 @@
</section>
</main>
<script>
function cmd(n)
{
function cmd(n) {
PostData("cmd="+n, "system.html",false ,false, false);
}
function fwupd() {
PostData("upd=prs", "system.html",false ,false, false);
}
showMenu('header-toggle','navbar');
</script>
</body>
@ -122,6 +124,11 @@
document.getElementById('mq2').innerHTML= dat.mqtt2st;
document.getElementById('mem').innerHTML= dat.freeram;
document.getElementById('mmem').innerHTML= dat.minram;
document.getElementById('fvr').innerHTML= dat.fver;
document.getElementById('afvr').innerHTML= dat.fverav;
document.getElementById('upst').innerHTML= dat.updstat;
}
catch(e){return;}
}

@ -1 +1 @@
Subproject commit 40ebb5d7525d154bdaa8210c1e7b065d5a137377
Subproject commit a7340c1a35cb1761827cc6648e9f170fa8a909df

View File

@ -4,6 +4,6 @@ nvs,data,nvs, 0x9000,0x8000,
otadata,data,ota, ,0x2000,
phy_init,data,phy, ,0x1000,
nvs_key,data,nvs_keys, ,0x1000,
ota_0,app,ota_0, 0x20000,0x180000,
ota_1,app,ota_1, ,0x180000,
storage,data,spiffs, ,0xD0000,
ota_0,app,ota_0, 0x20000,0x170000,
ota_1,app,ota_1, ,0x170000,
storage,data,spiffs, ,0x100000,

1 # ESP-IDF Partition Table
4 otadata,data,ota, ,0x2000,
5 phy_init,data,phy, ,0x1000,
6 nvs_key,data,nvs_keys, ,0x1000,
7 ota_0,app,ota_0, 0x20000,0x180000, ota_0,app,ota_0, 0x20000,0x170000,
8 ota_1,app,ota_1, ,0x180000, ota_1,app,ota_1, ,0x170000,
9 storage,data,spiffs, ,0xD0000, storage,data,spiffs, ,0x100000,

View File

@ -31,8 +31,8 @@ CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y
CONFIG_APP_COMPILE_TIME_DATE=y
# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set
CONFIG_APP_PROJECT_VER="0.0.0.0001"
CONFIG_APP_PROJECT_VER_FROM_CONFIG=y
CONFIG_APP_PROJECT_VER="0.0.0.6"
CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16
# end of Application manager
@ -1267,7 +1267,8 @@ CONFIG_MAIN_FUNCTIONAL_BUTTON_GPIO=15
#
# OTA settings
#
CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_ENABLE=y
# CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_ENABLE is not set
# CONFIG_WEBGUIAPP_OTA_RESET_ENABLE is not set
CONFIG_WEBGUIAPP_OTA_HOST="https://iotronic.cloud/firmware/firmware.bin"
CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_PERIOD=3600
# end of OTA settings

View File

@ -31,8 +31,8 @@ CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y
CONFIG_APP_COMPILE_TIME_DATE=y
# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set
CONFIG_APP_PROJECT_VER="0.0.0.0001"
CONFIG_APP_PROJECT_VER_FROM_CONFIG=y
CONFIG_APP_PROJECT_VER="0.0.0.5"
CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16
# end of Application manager
@ -1267,7 +1267,8 @@ CONFIG_MAIN_FUNCTIONAL_BUTTON_GPIO=15
#
# OTA settings
#
CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_ENABLE=y
# CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_ENABLE is not set
# CONFIG_WEBGUIAPP_OTA_RESET_ENABLE is not set
CONFIG_WEBGUIAPP_OTA_HOST="https://iotronic.cloud/firmware/firmware.bin"
CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_PERIOD=3600
# end of OTA settings
@ -1276,7 +1277,7 @@ CONFIG_WEBGUIAPP_OTA_AUTOUPDATE_PERIOD=3600
# SNTP client settings
#
CONFIG_WEBGUIAPP_SNTP_AUTOUPDATE_ENABLE=y
CONFIG_WEBGUIAPP_SNTP_HOST="https://iotronic.cloud/firmware/firmware.bin"
CONFIG_WEBGUIAPP_SNTP_HOST="2.pool.ntp.org"
CONFIG_WEBGUIAPP_SNTP_AUTOUPDATE_PERIOD=3600
CONFIG_WEBGUIAPP_SNTP_TIMEZONE=2
# end of SNTP client settings