Compare commits
4 Commits
3cf9298756
...
a4c37c399e
Author | SHA1 | Date | |
---|---|---|---|
a4c37c399e | |||
f86a1b7c80 | |||
c89340f5f6 | |||
f4c3c5e584 |
@ -1,6 +1,6 @@
|
||||
nvs, data, nvs, , 16k,
|
||||
otadata, data, ota, , 8k,
|
||||
phy_init, data, phy, , 4k,
|
||||
ota_0, app, ota_0, , 6M,
|
||||
ota_1, app, ota_1, , 6M,
|
||||
storage, data, spiffs, , 3800k,
|
||||
ota_0, app, ota_0, , 5632k,
|
||||
ota_1, app, ota_1, , 5632k,
|
||||
storage, data, spiffs, , 5000k,
|
|
@ -1081,15 +1081,15 @@ fn get_version() -> VersionInfo {
|
||||
|
||||
let running_partition = unsafe { esp_ota_get_running_partition() };
|
||||
let address = unsafe { (*running_partition).address };
|
||||
let partition = if address > 20000 {
|
||||
"ota_1"
|
||||
let partition = if address > 100000 {
|
||||
"ota_1 @ "
|
||||
} else {
|
||||
"ota_0"
|
||||
"ota_0 @ "
|
||||
};
|
||||
return VersionInfo {
|
||||
git_hash: (branch + "@" + hash),
|
||||
build_time: env!("VERGEN_BUILD_TIMESTAMP").to_owned(),
|
||||
partition: partition.to_owned()
|
||||
partition: partition.to_owned() + &address.to_string()
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,6 @@ fn ota(
|
||||
loop {
|
||||
let read = request.read(&mut buffer)?;
|
||||
total_read += read;
|
||||
println!("received {read} bytes ota {total_read}");
|
||||
let to_write = &buffer[0..read];
|
||||
|
||||
let iter = (total_read/1024)%8;
|
||||
@ -285,11 +284,11 @@ fn ota(
|
||||
}
|
||||
|
||||
ota.write(to_write)?;
|
||||
println!("wrote {read} bytes ota {total_read}");
|
||||
if read == 0 {
|
||||
break;
|
||||
}
|
||||
}
|
||||
println!("wrote bytes ota {total_read}");
|
||||
println!("finish ota");
|
||||
let partition = ota.raw_partition();
|
||||
println!("finalizing and changing boot partition to {partition:?}");
|
||||
@ -299,7 +298,7 @@ fn ota(
|
||||
board.set_restart_to_conf(true);
|
||||
drop(board);
|
||||
finalizer.set_as_boot_partition()?;
|
||||
finalizer.restart();
|
||||
return anyhow::Ok(None);
|
||||
}
|
||||
|
||||
fn flash_bq(filename: &str, dryrun: bool) -> anyhow::Result<()> {
|
||||
|
@ -125,8 +125,8 @@ export class Controller {
|
||||
controller.progressview.addProgress("ota_upload", (current / max) * 100, "Uploading firmeware (" + current + "/" + max + ")")
|
||||
}, false);
|
||||
ajax.addEventListener("load", () => {
|
||||
//TODO wait for reboot here!
|
||||
controller.progressview.removeProgress("ota_upload")
|
||||
controller.reboot();
|
||||
}, false);
|
||||
ajax.addEventListener("error", () => {
|
||||
alert("Error ota")
|
||||
|
Loading…
x
Reference in New Issue
Block a user