mirror of
https://github.com/ok-home/ota_ws_update.git
synced 2025-11-13 22:03:27 +03:00
html restsrt debug
This commit is contained in:
@@ -151,10 +151,11 @@
|
|||||||
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) {
|
||||||
@@ -246,9 +247,11 @@
|
|||||||
socket.onopen = function () {
|
socket.onopen = function () {
|
||||||
console.log("connect ws");
|
console.log("connect ws");
|
||||||
};
|
};
|
||||||
socket.onclose = function (event) {
|
socket.onclose = async function (event) {
|
||||||
//document.location.reload();
|
console.log("close ws - reload");
|
||||||
console.log("close ws");
|
await sleep(2000);
|
||||||
|
document.location.reload();
|
||||||
|
//console.log("close ws");
|
||||||
};
|
};
|
||||||
socket.onerror = function () {
|
socket.onerror = function () {
|
||||||
//document.location.reload();
|
//document.location.reload();
|
||||||
|
|||||||
Reference in New Issue
Block a user