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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user