Commit Graph
1341 Commits
Author SHA1 Message Date
tthandClaude Opus 5.5 e6f2ae6249 radiolib: RADIO_DIAG -- radiostat/radiokick for a receiver that went deaf
bench-sensor stopped receiving on 31. 10. 2026 (recv frozen for minutes,
noise_floor -120, last_rssi 0, nothing in the debug log); a reboot revived it.
Before fixing anything, find out WHERE it is stuck:

  radiostat   wrapper state, DIO1 ISR count/age, last good RX age, plus the
              SX1262 side: chip mode, cmd status, IRQ register, device errors,
              instantaneous RSSI, DIO1/RXEN pin levels, boosted gain. Read only.
  radiokick   one recovery step at a time (rx | clrirq | standby | agc); the
              first one that brings recv back names the broken layer.

Compiled only with -D RADIO_DIAG; the sensor example wires the commands in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:51:11 +01:00
tthandClaude Opus 5.5 f6d0972f9d Merge upstream/dev (2 commits) [upstream-sync]
Conflict in CustomSX1262Wrapper.h was whitespace only: upstream added
lastRxHadCRC() next to isReceivingPacket(), whose trailing space we had
stripped. Kept both; our LORA_POLL_IRQ irqDoneMask() is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:30:14 +01:00
R0ck 93254adbca radiolib: drop received packets whose LoRa header says no CRC. 2026-10-30 14:05:25 +00:00
tthandClaude Opus 5.5 fd04fdf093 Merge upstream/dev (11 commits) [upstream-sync]
Conflict in examples/companion_radio/ui-new/UITask.cpp: upstream replaced
UI_SHOW_CLOCK with the runtime pref ui_show_clock; kept that and our
BLE pin condition (shown only while Bluetooth is enabled).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:36:32 +01:00
Olexandr Tyshchenko 54b90cbdfa Fix possible reply buffer overflow in 'sensor list'
'sensor list' appended 'name=value' lines into the 160-byte CLI reply with
unbounded sprintf, only checking the position before each write (< 134).
A single long value (or several medium ones) could write past the end of
the buffer.

Write each entry with snprintf against the remaining space, keep room for
the '... next:N' paging hint, and move entries that do not fit to the next
page. Also guard against NULL names/values from a sensor manager.
2026-10-29 23:49:49 +02:00
fdlamotte bd4be350c5 Merge pull request #3687 from fdlamotte/display_prefs
ui: add some parameters to the cli (mostly regarding eink behaviour)
2026-10-29 08:35:36 -04:00
Florent 1d88a709bd ui: add some parameters to the cli (mostly regarding eink behaviour) 2026-10-29 08:34:41 -04:00
upstream-sync-bot 0889cbaa51 Merge upstream/dev (3 commits) [upstream-sync] 2026-10-29 05:06:05 +00:00
ripplebiz f39fa53aea Merge pull request #3682 from meshcore-dev/fix-scope-zero
scope 0 rule fixes
2026-10-29 12:17:09 +11:00
tth ec8e6bcdda Merge remote-tracking branch 'origin/dev' 2026-10-28 20:29:38 +01:00
ripplebiz 022ca93c8f Merge pull request #3686 from marcelverdult/upstream-pr/esp32-rtc-backup-once
Define the RTC backup of ESP32RTCClock once instead of per translation unit
2026-10-28 14:38:36 +11:00
ripplebiz 322427e815 Merge pull request #3692 from Seeed-Studio/dev
Fix LR2021 hot frequency change over BLE
2026-10-28 12:48:39 +11:00
Liam Cottle d1e27f5b21 Merge pull request #3615 from radek-sixi/fix/common-radio-prefs-signed-tx-power
Fix unsigned conversion of negative TX power in CommonRadioPrefs
2026-10-27 22:44:04 +13:00
WayenWeng 8a33082b59 fix(radio): put LR2021 in standby before re-config in setParams 2026-10-27 10:44:36 +08:00
ripplebiz 40f2ed331a Merge pull request #3639 from radek-sixi/fix/skip-empty-anon-contact-slots
Skip empty anon contact slots in peer/contact lookups (prevent null-key ECDH sink)
2026-10-27 11:29:10 +11:00
Marcel Verdult 2270b931fa fix(esp32): define the RTC backup of ESP32RTCClock once
ESP32Board.h defined _rtc_backup_time and _rtc_backup_magic as static in the
header, so every translation unit that includes it has its own copy, and the
inline members of ESP32RTCClock read and write the copy of the unit they are
compiled in. Today one unit per image uses them; a second one could restore a
copy that setCurrentTime() never wrote. The header now declares them, and
ESP32Board.cpp defines them once.
2026-10-26 16:11:12 +01:00
Scott Powell ab64c87c38 * scope 0 rule fixes 2026-10-26 20:29:39 +11:00
upstream-sync-bot 040b51e807 Merge upstream/dev (10 commits) [upstream-sync] 2026-10-25 01:03:21 +00:00
fdlamotte d65a6b9667 Merge pull request #3659 from fdlamotte/elecrow_eink_refactor
Elecrow eink refactor
2026-10-24 19:50:03 -04:00
ripplebiz 2797dd7ba1 Merge pull request #3643 from marcelverdult/upstream-candidate/companion-channel-txt-min-len
Fix companion crash on a short CMD_SEND_CHANNEL_TXT_MSG frame
2026-10-24 11:40:49 +11:00
ripplebiz 8723caf0df Merge pull request #3646 from marcelverdult/upstream-candidate/af-nan-text-check
Refuse nan and inf for the airtime factor (set af, set dutycycle)
2026-10-24 11:34:10 +11:00
Marcel Verdult e97de59b57 fix(radio): refuse "nan" for the airtime factor
"set af nan" is accepted and stores a NaN in airtime_factor, the duty cycle
budget the roles hand to their airtime accounting. strtof() consumes the
token, so the parse guard does not fire, and no ordered comparison is true for
a NaN, so "af < 0 || af > 9" cannot reject it. "set dutycycle" writes the same
field and has the same hole.

Both commands now check the text before it is parsed: after optional white
space and sign, a number has to start with a digit or a '.'. That refuses
"nan", "inf" and their variants, and keeps every spelling that was accepted
before (signs, leading white space, ".5"). The ranges and both reply strings
are unchanged.

The check is on the text rather than on the parsed float on purpose. nRF52
builds use -Ofast, and under -ffast-math the compiler may assume a float is
never NaN or infinite. A test on the value, even one that reads its bits, can
then be folded away: clang does exactly that with a bit test at -Ofast, while
arm-none-eabi-gcc keeps it. A character test does not depend on that.
2026-10-22 09:42:58 +00:00
Marcel Verdult 97a6ff714c fix(chat): refuse a negative text length for a group message
CMD_SEND_CHANNEL_TXT_MSG reads txt_type, channel_idx and a 4 byte timestamp, so
the frame needs 7 bytes before the text starts, and the branch had no length
guard. For a shorter frame "len - i" is computed in size_t, wraps, and reaches
sendGroupMessage() as a negative int. The clamp there tests
"text_len + prefix_len > MAX_TEXT_LEN", which a negative value passes, and the
following memcpy() converts the length back to a size_t: a 3 byte frame asks for
4294967292 bytes into a 197 byte stack buffer.

Two guards, because there are two mistakes. The branch now states its minimum
like most other branches of handleCmdFrame do, so a frame below 7 bytes is
answered through the existing path instead of being parsed. And
sendGroupMessage() refuses a negative length the way sendGroupData() in the same
file already does, which protects every other caller.

A frame of exactly 7 bytes keeps working and sends an empty message, as before.

Evidence. On a T-Echo running dev c9fa617c, built with
FIRMWARE_BUILD_DATE "f1-dev" and confirmed by "ver => v1.18.0 (Build: f1-dev)":

  CH_TXT len=7    -> RESP_CODE_OK
  GET_STATS core  -> uptime=78s
  CH_TXT len=3    -> NO REPLY
  DEVICE_QUERY    -> NO REPLY  (three times over 8 s, node never came back)
2026-10-22 09:33:07 +00:00
upstream-sync-bot 2f276d60dd Merge upstream/dev (2 commits) [upstream-sync] 2026-10-22 05:06:05 +00:00
Florent afbab2de16 DisplayDriver: fixing alignment issue in vtable for nrf52 and epd display 2026-10-21 17:13:27 -04:00
Florent d1d06b92ab refactoring eink devices behaviour 2026-10-21 14:08:56 -04:00
liamcottle 75ea17ea46 implement new auto detect display for sh1106 and ssd1306 2026-10-21 15:41:11 +13:00
rado adb01c473e Skip empty anon contact slots in peer/contact lookups (prevent null-key ECDH sink) 2026-10-20 05:56:02 +02:00
tthandClaude Opus 5.5 f6fc21d40d nrf52: hardfault recorder v aplikaci a v .noinit (#5)
Recorder nikdy nefungoval: handler byl patch v utility/debug.cpp
frameworku, jenže jádro se linkuje jako archiv a weak HardFault_Handler
ze startupu už vektor pokrývá, takže debug.o se do žádného buildu
nedostal (nm ukazoval jen W symbol). Záznam navíc ležel na 0x2003FFF0,
kam po resetu sahá zásobník bootloaderu.

Handler je teď silný symbol v NRF52Board.cpp a zapisuje do
g_hardfault_record v .noinit; funguje i s commitnutým pinem frameworku
(lokální patch už není potřeba). Ověřeno na x2: testovací build
s -D BENCH_FAULT_CMD, příkaz hardfault → po resetu
'HARDFAULT before last reboot: PC=00033442' = udf v handleCommand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 22:59:02 +02:00
tthandClaude Opus 5.5 7261865583 nrf52: hodiny přežijí warm reset v .noinit (#5)
VolatileRTCClock ukládá čas do g_retained_clock (sekce .noinit, linker
ji dá hned za .bss) a při prvním čtení po warm resetu ho obnoví; po
power-on (RESETREAS 0) ne. Dřívější pokus 7. 8. na vrcholu RAM selhal,
protože tam sahá zásobník bootloaderu — střed RAM přežije: x1 (XIAO,
companion) nastaven +30 dní, reboot, hodiny zpět +30 dní.

BaseChatMesh::bootstrapRTCfromContacts posouvá hodiny už jen dopředu:
bezpodmínečný set vracel čas pod build epoch a rušil obnovu, která
ještě neproběhla (první test proto vyšel negativně).

Repeater: mrtvý mechanismus s pevnou RETAINED_CLOCK_ADDR nahrazen
výpisem stavu obnovy při bootu; ukládání obstarává tick().
Podle weebl2000/meshcore 9a561fd7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 22:17:40 +02:00
rado b2bde37fe4 Fix unsigned conversion of negative TX power in CommonRadioPrefs 2026-10-17 09:36:59 +02:00
upstream-sync-bot 1be4e685af Merge upstream/main (20 commits) [upstream-sync] 2026-10-15 11:56:47 +00:00
tthandClaude Opus 5.5 eb02217497 simple_repeater: filter hash -- runtime deny-forward podle hashe kanálu
Keyless doplněk k ChannelFilter: payload[0] u GRP_TXT/GRP_DATA je hash
kanálu v čistém, takže repeater může odmítnout přeposílat celý kanál bez
znalosti PSK (soukromý 0x43 = 43 % provozu CZ meshe). Kontrola sedí
v MyMesh::allowPacketForward(), tedy bez zásahu do core a před
takeForwardingRateLimit() -- zahozený paket nežere tokeny FairnessLimiteru.
Příjem a rxlog/pktfeed zůstávají nedotčené.

Za běhu přes konzoli i RF admin: `filter hash [add|del <hex>|list|clear]`,
max 8 bajtů, persistováno v prefs (f_dhash, f_dhash_n). Nezávislé na
FILTER_CHANNEL_PSKS.

Lavice 14. 10. (866.5/SF8): x1 DUT, x4 companion posílá do 0x75 a 0x09,
x2 svědek přes rxlog. Bez listu x2 slyší oba i s cestou 8704 (x1);
s `add 75` jen 0x09 přes x1, 0x75 jen přímo; x1 si 0x75 dál loguje;
po rebootu list drží; po `del 75` zase oba.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:34:19 +02:00
ripplebiz 5ec71b8abf Merge pull request #3575 from agessaman/feat/lr1121-dual-band-power
LR1121: keep TX power valid across sub-GHz and 2.4 GHz
2026-10-14 12:04:47 +11:00
ripplebiz 1726ff0e99 Merge pull request #3574 from agessaman/feat/waveshare-esp32s3-lr1121
feat(variants): add Waveshare ESP32-S3-LR1121
2026-10-14 12:00:11 +11:00
tth 958a03d573 Merge remote-tracking branch 'origin/dev'
# Conflicts:
#	src/Mesh.cpp
2026-10-13 19:41:34 +02:00
ripplebiz 1c3d50fce7 Merge pull request #3573 from meshcore-dev/ack-timing-fix
ACK forwarding timing fix
2026-10-13 15:48:29 +11:00
tthandClaude Opus 5.5 0aa6e9a5a6 sensor/budka: komentář k číslování měřáků podle uložených zařízení budky
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:07:15 +02:00
tthandClaude Opus 5.5 1b4fb17fe0 sensor/budka: drobnosti z review před zveřejněním
Prázdná hodnota (`v1=`) se už nebere jako 0, `#error` při ENV_INCLUDE_GPS
(oba chtějí Serial1), komentář u hasMotion()/lastLineMillis() říká, co
funkce vrací, a příklad řádku má neutrální id místo skutečné desky.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:56:56 +02:00
tthandClaude Opus 5.5 eb47a268e8 sensor/budka: každý měřák na vlastním LPP kanálu
Budka teď posílá všechny připojené UC96 jako v<k> i<k> w<k> wh<k>, číslované
podle ID. Čidla budky (t/h/p/mot) zůstávají na jednom kanálu, měřák k dostane
k-tý kanál za ním. Kanály se drží i když měřák chvíli chybí, aby čísla mezi
dvěma dotazy nepřeskakovala jinam. Řádek až 256 B.

Ověřeno na benchi: dva měřáky přes x1 a LoRa do companionu x4 jako ch3/ch4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:32:03 +02:00
tthandClaude Opus 5.5 895dbfdddd sensor: telemetrie z Chytré budky po drátě (BudkaLinkSensorManager)
Budka posílá každých ~30 s po jednosměrném UARTu řádek
`CB1 id=… t= h= p= v= i= w= wh= mot= up=…*XX` (NMEA XOR součet).
BudkaLinkSensorManager je EnvironmentSensorManager + Serial1 RX: řádek se
špatným součtem zahodí celý, hodnoty starší než 2 min do telemetrie
nedává. Všechno z budky jde na jeden LPP kanál za čidly na desce; výkon
jako analog input (LPP_POWER má rozlišení 1 W). TX UARTu je LED_GREEN —
nic se nevysílá a klidová jednička ji drží zhasnutou.

Zapíná se jen -D BUDKA_LINK_RX_PIN=<pin>; bez něj se nic nemění. Nový env
Xiao_nrf52_sensor (upstream pro XIAO nRF sensor neměl).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:56:29 +02:00
agessaman 58721ae6fb fix(radiolib): keep LR1121 tx power valid across sub-GHz and 2.4 GHz
- Clip requested power to the active PA's range instead of failing. A
  stored 22 dBm was rejected at 2.4 GHz (HF PA max 13 dBm), and since
  setTxPower ignores errors the sub-GHz PA stayed configured.
- Re-apply the requested power after every successful retune: PA choice
  depends on the band, and set radio / tempradio only call setParams.
2026-10-11 21:07:05 -07:00
agessaman 223389e936 feat(variants): add Waveshare ESP32-S3-LR1121
ESP32-S3FH4R2 (4MB flash, 2MB PSRAM, native USB-CDC) with an LR1121.
Pins, the DIO5/DIO6 RF switch table and the 1.8 V TCXO follow the HF
schematic and Waveshare's examples. Envs: repeater, room server,
companion USB/BLE and KISS modem, all on min_spiffs so roles share one
partition layout.

Only RFO_HP_LF is wired (R4 on RFO_LP_LF is not fitted), so the new
opt-in LR1121_FORCE_HP_PA flag keeps RadioLib on the HP PA at <= 14 dBm,
where it would otherwise select the unconnected LP PA.
2026-10-11 20:51:18 -07:00
Scott Powell 7369c64752 * ACK forwarding (in direct mode) had zero delay 2026-10-12 10:44:42 +11:00
Scott Powell 68b8163fe7 * treat transport code 0 the same as un-scoped. 2026-10-08 19:56:45 +11:00
tthandClaude Opus 5.5 2386504e2d blepwr/fairness: opravy z review-three
- `blepwr` parsuje striktně (strtol + kontrola celého argumentu a platné
  hodnoty) — `atoi` udělal z „216" −40 a z „abc" 0, a teď se to ukládá.
  Stará syntaxe `blepwr -20 hold` skončí ERR místo tichého uložení −20.
- „saved" jen když zápis do InternalFS opravdu prošel, jinak „NOT saved".
- mast-three env: RPT_BLE_CONN_TX_POWER=8, aby po flashi nenaběhl na 0 dBm,
  na kterých most z bridge-host přes zavřené okno padá.
- FairnessLimiter: opravené odůvodnění 0x00/0xFF — náš companion identitu
  přegeneruje, ale na CZ meshi za 30 dní prošlo 50 floodů od takových
  odesílatelů a u ANON_REQ je payload[1] bajt náhodného klíče (2/256 všech).
  Test přejmenován (cap 100 je teď pod defaultem).
- tools/fairness_replay.py: přehrání floodů z CoreScope přes model limiteru,
  odkud jsou výchozí hodnoty; pro přepočet, až se provoz změní.

Ověřeno na x1: 216/264/abc/„-20 hold"/1 → ERR; 6 → saved → reboot → 6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 23:46:40 +02:00
tthandClaude Opus 5.5 5aac19ac96 fairness: limity podle reálného provozu, 00/ff odesílatelé nejsou rezervovaní
Přehráním 207k floodů z CZ meshe (ob1, 6. 9.–6. 10.) přes limiter: staré
výchozí hodnoty by zahodily 9 % kanálových zpráv, 15 % přímého provozu
a 15 % advertů. Nové výchozí (group 100/30 s, sender 150/10 s, advert
30/600 s) mají za 30 dní nula zahozených s ~2× rezervou; zaseklý odesílatel
nebo bot je pořád oříznutý.

Odesílatel s hashem 0x00/0xFF byl zamítnutý vždy, jenže companiony si
takovou identitu nepřegenerují — jejich uživatelům repeater zahazoval každou
flood DM, PATH i REQ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 22:33:05 +02:00
tthandClaude Opus 5.5 89a50b8542 Merge remote-tracking branch 'origin/dev'
Konflikty:
- ESP32Board.h: upstream obnovuje čas z RTC backupu přes všechny resety;
  záchytná hodnota je teď novější z FIRMWARE_BUILD_EPOCH (náš stamping)
  a RTC_TIME_MIN.
- t1000-e: upstream sloučil sleep_gps() do stop_gps() (drží VRTC + Airoha
  RTC backup sleep) ⇒ gps duty používá stop_gps(), sleep_gps() zrušen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:28:45 +02:00
taco c10ea278ff tidy: remove old commented Bluefruit.autoConnLed(false) 2026-10-02 07:40:42 +10:00
taco ec565e06bf fix bad comment format 2026-10-02 07:35:34 +10:00