Commit graph

187 commits

Author SHA1 Message Date
GlassOnTin
c31b1908a7 Add SPM1423 PDM microphone driver, fix speaker I2S port
Microphone on I2S_NUM_0 (PDM hardware constraint), speaker moved to
I2S_NUM_1. Both init at boot, shut down before deep sleep.
Mic provides raw audio read and RMS level measurement.
Boot beep disabled (speaker confirmed working).
2026-03-27 19:08:26 +00:00
GlassOnTin
8dd50ac901 Add MAX98357A I2S speaker driver with tone generator
I2S audio output on GPIO 9/10/11 (BCLK/WCLK/DOUT). Sine wave tone
generator with predefined alert sounds: beep, alert, success, error.
Boot beep confirms speaker is working. Speaker shut down before deep
sleep to release I2S driver.
2026-03-27 19:00:48 +00:00
GlassOnTin
deb061943a Add CST9217 touch panel with touch-to-wake display blanking
Touch driver via SensorLib TouchDrvCST92xx on I2C 0x1A with interrupt
on GPIO 12. Touch events unblank the display and reset the blanking
timer. Display blanks after 10 seconds of inactivity.

XL9555 TOUCH_RST now explicitly released at boot. Touch init runs
with explicit I2C_SDA/I2C_SCL pins (same fix as XPowersLib).
2026-03-27 18:48:07 +00:00
GlassOnTin
84c7b886c4 Add BHI260AP sensor hub with deferred init
BHI260AP firmware upload (~260KB at 1MHz I2C) takes ~10 seconds and
blocks the main loop. Moved init from setup() to a deferred check in
the main loop that runs once after 5 seconds when hw_ready is true.
This allows the radio and serial to come up immediately while the
sensor firmware uploads in the background.

Also restores XL9555 DRV_EN and DISP_EN enables at boot (lost during
earlier git checkout/stash operations).
2026-03-27 18:03:33 +00:00
GlassOnTin
9f034e8d0d Add DRV2605 haptic driver with boot and sleep feedback
Minimal I2C driver for the DRV2605 ERM vibration motor. 117 built-in
effects via the ERM effect library. Named constants for watch use
cases (click, bump, alert, buzz, tick, etc.).

Boot: sharp click on startup. Sleep: soft bump before entering deep
sleep. XL9555 DRV_EN and DISP_EN now explicitly enabled at boot.

Updated Makefile upload-twatch_ultra to set firmware hash after JTAG flash.
2026-03-27 17:45:01 +00:00
GlassOnTin
b9319fa761 Fix deep sleep: remove PMU enableSleep, fix GPIO handling, add shared helper
Three critical fixes:
- Remove PMU->enableSleep() which bricked AXP2101 I2C across resets
- Remove I2C pins (GPIO 2/3) from OPEN_DRAIN list — gpio_reset_pin()
  already sets INPUT mode, and OPEN_DRAIN persists in battery-backed
  RTC domain, corrupting the I2C bus
- Use esp_reset_reason() == ESP_RST_DEEPSLEEP for reliable cold boot
  vs timer wake discrimination

Extracted twatch_enter_deep_sleep() shared helper used by both
sleep_now() and beacon_wake_cycle(). Adds co5300_sleep() call
before SPI.end() to properly shut down display controller.

Tested: sleep via long-press, wake via button, radio reconnects,
display re-initialises, I2C bus intact across multiple cycles.
2026-03-27 17:08:05 +00:00
GlassOnTin
999933386b Fix I2C bus failure — XPowersLib was using wrong default SDA/SCL pins
Root cause: XPowersAXP2101(Wire) constructor defaults to SDA=8, SCL=9
(from generic esp32s3 variant pins_arduino.h). Its begin() method then
calls Wire.begin(8, 9), overriding our Wire.begin(3, 2). All I2C
traffic went to the wrong GPIO pins.

Fix: pass explicit I2C_SDA, I2C_SCL to the XPowersAXP2101 constructor
so it uses GPIO 3/2 (the T-Watch Ultra's actual I2C pins).

Also removed I2C diagnostic/recovery code that was debugging the
wrong problem.
2026-03-27 16:31:10 +00:00
GlassOnTin
f024489aee Add T-Watch Ultra PCB reference photos
Three photos from disassembly session:
- PCB overview with back cover removed
- PCB closeup showing component labels
- Battery connector detail

Factory firmware reflashed to verify hardware integrity. I2C bus and
display confirmed working under LilyGo firmware. RNode firmware I2C
init needs debugging — Wire.begin succeeds but no slaves respond.
2026-03-27 15:53:18 +00:00
GlassOnTin
6ad9abe74d Debug display + fix I2C bus bricked by deep sleep GPIO config
Key finding: deep sleep GPIO OPEN_DRAIN configuration persists in the
battery-backed RTC domain, corrupting the I2C bus across reboots.
Wire.begin() returns false after deep sleep has been entered once.

I2C bus recovery attempt added (SCL clock-out + STOP condition) but
Wire (I2C0) peripheral remains stuck. Wire1 (I2C1) works on same pins
but no slave devices respond — bus lines may be held by stuck slaves.

Found from schematic: XL9555 DOES control VC_EN (display VCI power).
Display QSPI pins confirmed correct from schematic (sheet 4).
BHI260AP SensorLib removed (was causing boot failure due to firmware blob size).
Beacon wake cycle still disabled pending I2C fix.

Critical TODO: fix deep sleep to not set I2C pins to OPEN_DRAIN,
or add robust I2C bus recovery in early boot before PMU init.
2026-03-27 13:46:00 +00:00
GlassOnTin
ae02c5c4af Add BHI260AP sensor hub integration for display GPIO expansion
Added SensorLib dependency (v0.3.1) with BHI260AP GPIO firmware
for controlling display power gate, haptic driver, and touch reset
via the sensor's auxiliary GPIO pins.

Fixed beacon wake cycle triggering on cold boot — disabled pending
proper deep sleep vs cold boot discrimination.

Display status: BHI260AP begin() returns false (firmware upload
failing). CO5300 QSPI driver still cannot reach display controller.
Both issues under investigation.
2026-03-27 13:01:20 +00:00
GlassOnTin
09d1f6409f Add R-Watch (T-Watch Ultra) board support with LoRa, GPS, PMU, RTC, and deep sleep
Board definition (BOARD_TWATCH_ULT = 0x45) for LilyGo T-Watch Ultra
with verified pin mapping from LilyGoLib hardware docs.

Working subsystems:
- SX1262 LoRa radio: online at 868 MHz, tested with rnsd/Reticulum
- AXP2101 PMU: all power rails configured, battery monitoring, charging
- MIA-M10Q GPS: UART at 38400 baud, TinyGPSPlus NMEA parsing
- PCF85063A RTC: time read/write, GPS sync infrastructure
- XL9555 GPIO expander: I2C driver, LoRa antenna switch
- BLE: initialized, KISS protocol responsive
- Deep sleep: button wake (PMU IRQ GPIO 7), timer wake for beacon
- Beacon sleep cycle: periodic wake for GPS beacon TX in standalone mode

New files:
- VISION.md: R-Watch product vision document
- XL9555.h: minimal I2C GPIO expander driver
- CO5300.h: QSPI AMOLED display driver (not yet functional)

Display driver (CO5300.h) is written but disabled (HAS_DISPLAY=false).
QSPI init succeeds but pixel writes don't reach the display controller.
Suspected XL9555/BHI260AP GPIO expander pin mapping issue under investigation.
2026-03-27 12:18:46 +00:00
GlassOnTin
033ddd6757 Add GPS beacon and LXMF telemetry for T-Beam Supreme and Heltec V4
Standalone GPS beacon mode: when no KISS host is connected for 15s,
the RNode transmits position and battery telemetry over LoRa.

Two beacon paths:
- LXMF (recommended): encrypted per-packet messages with announces,
  compatible with Sideband and any LXMF application. Supports IFAC
  network authentication.
- Legacy JSON: plaintext or encrypted raw packets for simple collectors.

Key changes:
- GPS support for T-Beam Supreme S3 (L76K) and Heltec V4 (external)
- SX1262 radio fixes: IQ polarity, DCD preamble lockup, RX reliability
- LXMF identity management with NVS-backed Ed25519/X25519 keys
- IFAC authentication (CMD_IFAC_KEY 0x89) for private networks
- Per-channel serial isolation (USB, BLE, WiFi)
- GPS status page in OLED display rotation
- Provisioning via rnlog: provision-lxmf, provision-ifac
- Documentation in Documentation/BEACON.md
2026-03-12 17:01:29 +00:00
Mark Qvist
7f868c6c28 Added interference display to waterfall. Improved Heltec V4 false interference rejection. 2025-11-22 14:19:23 +01:00
Mark Qvist
7b0658b197 Handle GC1109 LNA gain variance properly 2025-11-22 00:04:56 +01:00
Mark Qvist
8382d4a08d Fixed packet buffer FIFO state mismatch on high-bitrate queue processing if raw underlying byte buffer was full 2025-11-21 14:07:43 +01:00
Mark Qvist
121f9e79e8 Added support for handling noise floor calculations on devices with LNA gain variance during LNA recalibration. Fixed potential incoming packet buffer corruption on split packet reception at high bitrates. 2025-11-19 14:40:34 +01:00
Mark Qvist
c467b82014 Added ability to specify static IP for WiFi STA connection 2025-11-17 18:47:18 +01:00
Mark Qvist
2319813a65 Added support for connecting ESP32S3 RNodes over WiFi 2025-11-17 16:41:25 +01:00
Mark Qvist
d06ec065de Implemented support for Heltec V4 with PA 2025-11-07 19:13:29 +01:00
Mark Qvist
e157f82b8e Cleanup 2025-04-15 16:26:16 +02:00
Mark Qvist
9ef504392b Improved ESP32 BLE pairing. Added unpair command. 2025-04-13 16:56:45 +02:00
Mark Qvist
0a95f6f107 Added nRF hardware RNG 2025-04-13 14:45:31 +02:00
Mark Qvist
7d868b4db6 Support for XIAO ESP32S3 2025-04-13 00:11:21 +02:00
Kevin Brosius
cbedd72993 Seeed ESP32S3 - enable button sleep, stopRadio at sleep
to sleep sx1262 also.
2025-02-23 18:52:17 -05:00
Mark Qvist
01a27cfd9b Display sleep on T-Echo 2025-01-16 12:20:01 +01:00
Mark Qvist
3379217e19 Sensible e-ink backlight default 2025-01-16 11:15:31 +01:00
Mark Qvist
9b792862b9 Improved T-Echo e-ink sleep 2025-01-16 11:00:39 +01:00
Mark Qvist
3fab6d4cdb Blank T-Echo display on sleep 2025-01-15 21:43:13 +01:00
Mark Qvist
ebf5b54957 Power init for T-Echo 2025-01-15 21:20:43 +01:00
Mark Qvist
f447998c35 Initial T-Echo support 2025-01-15 18:38:34 +01:00
Mark Qvist
2d2d90847a Initial T-Echo support 2025-01-15 18:38:14 +01:00
Mark Qvist
3073677b82 Added sleep and wake support on T114 2025-01-15 11:01:26 +01:00
Mark Qvist
6f0c849cb3 Fixed missing check in interference avoidance 2025-01-13 21:12:39 +01:00
Mark Qvist
71e73580f7 Cleanup 2025-01-09 18:41:35 +01:00
Mark Qvist
6e7370acdc Added interference avoidance option 2025-01-09 17:58:46 +01:00
Mark Qvist
06b4fba603 Added noise floor monitoring and reporting to host 2025-01-09 14:46:13 +01:00
Mark Qvist
7adc3e2a0d Cleanup 2025-01-09 00:13:27 +01:00
Mark Qvist
218a38adb7 Optimise packet handling for SX1280 fast data rates 2025-01-09 00:01:49 +01:00
Mark Qvist
a796e56dd9 Cleanup 2025-01-08 17:44:30 +01:00
Mark Qvist
254225e917 Cleanup 2025-01-08 16:50:29 +01:00
Mark Qvist
ae47b89b53 Added banded contention window allocation 2025-01-08 16:46:16 +01:00
Mark Qvist
4ab42c4269 Cleanup 2025-01-07 20:43:15 +01:00
Mark Qvist
7ce2ed6155 Cleanup 2025-01-07 20:33:20 +01:00
Mark Qvist
5ec063c939 Reworked CSMA algorithm 2025-01-07 20:15:26 +01:00
Mark Qvist
08651f92f7 Reworked SX1262 LoRa carrier detection 2025-01-07 15:14:44 +01:00
Mark Qvist
c39164e272 Accurate preamble and airtime calculations on SX1280. Fix airtime calculation on SX1262 when LDRO is enabled. 2025-01-05 22:55:32 +01:00
Mark Qvist
9ba243ee1f Fixed intermittent radio init failure on T3S3 SX1280 2025-01-04 22:07:43 +01:00
Mark Qvist
6bf06ca94e T3S3 SX1280 support 2025-01-03 19:16:19 +01:00
liamcottle
f9234733e2 add support for heltec t114 2025-01-02 15:14:18 +13:00
Mark Qvist
6c82de161c Added display reconditioning function 2024-12-31 14:20:43 +01:00