Zadání: projet celý projekt, zarovnat dokumentaci, přidat skilly a hooky —
od zítřka je vzdálené stanoviště dlouho bez rukou, chyby si nemůžeme dovolit.
ZAROVNÁNÍ (místa, kde dokumentace tvrdila něco, co 22. 8. realita vyvrátila):
* AGENTS.md pravidlo o T1000-E portu zpřesněno: „-BOOT" v názvu má APLIKACE;
zakázaný je 1200baud touch a `pio -t upload`, konzole a `dfu uf2` jsou
v pořádku (ověřeno na probe kartě). Desky rozlišovat sériákem: domácí
B612AE… (identita, wedge) vs probe B3F160….
* docs/upstream-prs.md: kandidát na upstream přepsán na skutečný stav —
chyba šířky path hashe je širší než zerohop (i DIRECT s prázdnou cestou
a defaultní argumenty), naše oprava 6aaa8163 hotová a změřená na vzduchu
(0x00→0x40, 18/18); pro PR zbývá port proti `dev`.
* docs/mesh-review-2026-08-19.md: dovětek, že mechanismus 1B hlášení je
u nás opravený; pro čtení cizích uzlů platí dál.
* docs/ble-flash-plan.md: hlavička PROVEDENO 22. 8. s verzemi celé flotily.
* skill mesh-evidence: doplněna záměrná 3B výjimka (MeshCore-TTH doma).
* skill flash-node: poznámka o matoucím jménu portu.
* memory: t1000e-wedge-recovery a cz-mesh-deployment-nodes aktualizovány —
tvrzení, že úsporná vlna Plešivci chybí, UŽ NEPLATÍ (verify prošel celý).
NOVÉ VYNUCENÍ:
* hooks/secrets-guard.sh (PreToolUse, Bash|Read): deny na dump i Read
souborů se secrety (transkript je nešifrovaný a už dvakrát držel heslo),
deny na zakázané příkazy z globálních pravidel (inspekce env kontejnerů,
ykman fido), ask na rotaci hesla přes echující konzoli (únik 22. 8.).
Kanonické vzory (sed do roury, mesh_admin, grep -c) projdou — 10/10 testů.
* hooks/hw-state.sh: varuje u přímého použití ttyACM portů a rovnou přidá
mapu by-id, aby se dalo opravit bez dalšího kola.
* VŠECHNY tři Bash hooky: heredoc těla se před testem VYSTŘIHNOU — hook
zablokoval vlastní commit, protože message nesla názvy zakázaných příkazů;
testuje se kód, ne data. Ověřeno obousměrně (text projde, příkaz spadne).
* skill remote-admin: správa uzlů na dálku — cesty per uzel, pravidlo
jednoho klienta na companion port (stop/start exportéru trapem), co přes
RF nejde, zlaté pravidlo posledních dveří, hodiny, heslo, dohled v Mimiru.
* .gitignore: lokální stav .claude/ (settings.local.json, RESUME.md).
ODJEZDOVÝ STAV (ověřeno čísly, ne službami): second-mast AKTIVNÍ a kompletní
(gps duty s fixem, 8 sat), remote-mast verify-cz-silent 100 % + checklist
~/mc/MAST.md na laptop pro aktivaci bez asistence, karta tichá (repeat off,
0/0), exportér na cabin-host publikuje uptime+battery+scrape-success obou
mast-jednotek do Mimiru, identita probe karty zachráněna do keys.yml
(home-scripts 6c11dc4).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ranní 4caf52bb spravil jen sendZeroHop() a jen tam, kde mu volající šířku
předal. Zbylo dvoje místo, kde uzel s `path.hash.mode 1` pořád vysílal
hlavičku s 1 B:
* sendDirect() s PRÁZDNOU cestou. `path_len` je zakódovaný bajt (bity
šířky + počet hopů), takže neprázdná cesta si svou šířku nese sama a
přes copyPath() projde beze změny — proto tady žádná chyba routingu
není a moje první diagnóza „forwarder rozseká cestu po bajtu" byla
mylná. Prázdná cesta ale nemá co nést a holá 0 se dekóduje jako 1 B.
A přesně to je nejběžnější případ: odpověď sousedovi na dosah jde
zerohop direct, takže tudy tekla VĚTŠINA 1B provozu, co je vidět na
ob2 a v appce na #tth-test.
* volání send*() bez explicitní šířky. Companion (ob1/ob2/L1) posílá
zerohop na třech místech výchozím argumentem, stejně tak sensor
a room server; ACKy a PATH-return v BaseChatMesh a Mesh.cpp:187 taky.
Řeší se to na jednom místě: `getSelfPathHashSize()` je nový protected
virtual na Mesh a výchozí hodnota parametru se mění z 1 na 0 = „vem prefs
uzlu". Firmwary s NodePrefs ho přebíjejí na `path_hash_mode + 1`, takže
opravu dostanou i cesty, které si šířku nikdy nepředávaly. Základní třída
prefs nemá a vrací protokolové minimum, tedy simple_secure_chat zůstává,
jak byl.
TRACE se schválně nedotýká: tam `path_len` NENÍ zakódovaný bajt, ale holý
čítač SNR vzorků, a šířka se veze v příznacích payloadu (Mesh.cpp:55).
Kompatibilita: `path_len = 0x40` znamená šířka 2, počet hopů 0, tedy
`getPathByteLen() == 0` — starší uzly ho projdou přes isValidPathLen()
a nepřečtou o bajt navíc.
Přeloženo: SenseCap_hreb_rpt, SenseCap_ples_rpt,
SenseCap_Solar_repeater_ble, T1000E_cmp_cz,
Heltec_t114_without_display_room_server, Heltec_ct62_sensor.
Upstream to opravené nemá: origin/main je cad602e4 (v1.17.1) a je předkem
tohohle stromu, 0 commitů napřed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`packet->path_len = 0` vynuluje celý bajt — a v jeho horních dvou bitech bydlí
šířka hashe (`Packet.h:85`). Zerohop paket proto hlásil 1 B bez ohledu na
`path_hash_mode`, zatímco floodová větev šířku dostávala. Na uzlu s 2bajtovým
nastavením to vypadalo takhle: `flood: {2 B}` a `route2: {1 B}` od téhož
původce, přesně `advert.interval` od sebe.
Routing to nerozbíjí (zerohop nemá cestu a nepřeposílá se, `Mesh.cpp:83` chce
`getPathHashCount() > 0`), ale kazí to odvozování šířky v analyzerech — a je to
pravděpodobné vysvětlení části komunitních uzlů vedených jako "suspected 1B".
`sendZeroHop()` dostal `path_hash_size=1` jako `sendFlood()` a všechna čtyři
volání v `simple_repeater` mu předávají `_prefs.path_hash_mode + 1`. Zvlášť to
u periodického advertu (`MyMesh.cpp:1706`), který NEJDE přes
`sendSelfAdvertisement()` — oprava jen v té funkci by ho minula, a přitom je to
zrovna on, koho bylo v datech vidět.
Ostatní příklady se nemění, default zachovává dnešní chování. Build ověřen na
všech třech produkčních envech.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
MAX_CLIENTS is defined in both src/helpers/ClientACL.h and examples/simple_repeater/MyMesh.h. Appears it was centralised in the former header file some time ago. Both are included in some places and, depending on which order they're in, either value can win.
This change drops the duplicate entry from the repeater firmware and bumps the central limit up to 32 (per the original repeater firmware value).
Changes:
- Remove MAX_CLIENTS from repeater MyMesh.h
- Increase MAX_CLIENTS limit in ClientACL.h to 32
`ver` on a bench board reported the literal from the upstream header, so
there was no way to tell which build was actually on it -- which is exactly
what AGENTS.md says must never happen for a flashed env. The audit was worse
than expected: of 585 envs in the repo, TWO stamped. The T1000-E only looks
right because it is flashed from a local env in platformio.local.ini.
So the stamping moved into [nrf52_base], where every nRF52 env inherits it,
and the two per-env copies are gone (they would have run the script twice).
Verified on hardware, not just in the ELF: after reflashing, x4 reports
ver -> v1.17.1-tthec20d77+ (Build: 260819 1957)
and x2's device query returns v1.17.1-tthec20d77+ / 260819 2003. The `+`
marks a dirty tree, the sha is the commit that built it.
ESP32/RP2040/STM32 bases can take the same one-liner if boards on those
platforms ever get flashed from here; not done blind.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A repeater that keeps failing to get its transmits out looks perfectly
healthy over RF: sent/airtime just stop growing and nothing in the status
says why. The Dispatcher already counts those failures (n_tx_start_fail,
n_tx_timeout, from the requeue path); this puts them on the air.
Appended at the END of RepeaterStats on purpose, because the struct goes out
byte-for-byte and clients parse it by fixed offsets. Upstream grew the same
frame the same way -- meshcore-py's parse_status() reads recv_errors only
`if len(data) >= offset + 56`, with the comment "appended in firmware
v1.12.0" -- so older clients keep working and simply do not see the new
fields. Verified against the installed parser before writing this.
A static_assert pins sizeof(RepeaterStats) == 64 (56 + 8, padding-free):
reordering a field or gaining padding would silently shift every offset
after it, and that is not something to leave to review.
Room server keeps its own, already-different stats struct -- not touched.
Builds: SenseCap_Solar_repeater, SenseCap_Solar_repeater_ble, t1000e_repeater.
NOT field-tested yet: needs a repeater flashed with this and queried over RF.
Reading the two values also needs the consumer side extended (the library
parser stops at 56 bytes by design).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Boards without a charge-complete signal only infer "full" from voltage, and
a real pack rarely reads the full BATT_MAX_MILLIVOLTS (4.2V), so the plug icon
was effectively never shown. Treat "full" as a high band (>= 95%) so the plug
appears when the battery is charged rather than requiring an exact 100%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Show a small lightning-bolt icon to the left of the battery indicator on
the ui-new home screen while the device is externally powered, and a plug
icon once the battery reads full. The bolt/plug sits beside the battery so
the fill bar stays clean and uninterrupted. When a buzzer is present, the
mute icon shifts one slot further left so the two never overlap.
Charging state is derived from board.isExternalPowered(), so this works on
any board that reports external power (e.g. the nRF52 VBUS-detect path).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ContactInfo is filled field by field in three places, and none of them
writes every member:
- CMD_ADD_UPDATE_CONTACT, for a contact the node does not know yet
(companion_radio/MyMesh.cpp): the frame's lat/lon/lastmod are optional,
and clients omit them when the contact has no location -- so
gps_lat/gps_lon keep whatever was on the stack.
- DataStore::loadContacts(), and the same loop in simple_secure_chat: the
on-disk record carries no shared_secret/shared_secret_valid, so those
two members are never written. For every contact, on every boot.
shared_secret_valid is the dangerous one. getSharedSecret() computes the
secret only while the flag is false, so a non-zero byte there makes it
hand out an uninitialised buffer as the ECDH shared secret, and DMs to
that contact go out encrypted with garbage -- no error, no log.
populateContactFromAdvert() already memsets for exactly this reason; do
the same at the other three sites.
Found in the field: a room server whose advert carries no location showed
up at 0.255433, 0.0 in two independent companion clients. 255433 is
0x0003E5C9, straight off the stack. Verified the advert itself is clean by
decoding it in a third, unrelated tool.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An unconfigured slot has an all-zero secret, so it matches null-key group traffic (a sender with an unset PSK). The zero-key MAC validates against the empty slot and the foreign message is delivered as if it belonged to that channel — every node with a free slot is a null-key sink. Skip empty slots.
thinknode_m8: initial support
adds some functionalities to ui_task and epddisplay:
epd display,
- supports screen off, and clear screen
- supports forcing full refresh every N partial refreshes (off by default, configured to 60 for M8)
ui_task
- UI_SHOW_CLOCK flag to display clock on first screen
- rotary button can act like joystick (with regards to Enter key), defaults to old config for existing nodes
- screen off on long press when using rotary button (very handy for the watch)
Grove and other Bosch modules strap SDO high, so the 0x76-only table
never initialized them. Add an alternate-address entry per Bosch sensor;
the bus scan still gates every probe, and all four drivers verify a chip
ID before claiming an address.
Each sensor type has a single static driver instance, so skip an entry
whose query is already active: the alternate address is a fallback, not
a second device.
Several table entries share an address and not every driver verifies a
chip ID: INA226::begin() only checks that the address ACKs, so an SHT4x
at 0x44 was also registered as an INA226 and reported junk current on a
second channel. Mark the address consumed once a driver initializes it
so later entries cannot re-claim the same device.
MAX_CLIENTS is defined in both src/helpers/ClientACL.h and examples/simple_repeater/MyMesh.h. Appears it was centralised in the former header file some time ago. Both are included in some places and, depending on which order they're in, either value can win.
This change drops the duplicate entry from the repeater firmware and bumps the central limit up to 32 (per the original repeater firmware value).
Changes:
- Remove MAX_CLIENTS from repeater MyMesh.h
- Increase MAX_CLIENTS limit in ClientACL.h to 32