Assign sequential pod IDs from the master with NVS-stable bindings.

Replaces MAC-byte self-IDs with master allocation (1–255), slave preferred-ID reconnect, debug reset via UART/UI, and rate-limited ASSIGN to avoid ESP-NOW NO_MEM storms.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 17:25:07 +01:00
co-authored by Cursor
parent af20635047
commit 567dab6d0a
26 changed files with 1261 additions and 163 deletions
+26
View File
@@ -540,6 +540,12 @@
title="Master-Tap-Config an alle Slaves (ESP-NOW)">
Tap-Cfg alle
</button>
<button type="button" class="btn btn-outline-danger btn-sm"
@click="resetClientIdMap()"
:disabled="busy || !hostUp()"
title="NVS-ID-Map + Live-Registry leeren; Online-Slaves verlieren Binding">
ID-Map leeren
</button>
<span class="badge bg-secondary" x-text="(state.clients || []).length + ' registered'"></span>
</div>
</div>
@@ -1957,6 +1963,26 @@
this.busy = false;
}
},
async resetClientIdMap() {
if (!confirm('ID-Map leeren? Master vergisst alle MAC→ID-Zuordnungen; Online-Slaves verlieren ihr Binding.')) {
return;
}
this.busy = true;
try {
const r = await fetch('/api/clients/reset-id-map', { method: 'POST' });
const data = await r.json();
if (!r.ok || !data.success) {
this.flash(data.error || 'ID-Map leeren fehlgeschlagen', false);
return;
}
this.state = { ...this.state, clients: [] };
this.flash('ID-Map geleert — Slaves melden sich neu an', true);
} catch (e) {
this.flash(String(e), false);
} finally {
this.busy = false;
}
},
async restart(clientId = 0) {
this.busy = true;
try {