Added wifi settings

This commit is contained in:
j3d1 2021-09-12 23:01:00 +02:00
parent 4a828a0468
commit 4962447951
2 changed files with 25 additions and 7 deletions

View file

@ -248,6 +248,20 @@ void websocket_task(void *pvParameter) {
} }
//printf("9: %d\n",gpio_read(9)); //printf("9: %d\n",gpio_read(9));
//printf("10: %d\n",gpio_read(10)); //printf("10: %d\n",gpio_read(10));
vTaskDelayMs(250);
{
uint8_t response[3];
uint16_t val;
val = sdk_system_adc_read();
response[2] = (uint8_t) val;
response[1] = val >> 8;
response[0] = 'V';
LOCK_TCPIP_CORE();
websocket_write(pcb, response, 3, WS_BIN_MODE);
UNLOCK_TCPIP_CORE();
}
vTaskDelayMs(500);
} }
syslog_detach(); syslog_detach();

View file

@ -338,6 +338,10 @@
return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null; return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null;
} }
var ws;
var retries;
var series = new TimeSeries();
function setMsg(cls, text) { function setMsg(cls, text) {
sbox.className = "label " + cls; sbox.className = "label " + cls;
sbox.innerHTML = text; sbox.innerHTML = text;
@ -619,13 +623,6 @@
} }
} }
function update_progress(progressBar, progress) {
var iP = Math.floor(progress);
var dBar = document.getElementById("progress_bar_" + progressBar);
dBar.innerText = iP + "%";
dBar.style.width = progress + "%";
}
var sta_toggle = document.getElementById("sta_toggle"); var sta_toggle = document.getElementById("sta_toggle");
var sta_ssid = document.getElementById("sta_ssid"); var sta_ssid = document.getElementById("sta_ssid");
var sta_pw = document.getElementById("sta_pw"); var sta_pw = document.getElementById("sta_pw");
@ -667,6 +664,13 @@
tx_len = view1.setInt8Vec(tx_len, [255, 255, 255, 0]); tx_len = view1.setInt8Vec(tx_len, [255, 255, 255, 0]);
wsWrite(buffer); wsWrite(buffer);
} }
function update_progress(progressBar, progress) {
var iP = Math.floor(progress);
var dBar = document.getElementById("progress_bar_" + progressBar);
dBar.innerText = iP + "%";
dBar.style.width = progress + "%";
}
</script> </script>
</body> </body>
</html> </html>