mirror of
https://github.com/ok-home/ota_ws_update.git
synced 2025-11-13 22:03:27 +03:00
readme
This commit is contained in:
@@ -50,6 +50,6 @@ ota_1, app, ota_1, , 1M
|
|||||||
- Параметры menuconfig
|
- Параметры menuconfig
|
||||||
- CONFIG_PARTITION_TABLE_CUSTOM=y
|
- CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||||
- CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
- CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||||
- CONFIG_WS_TRANSPORT=y
|
- CONFIG_HTTPD_WS_SUPPORT=y
|
||||||
- CONFIG_APP_ROLLBACK_ENABLE=y
|
- CONFIG_APP_ROLLBACK_ENABLE=y
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,6 @@ ota_1, app, ota_1, , 1M
|
|||||||
- menuconfig options
|
- menuconfig options
|
||||||
- CONFIG_PARTITION_TABLE_CUSTOM=y
|
- CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||||
- CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
- CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||||
- CONFIG_WS_TRANSPORT=y
|
- CONFIG_HTTPD_WS_SUPPORT=y
|
||||||
- CONFIG_APP_ROLLBACK_ENABLE=y
|
- CONFIG_APP_ROLLBACK_ENABLE=y
|
||||||
|
|
||||||
|
|||||||
@@ -151,11 +151,10 @@
|
|||||||
socket.send(JSON.stringify({ name: "otaRestartEsp", value: "restart" }));
|
socket.send(JSON.stringify({ name: "otaRestartEsp", value: "restart" }));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* // debug -> test sample
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
/* // debug -> test sample
|
|
||||||
async function tstReceive() {
|
async function tstReceive() {
|
||||||
receiveWsData(JSON.stringify({ name: "otaSetChunkSize", value: 1024 }));
|
receiveWsData(JSON.stringify({ name: "otaSetChunkSize", value: 1024 }));
|
||||||
while (otaStartsegment + otaSetChunkSize <= otaData.length && otaStarted == 1) {
|
while (otaStartsegment + otaSetChunkSize <= otaData.length && otaStarted == 1) {
|
||||||
@@ -247,15 +246,13 @@
|
|||||||
socket.onopen = function () {
|
socket.onopen = function () {
|
||||||
console.log("connect ws");
|
console.log("connect ws");
|
||||||
};
|
};
|
||||||
socket.onclose = async function (event) {
|
socket.onclose = function (event) {
|
||||||
console.log("close ws - reload");
|
console.log("close ws - reload");
|
||||||
await sleep(2000);
|
setTimeout(() => document.location.reload(), 2000);
|
||||||
document.location.reload();
|
|
||||||
//console.log("close ws");
|
|
||||||
};
|
};
|
||||||
socket.onerror = function () {
|
socket.onerror = function () {
|
||||||
//document.location.reload();
|
|
||||||
console.log("error ws");
|
console.log("error ws");
|
||||||
|
setTimeout(() => document.location.reload(), 2000);
|
||||||
};
|
};
|
||||||
socket.onmessage = function (event) {
|
socket.onmessage = function (event) {
|
||||||
receiveWsData(event.data);
|
receiveWsData(event.data);
|
||||||
|
|||||||
Reference in New Issue
Block a user