Add jam strategies (direct/precision/flood), web UI modes and SmartRF register export/import

- JamMode: DIRECT, PRECISION, FLOOD with NVS persistence and flood tick path
- HTTP: POST /api/jam_mode, GET/POST /api/cc1101/registers
- Telemetry: jam_mode, jam_mode_str
- Web UI: mode buttons, toast on switch, CC1101 hex export/apply card
- config.h: precision/flood tuning, CC1101_CFG_REG_LAST
- platformio.ini: explicit USB serial upload port for macOS

Made-with: Cursor
This commit is contained in:
drjones
2026-03-25 10:18:55 -07:00
parent 38d5024ef1
commit 2143981110
3 changed files with 675 additions and 120 deletions

View File

@@ -25,7 +25,8 @@
#define WEB_PORT 80
// Jamming: max CC1101 TX (+10 dBm). External PA removed — radiated power is chip + antenna gain only.
#define DEFAULT_AUTO_START_JAM false // NVS key autoStartJam; do not jam until user enables or saves auto-start
// Jam always starts after boot self-test; use web “Stop Jamming” (or capture REC) to pause for RX/capture.
#define DEFAULT_AUTO_START_JAM true
// CC1101 only accepts 8 discrete power levels (index 0-7); jam path always uses max (10 dBm).
#define JAM_POWER_LEVELS 8
#define DEFAULT_JAM_POWER_IDX 7 // 10 dBm — full device output (see TI SWRS061 PATABLE / output power)
@@ -34,12 +35,32 @@
#define JAM_BITRATE_KBPS 250.0f // baseband / channel filter context for RadioLib begin()
#define JAM_FREQ_DEV_KHZ 380.0f // default passed to begin(); per-radio deviation applied after init
#define JAM_RX_BW_KHZ 812.0f // wide RX BW for begin()
// GDO0 toggle rate during jam (1 MHz timer tick). Higher → wider AM/FM splatter on both carriers; 100 kHz typical.
#define JAM_LFSR_KEY_HZ 100000
// Fixed dual-carrier jamming: each radio holds one frequency at full TX power (TI CC1101 freq + deviation).
// Many NA ~315 MHz RKE remotes are ASK/OOK (see TI CC1101 datasheet MDMCFG2.MOD_FORMAT). Jam path uses OOK on
// R1 so LFSR on GDO0 keys the PA (broad AM sidebands). Set JAM_R1_USE_OOK 0 for 2-FSK only at JAM_DEV_KHZ_R1_WIDE.
// Fobs may sit on 314.8315.2 MHz — measure with an SDR and retune JAM_LOCK_FREQ_1_MHZ if needed.
#define JAM_LOCK_FREQ_1_MHZ 315.0f
#define JAM_LOCK_FREQ_2_MHZ 433.92f
#define JAM_DEV_KHZ_R2_WIDE 380.0f
#define JAM_DEV_KHZ_R1_NARROW 25.0f
#define JAM_DEV_KHZ_R1_NARROW 25.0f // probe / RadioLib begin() only
#define JAM_DEV_KHZ_R1_WIDE 200.0f // FSK jam spread when JAM_R1_USE_OOK is 0 (or OOK setup fails)
#define JAM_R1_USE_OOK 1 // 1 = R1 jam ASK/OOK (typical NA); 0 = wide 2-FSK on R1
// Precision jam: narrow 2-FSK on both + slower LFSR (energy in a smaller RF slice).
#define JAM_PRECISION_DEV_R1_KHZ 28.0f
#define JAM_PRECISION_DEV_R2_KHZ 55.0f
#define JAM_PRECISION_LFSR_HZ 40000
// Flood jam: packet-mode random payloads (mcore1976-style bursty TX); deviation for symbol spread.
#define JAM_FLOOD_PKT_BYTES 64
#define JAM_FLOOD_DEV_R1_KHZ 140.0f
#define JAM_FLOOD_DEV_R2_KHZ 200.0f
// SmartRF-style dump: config space only (TI SWRS061); PATABLE/ strobes not included.
#define CC1101_CFG_REG_LAST 0x2E
// 0.96" SSD1306 OLED display — I2C via SW_I2C (any free GPIO)
#define OLED_SDA_PIN 17