diff --git a/firmware/esp32/overland-controller/overland-controller.ino b/firmware/esp32/overland-controller/overland-controller.ino index 634739c..8c4dfa9 100644 --- a/firmware/esp32/overland-controller/overland-controller.ino +++ b/firmware/esp32/overland-controller/overland-controller.ino @@ -66,6 +66,11 @@ const char INDEX_HTML[] PROGMEM = R"rawliteral(
Battery temp--
Cell delta--
Cycles--
+
BMS Polling--
+
+ + +
@@ -112,6 +117,18 @@ const $=id=>document.getElementById(id); function fmt(n,d=1){return typeof n==="number"?n.toFixed(d):"--"} function temp(v){return typeof v==="number"?fmt(v,1)+"°F":"Offline"} function clsAlarm(v){return v?"bad":"good"} +async function setBmsEnabled(enabled){ + try{ + await fetch("/config/bms",{ + method:"POST", + headers:{"Content-Type":"application/json"}, + body:JSON.stringify({enabled:enabled}) + }); + await fetch("/config/save",{method:"POST"}); + await load(); + }catch(e){} +} + async function relay(id,on){ try{ await fetch("/relay/set",{ @@ -137,6 +154,8 @@ function render(data){ $("battTemp").textContent=temp(b.temperature_f); $("delta").textContent=(typeof b.cell_delta_mv==="number"?b.cell_delta_mv:"--")+" mV"; $("cycles").textContent=b.cycle_count??"--"; + const bmsCfg=data.config?.bms||{}; + $("bmsEnabledText").textContent=bmsCfg.enabled ? "Enabled" : "Disabled"; $("temps").innerHTML=(data.temps||[]).map(t=>`