expand web ui with batch table and manual

This commit is contained in:
2026-02-01 21:04:34 +01:00
parent 50436cd0bb
commit 01f4494f00
3 changed files with 105 additions and 4 deletions

View File

@@ -595,6 +595,7 @@ void setup() {
time_receiver_init(g_cfg.ntp_server_1.c_str(), g_cfg.ntp_server_2.c_str());
mqtt_init(g_cfg, g_device_id);
web_server_set_config(g_cfg);
web_server_set_sender_faults(g_sender_faults_remote, g_sender_last_error_remote);
web_server_begin_sta(g_sender_statuses, NUM_SENDERS);
} else {
g_ap_mode = true;
@@ -608,6 +609,7 @@ void setup() {
g_cfg.ntp_server_2 = "time.nist.gov";
}
web_server_set_config(g_cfg);
web_server_set_sender_faults(g_sender_faults_remote, g_sender_last_error_remote);
web_server_begin_ap(g_sender_statuses, NUM_SENDERS);
}
}
@@ -787,10 +789,11 @@ static void receiver_loop() {
}
}
bool duplicate = sender_idx >= 0 && g_last_batch_id_rx[sender_idx] == batch_id;
if (duplicate) {
send_batch_ack(batch_id, pkt.device_id_short);
} else if (jsonToMeterBatch(json, samples, METER_BATCH_MAX_SAMPLES, count)) {
if (duplicate) {
send_batch_ack(batch_id, pkt.device_id_short);
} else if (jsonToMeterBatch(json, samples, METER_BATCH_MAX_SAMPLES, count)) {
if (sender_idx >= 0) {
web_server_set_last_batch(static_cast<uint8_t>(sender_idx), samples, count);
for (size_t s = 0; s < count; ++s) {
samples[s].link_valid = true;
samples[s].link_rssi_dbm = pkt.rssi_dbm;