Commit Graph
1320 Commits
Author SHA1 Message Date
agessaman fcd92e985f feat(display): add R8 observer TFT dashboard, touch toggle and display.timeout
Replace the sparse Heltec V4 R8 observer home screen with a padded dark
analytics dashboard, add manual display control, and make blanking a runtime
setting.

Dashboard (DISPLAY_ACTIVITY_DASHBOARD, the four R8 TFT observer envs):

- RadioActivityWindow: 20 one-minute buckets of valid RX packets, no heap.
  The caller's 32-bit millis() is extended to a monotonic 64-bit clock, so
  nothing downstream has a rollover case; an always-on node passes 2^32 ms
  after ~49.7 days, which would otherwise re-enter warm-up and divide 20
  minutes of traffic by seconds. Rates use 19 whole minutes plus the elapsed
  part of the current one rather than a fixed 1200 s.
- ObserverDashboard: header, radio strip, headline totals, a 20-bar
  packets-per-minute graph and RF/status footers, with separate portrait and
  landscape layouts. A text row is a fixed 16 px, which is 3.2 logical units
  in portrait but 4.27 in landscape, so one shared grid would overlap.
  Text is trimmed by character budget, not measured width: getTextWidth()
  reports an over-long string at the portrait driver's fallback scale, so
  DisplayDriver::drawTextEllipsized() under-trims and the row renders at half
  height.
- Six per-row signatures computed from what is actually drawn, so only the
  rows whose pixels changed repaint. No startFrame(), no whole-screen clear.
  Link state moved out of the full-frame signature, so a DHCP renewal or WiFi
  flap repaints one footer row instead of the panel.
- Dark theme by retuning the UIColor statics at runtime, which needs no
  display-driver edit and carries boot, setup, reboot and power-off with it.

Touch and button (DISPLAY_TOUCH_TOGGLE):

- CHSC6X at I2C 0x2E, polled; TP_INT is unusable (optional R13, and GPIO 43
  is U0TXD). The point-count byte is tested against a valid count, never
  against non-zero: an idle read returns 0xFF, which reads as a finger held
  down forever and latches the tap detector after one event.
- turnOff() no longer parks PIN_TFT_RST low on this board. GPIO 21 is a
  shared LCD_RST/TP_RST net, so doing that held the touch controller in
  reset for as long as the display was off. Verified against Heltec's
  expansion-board and mainboard schematics and the V4-R8 datasheet pinout,
  which also correct the pin comment in HeltecV4R8Board.cpp.
- The USER button click now toggles the display too; it previously did
  nothing whenever the display was already on.

display.timeout:

- `set display.timeout <secs>` / `get display.timeout`, 0 = stay on, 60 s
  default, 3600 max. Read live, so a change applies without a reboot and
  restarts the countdown rather than firing on the old deadline.
- Stored in MQTTPrefs (/mqtt.json), keeping NodePrefs aligned with upstream.
  Runtime-only: LegacyV1MQTTPrefs and the four frozen binary payload sizes
  are unchanged. No JSON format-version bump - the loader skips keys no
  def() claims, so older firmware reads newer files and this firmware reads
  older ones with the default applied. Both directions are covered by tests.
- Joins the observer atomic-setter contract, so a failed save rolls the live
  value back instead of only claiming to.

New periodic work uses a wrap-safe deadline check; `millis() >= deadline`
fires every loop for a whole interval before each rollover.

Adds test_radio_activity_window, test_observer_dashboard (driving the real
renderer against a recording DisplayDriver in both orientation profiles) and
test_touch_tap_detector. 440 native cases pass.
2026-08-28 13:39:16 -07:00
agessaman fc361ca94b feat(display): add R8 portrait observer layouts 2026-08-28 09:21:38 -07:00
agessaman 85fd9b09be fix(boards): update Heltec V4 R8 TFT LEDA control to active HIGH 2026-08-28 07:44:16 -07:00
agessaman 4a58d8076c fix(boards): initialize Heltec V4 R8 TFT 2026-08-23 16:34:27 -07:00
agessaman c5d987df70 fix(boards): reset Heltec V4 R8 TFT on GPIO 21
GPIO 21 is the Expansion Kit V2 panel reset, not touch reset.
Leaving RST unwired left the ST7789 blank after a bogus touch pulse.
2026-08-23 15:42:52 -07:00
agessaman 0cc6fdfea6 Add Heltec V4 R8 FEM LNA controls 2026-08-20 21:48:47 -07:00
Adam Gessaman 2358b750ae feat(mqtt): add Heltec V4 R8 configurations for MQTT observer and room server 2026-08-20 20:50:22 -07:00
agessaman 6c0ae4d249 merge: upstream/dev into observer-firmware-dev (v1.17.1)
Picks up upstream MeshCore 1.17.1.

Notable upstream content:
- 1.17.1 version/build-date bump in the example MyMesh headers.
- nRF52: combine radio entropy with CC310 RNG.
- Companion FEM prefs: load/save of fem_ properties commented out until they
  can be set from the client.
- Scoped reply routing: replies no longer dropped when flood.max.unscoped is
  low (RoutingPolicy + unit tests).
- nRF52 unused-pin sweep (T1, T-Echo Lite, MeshPocket).

No conflicts.
2026-08-14 08:09:07 -07:00
taco 7cd1d207af Fix LilyGo T-Echo Lite SPI pins 2026-08-13 00:53:58 +10:00
agessaman ced0eb3780 merge: upstream/dev into observer-firmware-dev
Brings in the external FEM gain preferences (fem_txgain, PR #3137 plus the
companion-side port), the AGC reset rxgain fix, the LR2021 preamble/IRQ
timeout logic, and assorted variant fixes (T096, T-Echo Card TCXO, promicro
pinmap, minewsemi, R1 Neo).

Conflict resolutions:

- SH1106Display: both sides fixed T-Beam Supreme startup independently. Kept
  our _initialized guard and DISPLAY_ADDRESS_ALT override, took upstream's
  SA0-pair fallback and its unconditional display.begin() so the frame buffer
  is allocated even when no panel answers.
- MyMesh/SensorMesh/CommonCLI: took upstream's fem_txgain default and wiring,
  kept our comments and the observer-side prefs layout.

Also fixes CustomLLCC68Wrapper, which upstream missed when sx126xResetAGC
gained its rx_boost_gain parameter. No variant builds that wrapper today, so
neither tree failed to compile.
2026-08-12 07:19:19 -07:00
taco c2a4ef082f Fix Heltec MeshPocket SPI pins 2026-08-13 00:15:34 +10:00
taco 3ea541f1f2 Fix Heltec T1 pin definitions
SPI pins that are set to -1 cause OOB reads on NRF52. The unused Serial2 pin definitions were removed to avoid potential issues with the Uart framework.
2026-08-13 00:12:37 +10:00
ripplebiz e9edfc8e1a Merge pull request #3188 from oltaco/heltec-t096-pin-fix
Fix Heltec T096 Tx issue
2026-08-12 23:00:31 +10:00
taco 49d9f9a839 Heltec T096: fix PIN_SPI1_MISO
Setting SPI pins to values that are OOB of the g_ADigitalPinMap[] array causes OOB reads. This variant.h has pin 0 as 0xFF which passes through as NRFX_SPIM_PIN_NOT_USED.
2026-08-12 22:31:57 +10:00
taco 264d778168 Revert "T096 PA_CTX pin direction workaround"
This reverts commit 82de18fb0e.
2026-08-12 22:28:05 +10:00
ripplebiz 956094b271 Merge pull request #3185 from oltaco/fix-techo-card-txco-voltage
Set T-Echo Card TCXO voltage to 3.0
2026-08-12 18:13:44 +10:00
ripplebiz a4ab7f0e59 Merge pull request #3137 from agessaman/feat/station-g3-fem-prefs
Station G3: Expose, persist, and apply FEM gain preferences
2026-08-12 16:11:23 +10:00
taco 9d6dcc673e set T-Echo Card TCXO voltage to 3.0
as per https://github.com/meshcore-dev/MeshCore/pull/3140 and https://github.com/Xinyuan-LilyGO/T-Echo-Lite/issues/14
2026-08-12 16:08:05 +10:00
taco 82de18fb0e T096 PA_CTX pin direction workaround 2026-08-12 14:07:31 +10:00
Rastislav Vysoky 5cce5cfe97 removed misleading 'GPIO' from pin numbers 2026-08-11 10:37:20 +02:00
agessaman 28dd599fa8 fix(observer): recover T-Beam Supreme display startup 2026-08-10 12:59:02 -07:00
Rastislav Vysoky a82dc1b9da make promicro pinmap more tidy, move the LoRa pins to variant.h 2026-08-10 20:13:59 +02:00
ripplebiz 9941669fd5 Merge pull request #3142 from oltaco/buildfix-userbtn
Build fix for R1 Neo and Minewsemi repeater
2026-08-10 13:30:24 +10:00
agessaman f9968ac1a5 merge: upstream/dev into observer-firmware-dev (v1.17.0)
Picks up upstream MeshCore 1.17.0 and the dev commits that followed it.

Notable upstream content:
- 1.17.0 version/build-date bump in the example MyMesh headers.
- anon_req hardening: reply_path_len is now uint8_t with an isValidPathLen()
  bounds check and a 0xFF sentinel; reply_path_hash_size is gone.
- LR2021 support (Meshnology W12, Seeed MeshTracker X1) incl. side detectors,
  multi-SF and the new `extra.sf` get/set CLI.
- CustomLFS 0.2.2 -> 0.2.3 (GD25Q64C support).
- kiss_modem envs for several nRF52 variants; ThinkNode M6 GPS/flash fixes.

Conflicts resolved:
- platformio.ini: took upstream's CustomLFS 0.2.3, kept our lib_ignore for
  the vendored PsychicMqttClient.
- CommonCLI.h: kept both upstream's USE_LR2021 configSideDetectors() hook and
  our fault-alert callbacks.

NodePrefs gains upstream's extra_sf[4], which is not registered with
ConfigSerializer, so /prefs.json layout is unchanged.

Verified: 275/275 native host tests pass; Heltec_v3_repeater_observer_mqtt,
Heltec_v3_repeater and heltec_v4_repeater_observer_mqtt all build.
2026-08-09 06:32:53 -07:00
Huw Duddy a1c50e15dd Merge pull request #3148 from recrof/add-missing-kiss-radio
add missing kiss radio roles, add kiss radio build to build.sh
2026-08-09 22:22:08 +10:00
Rastislav Vysoky c2d57f08c8 add missing kiss radio roles, add kiss radio build to build.sh 2026-08-09 14:17:18 +02:00
Huw Duddy f310afb5e5 Merge pull request #3140 from entr0p1/fix/techo-lite-pins
Lilygo T-Echo Lite Pin Fixes
2026-08-09 22:06:21 +10:00
taco 39934d6999 minewsemi: build fix and platformio.ini tidy up
fixes minewsemi repeater failing build due to user_btn missing.
2026-08-09 18:33:27 +10:00
taco e8bbcd4580 R1 neo: remove stray lib_deps entry 2026-08-09 16:51:45 +10:00
taco b75a548d7f build fix for R1 Neo repeater
added missing declarations for user_btn and NullDisplayDriver
2026-08-09 16:50:44 +10:00
entr0p1 5732b2edd8 Lilygo T-Echo Lite Pin Fixes
- Aligned to Lilygo's updated schematic and pin map as per https://github.com/Xinyuan-LilyGO/T-Echo-Lite/issues/14
2026-08-09 14:09:35 +10:00
ripplebiz 48df179e36 Merge pull request #3139 from oltaco/x1-flash
Add QSPIFlash support for Seeed MeshTracker X1
2026-08-09 13:52:56 +10:00
taco 02ec123eb8 add QSPIFlash support for Seeed MeshTracker X1 2026-08-09 11:41:09 +10:00
Adam Gessaman c58c9b2f31 fix(station-g3): apply FEM PA level at TX start
PA PL1 re-targets the PA's DC-DC supply rail rather than selecting a
logic-level gain, and the serial CLI is serviced on every main-loop pass
regardless of whether a transmit is in flight. A `set radio.fem.txgain`
write could therefore move the rail mid-transmit, while the SX1262 was
still driving the PA at full input power.

Record the requested level in setPAGainEnable() and drive the pin from
setTxModeEnable(), which runs from onBeforeTransmit() ahead of
startTransmit(). The level only matters while transmitting, so deferring
costs nothing.

Document that the pref is saved immediately but applied at the next
transmit, so `get radio.fem.txgain` can lead the hardware until then.
2026-08-08 14:53:57 -07:00
agessaman 75d4656e59 chore(variants): drop the dead MAX_MQTT_BROKERS build flag
Nothing has ever read it. The slot count comes from two other places: the
persisted array size (MAX_MQTT_SLOTS / RUNTIME_MQTT_SLOTS in MQTTPresets.h) and
the runtime cap MQTTBridge::getMaxActiveSlots(), which answers 5 with PSRAM and
2 without. A flag reading MAX_MQTT_BROKERS=3 sitting in every observer env
implies a third, lower limit that does not exist — it cost me a wrong answer
about how many MQTT slots a Heltec V4 exposes.

36 lines across 15 variants, all of them =3. Removing an unread -D cannot change
code: heltec_v4_repeater_observer_mqtt builds to a byte-identical size before and
after (1647744). The image checksum does differ, but so does it between two
clean builds of untouched source — ESP-IDF stamps the app descriptor with the
build time — so size is the meaningful comparison here.

All 606 envs still parse; heltec_v4, heltec_v3, station_g2, rak3112 and
xiao_s3_wio observer targets all build.
2026-08-08 08:28:18 -07:00
agessaman b27b475d3c feat(variants): add I2C sensor pins to Heltec/RAK3112 observers
Match Heltec_v3_sensor and RAK_3112_sensor Wire1 pins (33/34) so
external sensors work on observer_mqtt builds.
2026-08-07 15:12:17 -07:00
Hacuchino-hash 2af4b3c14a Fix X1 charge status LED always showing charged 2026-08-07 08:08:08 -05:00
agessaman 23066573e5 fix(station-g3): expose FEM gain preferences 2026-08-06 15:29:14 -07:00
agessaman f156c0bd2a fix(boards): restore Station G2 GPS UART pin mapping
Match MCU RX=7 / TX=15 used by G3 and Meshtastic; the prior
values were an accidental revert of 0920dc66.
2026-08-06 09:02:19 -07:00
Hacuchino-hash 335ebf546d Add SPA06 barometer telemetry and charge status LED for MeshTracker X1 2026-08-06 07:27:05 -05:00
Hacuchino-hash 3abe415cf7 Add RGB LED and haptic notifications for SenseCAP MeshTracker X1 2026-08-06 07:27:05 -05:00
Rastislav Vysoky e4fbd386af ThinkNode M6: Remove QSPIFLASH=1 build flag to fix companion roles
M6 doesn't have flash chip available, so companion roles fail to start.
2026-08-06 12:37:21 +02:00
Hacuchino-hash 3d6a891586 Add support for Seeed SenseCAP MeshTracker X1 (LR2021) 2026-08-05 05:50:21 -05:00
ripplebiz 84e3a67bd7 Merge pull request #3115 from oltaco/meshnology_w12
Add support for Meshnology W12 and LR2021 Wrapper
2026-08-05 15:04:00 +10:00
taco 7cc16366cb add Meshnology W12 support and LR2021 wrapper 2026-08-05 14:23:29 +10:00
fdlamotte d6c2da98aa Merge pull request #2863 from benskigomez/fix/m6-gps-reset-pin
thinknode_m6: don't drive GPS REINIT pin so the L76K is detected
2026-08-03 21:16:59 -04:00
agessaman 126a2564ed Merge remote-tracking branch 'upstream/dev' into observer-firmware-dev 2026-08-03 11:02:13 -07:00
agessaman a3a0a94dc4 feat(mqtt-neighbors): support non-PSRAM observer boards
Neighbors publication was gated on BOARD_HAS_PSRAM. Removing that gate alone
was not enough: the feature built but was inert without PSRAM, because three
allocation sites asked for MALLOC_CAP_SPIRAM (which returns null with no
PSRAM), the bridge's persistent buffer was allocated inside a BOARD_HAS_PSRAM
block, and neighborDiscoverReady() rejected every pass at runtime on
psramFound(). The entry table also did not fit: finishNeighborDiscover put
pubkey_hex[50][65] plus entries[50] on the stack, a 4752-byte frame against
the mesh loop task's 8 KB.

- Gate on MAX_NEIGHBOURS plus PSRAM or an explicit per-variant
  MQTT_NEIGHBORS_WITHOUT_PSRAM opt-in.
- Move the entry table and its hex strings into one heap block sized to the
  pass; the frame drops from 4752 to 304 bytes.
- Prefer PSRAM and fall back to internal DRAM in the mesh-side allocations
  and the ArduinoJson pool; hoist the bridge's persistent buffer out of the
  BOARD_HAS_PSRAM block (psram_malloc already falls back).
- Keep the runtime psramFound() check only where the buffers are sized for
  PSRAM, so a board whose PSRAM failed to init still refuses.
- Size for internal DRAM without PSRAM: 4 KB text buffer and 20 entries per
  publish, keeping the pool to a single block and the peak near 13 KB rather
  than ~35 KB. Oversized tables truncate and report total_neighbors as before.

Enabled on the ESP32-S3 observer envs (Heltec V3/WSL3, RAK3112, Heltec
Tracker v1.1/v2). Left off for the classic ESP32 T-LoRa V2.1-1.6, which is
already limited to one active TLS slot.

Costs ~7.4 KB static DRAM on repeaters and ~9.6 KB on room servers. The
prefs layout is unchanged, so this is neutral for existing devices.
2026-08-03 10:29:54 -07:00
me ae1b610a94 fix: M5Stack Unit C6L merged.bin fails to boot (flash_mode qio->dio)
Board manifest for esp32-c6-devkitm-1 defaults build.flash_mode to qio,
which this module's flash chip does not support -- causes a boot
crash-loop (repeated USB-Serial-JTAG reconnects) on real hardware.
Override with board_build.flash_mode = dio in the common M5Stack_Unit_C6L
section so it applies to all envs (ble/usb/repeater/room_server).
2026-08-01 22:20:20 -07:00
agessaman 37444be7b5 feat(thinknode-m7): add repeater and room server observer variants
Adds ThinkNode_M7_repeater_observer_mqtt and
ThinkNode_M7_room_server_observer_mqtt, following the Station G3 observer
overlay: adafruit-full cert bundle, MQTT bridge + SNMP, pinned observer
lib_deps, and the quieter default logging profile.

WiFi-only for now. The M7 has an onboard CH390 Ethernet controller (used by
ThinkNode_M7_companion_radio_ethernet, and an lwIP netif so the MQTT data path
would work over it), but the bridge's link management is bound to the WiFi
station API, so Ethernet cannot carry MQTT yet.

The board has PSRAM, so MAX_NEIGHBOURS=50 enables WITH_MQTT_NEIGHBORS —
verified present in both images. Builds use 46.5% of the 3.19 MB app slot at
13.7% RAM, and build.sh emits the full artifact set (.bin, -merged.bin,
.partsig). The partition table is inherited from [ThinkNode_M7] unchanged, so
no merged first flash is needed; its signature is byte-identical to the T-Beam
Supreme observer builds (both default_8MB.csv).

Also fixes two pre-existing build failures on this board:

- [ThinkNode_M7] re-added a blanket helpers/*.cpp after arduino_base excludes
  the MQTT-only sources, so every M7 env failed on a missing Timezone.h. The
  glob was otherwise fully redundant with the base, so it is dropped rather
  than re-excluding the two files.
- ThinkNode_M7_companion_radio_ethernet sets DISPLAY_CLASS=NullDisplayDriver
  but never compiled NullDisplayDriver.cpp, which defines UIColor::window_bkg,
  so it failed at link. The ble and wifi envs both already list it.

All nine M7 envs now build. Observer env discovery picks up both new envs, and
the ArduinoJson pin check covers both new sections.
2026-07-31 09:34:42 -07:00