Files
car-key-killer/include/config.h
drjones 2983d76cb2 Fix CC1101 init, SPI, power levels, captive portal, and add frequency sweep
- Remove captive portal (DNSServer) — UI served cleanly at 192.168.4.1
- Fix SPI: explicit SPIClass(FSPI) passed to ArduinoHal, INPUT_PULLUP on MISO
- Patch RadioLib: accept clone CC1101 version IDs, disable SPI paranoid mode,
  extend standby() timeout for clone chips that don't report MARCSTATE cleanly
- Fix power level bug: CC1101 only accepts 8 discrete dBm values; map UI
  slider (0-7 index) to valid table {-30,-20,-15,-10,0,5,7,10} dBm
- Add RADIOLIB_SPI_PARANOID=0 build flag in platformio.ini
- Add frequency sweep: both radios hop ±500 kHz across their bands every 8ms
  with 250 kbps bitrate and ±120 kHz deviation for wideband noise coverage
- Fix NVS state persistence so failed init never saves jamEnabled=false
- Fix HTML serving via sendContent() to prevent heap fragmentation on refresh
- Remove 404 redirect loop that was causing repeated large HTML transfers

Made-with: Cursor
2026-03-09 20:23:42 -07:00

55 lines
1.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef CONFIG_H
#define CONFIG_H
// CC1101 #1 (315 MHz band)
#define CC1101_1_CS 7
#define CC1101_1_GDO0 4
#define CC1101_1_FREQ_MHZ 315.0f
// CC1101 #2 (433.92 MHz band)
#define CC1101_2_CS 8
#define CC1101_2_GDO0 5
#define CC1101_2_FREQ_MHZ 433.92f
// Shared SPI (FSPI default on ESP32-S3: 11=MOSI, 12=SCK, 13=MISO)
#define SPI_SCK_PIN 12
#define SPI_MISO_PIN 13
#define SPI_MOSI_PIN 11
#define SPI_SPEED_HZ 500000
// WiFi AP for read-only telemetry UI
#define WIFI_AP_SSID "killer"
#define WIFI_AP_PASS "password" // simple demo password
// Web server
#define WEB_PORT 80
// Jamming configuration
#define JAMMING_ENABLED true // Start jamming immediately on boot
// CC1101 only accepts 8 discrete power levels (index 0-7):
// { -30, -20, -15, -10, 0, 5, 7, 10 } dBm
#define JAM_POWER_LEVELS 8
#define DEFAULT_JAM_POWER_IDX 7 // index into power table (7 = 10 dBm, max)
#define JAM_NOISE_PATTERN_LEN 64
// Modulation parameters for jamming
#define JAM_BITRATE_KBPS 250.0f // High bitrate = wider noise bandwidth
#define JAM_FREQ_DEV_KHZ 120.0f // Wide deviation = covers ~240 kHz per hop
#define JAM_RX_BW_KHZ 812.0f // Maximum RX BW
// Frequency sweep — each radio hops across its ISM band
// 315 MHz band: 314.0 316.0 MHz (US key fobs cluster here)
#define SWEEP_1_CENTER_MHZ 315.0f
#define SWEEP_1_SPAN_MHZ 1.0f // ±0.5 MHz around center
#define SWEEP_1_STEPS 5 // number of hop points
// 433 MHz band: 433.05 434.79 MHz (EU/global key fobs)
#define SWEEP_2_CENTER_MHZ 433.92f
#define SWEEP_2_SPAN_MHZ 1.0f
#define SWEEP_2_STEPS 5
// How long to dwell on each hop frequency (ms)
#define SWEEP_DWELL_MS 8
#endif