Commit Graph
1323 Commits
Author SHA1 Message Date
Florent 8d5bd2e2c7 eink: some updates (busy loop + hibernate when screen off) 2026-11-10 11:52:38 -04:00
fdlamotte 2367886a4c Merge pull request #3724 from akalinin-softvelum/feature/eink-busy-hook-v2
companion: keep mesh/BLE running during e-ink refresh
2026-11-10 08:40:43 -04:00
fdlamotte b7ab9fbc6f Merge pull request #3725 from Blake-Latchford/fix/espnow-no-lora-build
Fix Generic_ESPNOW_* builds on boards without a LoRa radio
2026-11-10 08:25:37 -04:00
fdlamotte ad97616894 Merge branch 'dev' into feature/lilygo-t3-stm32 2026-11-10 08:22:52 -04:00
fdlamotte 62ae611afd Merge pull request #3753 from fdlamotte/gps_refactor
Big GPS refactor
2026-11-10 07:44:00 -04:00
fdlamotte 544514f5b4 Merge pull request #4 from AlexandrTyshchenko/feature/gps-guard-refactor
GPS: optional anti-spoofing guard for position and time (GPS_GUARD)
2026-11-09 18:02:06 -04:00
Olexandr Tyshchenko 8c7e1a8f5d GPS guard: gps guard on/off, saved in the GPS prefs 2026-11-09 23:50:48 +02:00
Olexandr Tyshchenko d72f67d37b GPS guard: save gps fence in the GPS prefs 2026-11-09 23:16:29 +02:00
Olexandr Tyshchenko cbfa66df9d NmeaGpsDriver: baud rates to probe come from the board, not a build flag 2026-11-09 22:59:47 +02:00
Olexandr Tyshchenko fbd20ac64b GpsGuard: let GPS correct a clock outside the plausible window 2026-11-09 22:54:18 +02:00
Olexandr Tyshchenko eea64ffb74 GPS guard: drop time force, it goes to a separate PR 2026-11-09 22:30:24 +02:00
Olexandr Tyshchenko 181041ac64 GpsGuard: do not show a stale time ok without a current trusted fix 2026-11-09 22:15:45 +02:00
Olexandr Tyshchenko d644f0a516 GPS: optional anti-spoofing guard for position and time (GPS_GUARD)
A spoofed GPS signal can move a fixed node anywhere and set its clock to
any time; the clock only moves forward, so a time pushed into the future
breaks timestamps and replay protection until fixed by hand.

With GPS_GUARD, MicroNMEALocationProvider asks a GpsGuard before a fix is
stored as the last fix (satellites, HDOP, optional region box, fence
around the configured position, jump speed, N stable fixes) and before
GPS time is written to the clock (trusted fix current, not before the
build date, small steps once the clock is valid, drift-sized after the
first sync). Without a trusted fix no live position is reported.

CLI in CommonGpsPrefs: 'gps guard', 'gps guard accept', 'gps fence',
'gps ref'; CommonCLI keeps the reference on set lat/lon and gps setloc,
resets the time anchor on manual clock sets and adds 'time force'.

Ported from #3736 onto the GpsDriver/LocationProvider refactor.
2026-11-09 20:43:09 +02:00
Olexandr Tyshchenko 4069f4809c NmeaGpsDriver: optional UART baud rate autodetection (GPS_BAUD_AUTODETECT)
Bytes arriving on the UART does not mean the baud rate is right: at the
wrong rate the parser only sees garbage and never gets a fix. Modules
such as the M5Stack GROVE GPS now default to 115200, while boards
configure 9600.

With GPS_BAUD_AUTODETECT, detect() probes common GNSS rates, starting
with the configured one, and keeps the first one that yields an NMEA
sentence with a valid checksum. The rate is stored in the driver, so
later power cycles reopen the UART with it. Without the flag nothing
changes.

Ported from #3729 onto the GpsDriver refactor.
2026-11-08 23:24:29 +02:00
Martin Boissonneault 666949fae4 rak4631: let the serial GPS switch the WB_IO2 rail (opt-in)
On a RAK19007 the RAK12501's supply is 3V3_S, switched by WB_IO2, so
gps off, periodic mode and shutdown left it powered. Pass WB_IO2 to the
NMEA driver as peripheralPower under GPS_RAIL_POWER_CONTROL, set by the
new RAK_4631_repeater_gps_power env. It is opt-in because the rail feeds
every slot module, and refused with ETHERNET_ENABLED (RAK13800).

The RAK12500 (I2C) driver keeps switching its own power pin, so this
only applies on the NMEA path.

RefCountedDigitalPin now sets OUTPUT on claim and release: WB_IO2 left
as an input (as probeRak12500() leaves it after a failed probe) keeps
3V3_S in its last state, so writing the latch alone did not cut it.

Measured with a KM003C, battery and panel out: gps off 40.5 -> 12.4 mA,
shutdown 29.7 -> 1.30 mA.
2026-11-08 08:47:35 -04:00
Florent 6c9600e1e7 gps: Rework the CLI
- more consistency with other cli commands
- new format for gps fix
- gps format accepts postfix (s/m/d/h)
- documentation
2026-11-08 08:47:35 -04:00
Florent c06def2f41 gps: once command 2026-11-08 08:47:35 -04:00
Florent 38fa18efb7 gps: move detection into LocationProvider, remove the legacy constructor 2026-11-08 08:47:34 -04:00
Florent 839bb165fc gps: guard the clock sync against stalled and too old fixes 2026-11-08 08:47:34 -04:00
Florent d71a418748 gps: serial pin and configuration fixes (nrf52, meshadventurer, tracker_v1, heltec_tracker) 2026-11-08 08:47:34 -04:00
Florent d49621c805 gps: fix_stats command 2026-11-08 08:47:34 -04:00
Florent fa7ca3f418 rak_gps: simplify the rak driver, which now only handles i2c, for nmea use nmea driver directly 2026-11-08 08:47:34 -04:00
Florent 4ac1ed1d9e gps: periodic acquisition rules (timeout, sats and settle time), isEnabled renamed isActive 2026-11-08 08:47:34 -04:00
Florent 36b53d8de9 gps: cache the last fix in LocationProvider (isValid vs hasValidFix), fix and status commands 2026-11-08 08:47:34 -04:00
Florent fe6a47d0c9 gps: move the gps CLI to GpsPrefs and convert all targets 2026-11-08 08:47:34 -04:00
Florent df5a768c5d gps: add GpsDriver, handle the hardware and software switches in the drivers 2026-11-08 08:47:34 -04:00
agessaman 322cd638fb Merge remote-tracking branch 'upstream/dev' into feat/kiss-agc-fem-control 2026-11-06 20:38:01 -08:00
ripplebiz 5533c24fde Merge pull request #3715 from Amoulier/fix/radiolib-rx-error-counter
Initialize the RadioLib receive error counter
2026-11-01 13:19:47 +11:00
R0ck c79500e6ad radiolib: drop received packets whose LoRa header says no CRC. 2026-10-30 14:05:25 +00:00
Olexandr Tyshchenko 017db61cae 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
akalinin-softvelum 05423e516a companion: keep mesh/BLE running during e-ink panel refresh
Use GxEPD2's busy callback to run the mesh, interface and sensor loops
(loopCore(), shared with loop()) while the panel refreshes, instead of
blocking the main loop. Covers the partial refresh in endFrame(), the
full wipe in startFrame(), and the sleep icon / blank refresh on turnOff().
2026-10-29 12:38:30 +00:00
fdlamotte 04d72b1049 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 5d7100ae7d ui: add some parameters to the cli (mostly regarding eink behaviour) 2026-10-29 08:34:41 -04:00
ripplebiz cf286687d2 Merge pull request #3682 from meshcore-dev/fix-scope-zero
scope 0 rule fixes
2026-10-29 12:17:09 +11:00
Blake LatchfordandClaude Opus 5.5 106b5f122e Fix Generic_ESPNOW_* builds on boards without a LoRa radio
Compile out code when the corresponding macro defines are missing.
Failing builds: comp_radio_usb, repeatr, room_svr,
terminal_chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 20:46:00 -04:00
Amoulier f688d99baf Initialize the RadioLib receive error counter 2026-10-28 18:56:16 -04:00
ripplebiz 02c827b27d 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 93ddc86db6 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 fd56b1a36c 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 b0bacf8a04 fix(radio): put LR2021 in standby before re-config in setParams 2026-10-27 10:44:36 +08:00
ripplebiz d694bd39c7 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 e197e557c3 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 bd882a2aa2 * scope 0 rule fixes 2026-10-26 20:29:39 +11:00
fdlamotte ea8e95447f Merge pull request #3659 from fdlamotte/elecrow_eink_refactor
Elecrow eink refactor
2026-10-24 19:50:03 -04:00
ripplebiz cd9f97fd4a 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 61363a3309 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 83bd824f6c 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 56b5f4e9c6 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 428a95c6, 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
Florent 408d674ace DisplayDriver: fixing alignment issue in vtable for nrf52 and epd display 2026-10-21 17:13:27 -04:00
Florent a31e2c92df refactoring eink devices behaviour 2026-10-21 14:08:56 -04:00