Compare commits

..

No commits in common. "a4c37c399e7ba37d7eeae4783e5f6dd8a3988eff" and "3cf929875613cd8664a3ccd41f0dbe7ea05d6245" have entirely different histories.

4 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,6 @@
nvs, data, nvs, , 16k, nvs, data, nvs, , 16k,
otadata, data, ota, , 8k, otadata, data, ota, , 8k,
phy_init, data, phy, , 4k, phy_init, data, phy, , 4k,
ota_0, app, ota_0, , 5632k, ota_0, app, ota_0, , 6M,
ota_1, app, ota_1, , 5632k, ota_1, app, ota_1, , 6M,
storage, data, spiffs, , 5000k, storage, data, spiffs, , 3800k,
1 nvs data nvs 16k
2 otadata data ota 8k
3 phy_init data phy 4k
4 ota_0 app ota_0 5632k 6M
5 ota_1 app ota_1 5632k 6M
6 storage data spiffs 5000k 3800k

View File

@ -1081,15 +1081,15 @@ fn get_version() -> VersionInfo {
let running_partition = unsafe { esp_ota_get_running_partition() }; let running_partition = unsafe { esp_ota_get_running_partition() };
let address = unsafe { (*running_partition).address }; let address = unsafe { (*running_partition).address };
let partition = if address > 100000 { let partition = if address > 20000 {
"ota_1 @ " "ota_1"
} else { } else {
"ota_0 @ " "ota_0"
}; };
return VersionInfo { return VersionInfo {
git_hash: (branch + "@" + hash), git_hash: (branch + "@" + hash),
build_time: env!("VERGEN_BUILD_TIMESTAMP").to_owned(), build_time: env!("VERGEN_BUILD_TIMESTAMP").to_owned(),
partition: partition.to_owned() + &address.to_string() partition: partition.to_owned()
}; };
} }

View File

@ -272,6 +272,7 @@ fn ota(
loop { loop {
let read = request.read(&mut buffer)?; let read = request.read(&mut buffer)?;
total_read += read; total_read += read;
println!("received {read} bytes ota {total_read}");
let to_write = &buffer[0..read]; let to_write = &buffer[0..read];
let iter = (total_read/1024)%8; let iter = (total_read/1024)%8;
@ -284,11 +285,11 @@ fn ota(
} }
ota.write(to_write)?; ota.write(to_write)?;
println!("wrote {read} bytes ota {total_read}");
if read == 0 { if read == 0 {
break; break;
} }
} }
println!("wrote bytes ota {total_read}");
println!("finish ota"); println!("finish ota");
let partition = ota.raw_partition(); let partition = ota.raw_partition();
println!("finalizing and changing boot partition to {partition:?}"); println!("finalizing and changing boot partition to {partition:?}");
@ -298,7 +299,7 @@ fn ota(
board.set_restart_to_conf(true); board.set_restart_to_conf(true);
drop(board); drop(board);
finalizer.set_as_boot_partition()?; finalizer.set_as_boot_partition()?;
return anyhow::Ok(None); finalizer.restart();
} }
fn flash_bq(filename: &str, dryrun: bool) -> anyhow::Result<()> { fn flash_bq(filename: &str, dryrun: bool) -> anyhow::Result<()> {

View File

@ -125,8 +125,8 @@ export class Controller {
controller.progressview.addProgress("ota_upload", (current / max) * 100, "Uploading firmeware (" + current + "/" + max + ")") controller.progressview.addProgress("ota_upload", (current / max) * 100, "Uploading firmeware (" + current + "/" + max + ")")
}, false); }, false);
ajax.addEventListener("load", () => { ajax.addEventListener("load", () => {
//TODO wait for reboot here!
controller.progressview.removeProgress("ota_upload") controller.progressview.removeProgress("ota_upload")
controller.reboot();
}, false); }, false);
ajax.addEventListener("error", () => { ajax.addEventListener("error", () => {
alert("Error ota") alert("Error ota")