Skip to content

Commit cce8f1d

Browse files
committed
Update documentation for v0.8.0: region commands, removed aliases, password syntax
- COMMANDS.md: add Region Filtering section, remove legacy alias tables, update password syntax, update remote CLI command lists - ROADMAP_v0.5.md: add Fase 4 (Region System), update resource summary table - OPTIMIZATION.md: update current Flash/RAM status (99.3% / 53.1%) - INSTALL.md, README.md, README_VEN.md: update passwd→password, name→set name - TESTING.md: update password test commands - API.md: update passwd→password references
1 parent bbf050b commit cce8f1d

9 files changed

Lines changed: 148 additions & 108 deletions

File tree

docs/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ Automatic transmission power adjustment based on neighbour SNR:
255255
| `location clear` | Clear location |
256256
| `nodetype chat\|repeater` | Set node type |
257257
| `advert interval <sec>` | Set ADVERT interval (60-86400) |
258-
| `passwd admin <pw>` | Set admin password |
259-
| `passwd guest <pw>` | Set guest password |
258+
| `password admin <pw>` | Set admin password |
259+
| `password guest <pw>` | Set guest password |
260260
| `time <unix>` | Manually set time |
261261
262262
### Power Commands

docs/OPTIMIZATION.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# CubeCellMeshCore Memory Optimization Guide
22

33
## Current Status (After Optimizations)
4-
- **Flash**: 128,728 / 131,072 bytes (98.2%)
5-
- **RAM**: 8,136 / 16,384 bytes (49.7%)
6-
- **Available**: ~2,344 bytes Flash
4+
- **Flash**: ~130,144 / 131,072 bytes (99.3%)
5+
- **RAM**: ~8,696 / 16,384 bytes (53.1%)
6+
- **Available**: ~928 bytes Flash
77
- **Daily Report**: Disabled via `#define ENABLE_DAILY_REPORT`
8-
- **Note**: RAM 49.7% is static only; ~4 KB free at runtime (incl. stack/heap)
8+
- **Note**: RAM 53.1% is static only; ~4 KB free at runtime (incl. stack/heap)
9+
- **Region system**: RegionMap (4 entries + wildcard) adds ~168 bytes RAM
10+
- **SILENT macro**: Wrapping Serial.printf in mesh/ headers freed ~344 bytes Flash
911

1012
## Implemented Optimizations
1113

docs/REGION_SCOPE_DESIGN.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,14 @@ struct RegionMap {
238238
- Legacy FLOOD: checks wildcard REGION_DENY_FLOOD flag
239239
- Default behavior: forward everything (no regions configured = no filtering)
240240
241-
#### Phase 4: CLI Commands --- DEFERRED (Flash too full)
242-
- Needs ~400+ bytes Flash for CLI strings and strcmp calls
243-
- Only 584 bytes Flash remaining after Phase 1-3
244-
- Can be enabled when other features are trimmed or LITE_MODE saves more space
245-
- Planned commands: `region`, `region put`, `region remove`, `region allowf`, `region denyf`
241+
#### Phase 4: CLI Commands --- DONE
242+
- `region` — list wildcard and all entries with flood status (A=allow, D=deny)
243+
- `region put {name}` — add region entry (admin only)
244+
- `region remove {name}` — remove region entry (admin only)
245+
- `region allowf {name}` — allow flood for region or `*` (admin only)
246+
- `region denyf {name}` — deny flood for region or `*` (admin only)
247+
- Available via serial and remote CLI
248+
- **Cost:** ~744 bytes Flash (freed by optimizing debug output and CLI aliases)
246249
247250
#### Phase 5: Testing
248251
- Transport code serialization/deserialization
@@ -263,10 +266,11 @@ struct RegionMap {
263266
| CLI commands (minimal) | ~600 bytes |
264267
| **Total** | **~1.5 KB** |
265268
266-
After Phase 1-3, available Flash is ~584 bytes. Actual costs:
269+
After all phases, available Flash is ~928 bytes (99.3%). Actual costs:
267270
- Phase 1: DONE (+48 bytes Flash, +16 bytes RAM)
268271
- Phase 2-3: DONE (+272 bytes Flash, +168 bytes RAM)
269-
- Phase 4 (CLI): DEFERRED — needs ~400+ bytes, won't fit without freeing space
272+
- Phase 4: DONE (+744 bytes Flash)
273+
- Flash freed by optimizing debug output and CLI aliases: ~1,088 bytes
270274
271275
---
272276

docs/ROADMAP_v0.5.md

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Questo meccanismo e' usato sia da `healthCheck()` che da `alert test`.
297297
- Creata `CmdCtx` struct per output unificato (serial/buffer)
298298
- `dispatchSharedCommand()` contiene ~40 comandi condivisi (prima duplicati)
299299
- `processCommand()` e `processRemoteCommand()` diventati thin wrapper
300-
- Comandi serial-only: help, newid, nodetype, passwd, tempradio, test, contacts, msg
300+
- Comandi serial-only: help, newid, nodetype, password, tempradio, test, contacts, msg
301301
- Comandi remote-only: set password, set guest, report (paginato)
302302

303303
**Risparmio merge CLI**: -3,164 B Flash
@@ -486,6 +486,57 @@ Floor 5dBm, ceiling MC_TX_POWER.
486486

487487
---
488488

489+
## Fase 4: Region System (MeshCore 1.10.0+) (COMPLETATA)
490+
491+
### Implementazione
492+
Deny-based flood filtering allineato al protocollo MeshCore. Vedi `docs/REGION_SCOPE_DESIGN.md` per i dettagli.
493+
494+
**Fase 4.1: Transport Code in Packet.h**
495+
- `uint16_t transport_codes[2]` aggiunto a MCPacket
496+
- `serialize()`/`deserialize()` aggiornati per wire format con transport codes
497+
- `hasTransportCodes()` helper
498+
- Costo: +48 B Flash, +16 B RAM
499+
500+
**Fase 4.2: RegionMap Data Structure**
501+
- `src/mesh/RegionMap.h`: RegionEntry/RegionMap classes
502+
- SHA256 key derivation, HMAC-SHA256 transport code verification
503+
- 4 region slots + wildcard entry
504+
- Costo: +272 B Flash, +168 B RAM
505+
506+
**Fase 4.3: Forwarding Integration**
507+
- Region filter in `shouldForward()` di main.cpp
508+
- TRANSPORT_FLOOD: check `regionMap.findMatch()` contro transport codes
509+
- Legacy FLOOD: check wildcard `REGION_DENY_FLOOD` flag
510+
- Default: forward everything (nessuna regione configurata = nessun filtro)
511+
512+
**Fase 4.4: CLI Commands + Flash Optimization**
513+
- `region` — lista wildcard e entry con stato flood (A=allow, D=deny)
514+
- `region put/remove/allowf/denyf <name>` — gestione regioni (admin only)
515+
- Per liberare spazio Flash: wrapped `Serial.printf` in mesh/ headers con `#ifndef SILENT`,
516+
compresso help text, rimossi alias CLI duplicati (~12 comandi)
517+
- Costo CLI: +744 B Flash (netto dopo ottimizzazioni: ~1,088 B liberati)
518+
519+
**Alias rimossi (v0.8.0):**
520+
- `passwd` → usare `password`
521+
- `erase` → usare `reset`
522+
- `stats-radio` → usare `radiostats`
523+
- `stats-packets` → usare `packetstats`
524+
- `set repeat`/`get repeat` (getter) → usare `repeat`
525+
- `set advert.interval`/`get advert.interval` (getter) → usare `advert interval`
526+
- `get radio` → usare `radio`
527+
- `set tx`/`get tx` (getter) → usare `txpower`
528+
- `txpower auto on/off` → usare `set tx auto on/off`
529+
- `set name` (getter) → usare `get name` o `name`
530+
- `set guest.password` (serial) → usare `password guest`
531+
532+
**Password syntax cambiata:**
533+
- Serial: `password admin <pw>` / `password guest <pw>`
534+
- Remote: `password <pw>` / `set guest.password <pw>` (invariato)
535+
536+
### Ordine completato: Fase 0 -> 1 -> 2 -> 2.5 -> 3 -> 3.1 -> 3.2 -> 3.3 -> 3.4 -> 4
537+
538+
---
539+
489540
## Riepilogo risorse finali
490541

491542
| Fase | Flash | RAM | EEPROM | Note |
@@ -497,13 +548,14 @@ Floor 5dBm, ceiling MC_TX_POWER.
497548
| Fase 2.5 (Ottimiz) | -12,916 B | -368 B | 0 | Merge CLI, no float |
498549
| Fase 3 (Mailbox) | +1,752 B | +512 B | 172 B | 2 EEPROM + 4 RAM slots |
499550
| Fase 3.1 (Fix+Dedup) | +136 B | 0 | 0 | Session expiry, dedup, CLI fix |
500-
| Fase 3.2 (DIRECT+Health) | ~+200 B | 0 | 0 | DIRECT routing, health dashboard, loop prevention |
501-
| Fase 3.3 (SNR Delay) | ~+50 B | 0 | 0 | Lookup table 22B, nuove funzioni, RSSI threshold |
551+
| Fase 3.2 (DIRECT+Health) | ~+200 B | 0 | 0 | DIRECT routing, health dashboard |
552+
| Fase 3.3 (SNR Delay) | ~+50 B | 0 | 0 | Lookup table, RSSI threshold |
502553
| Fase 3.4 (QH+CB+ATX) | ~+1,200 B | +57 B | 0 | Quiet Hours, Circuit Breaker, Adaptive TX |
503-
| **Totale** | **~-7,882 B** | **-255 B** | **+172 B** | |
504-
| **Finale (stimato)** | **~120,798 B (92.1%)** | **7,905 B (48.3%)** | **512/512** | |
554+
| Fase 4 (Regions) | ~+1,064 B | +184 B | 0 | RegionMap, transport codes, CLI (-1,088 B ottimiz.) |
555+
| **Totale** | **~-6,818 B** | **-71 B** | **+172 B** | |
556+
| **Finale (misurato)** | **~130,144 B (99.3%)** | **~8,696 B (53.1%)** | **512/512** | |
505557

506-
**Margine residuo**: ~10,274 B Flash liberi, 8,479 B RAM liberi
558+
**Margine residuo**: ~928 B Flash liberi, ~7,688 B RAM liberi
507559

508560
---
509561

@@ -514,4 +566,5 @@ Floor 5dBm, ceiling MC_TX_POWER.
514566
- **Mailbox**: messaggio consegnato entro 30s dal ritorno del nodo destinatario
515567
- **Stabilita'**: zero regressioni sui 66 test firmware esistenti
516568
- **SNR Adaptive Delay**: DIRECT delay < FLOOD delay; SNR migliore = ritrasmissione piu' veloce; pacchetti sotto -120 dBm scartati
517-
- **Flash**: margine residuo ~11.4 KB dopo tutte le feature (era 2.3 KB pre-ottimizzazione)
569+
- **Region Filtering**: deny-based flood filtering compatibile con MeshCore 1.10.0+
570+
- **Flash**: margine residuo ~928 B dopo tutte le feature

docs/TESTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ Pass: Alert message transmitted
277277

278278
#### 10.1 View Passwords
279279
```
280-
Command: passwd
280+
Command: password
281281
Expected: Current admin and guest passwords displayed
282282
```
283283

284284
#### 10.2 Change Passwords
285285
```
286-
Command: passwd admin newadminpass
287-
Command: passwd guest newguestpass
286+
Command: password admin newadminpass
287+
Command: password guest newguestpass
288288
Expected: Passwords updated
289289
Pass: New passwords work for remote CLI auth
290290
```

0 commit comments

Comments
 (0)