Skip to content

Lawlez/FrequencyJammer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RF Interference Research Array

Multi-channel frequency hopping interference system for 2.4GHz ISM band research, built on the ESP32-S3 platform.

A portable, multi-node system that uses coordinated 802.11 packet injection to study RF interference patterns in the 2.4GHz band. The system employs three complementary techniques — broadcast deauthentication, CTS-to-Self NAV reservation, and noise floor saturation — across a pseudo-random frequency hopping sequence synchronized via ESP-NOW.


Table of Contents


Architecture Overview

┌──────────────────────────────────────────────────────────────┐
│                    ESP32-S3 Dual-Core                        │
│                                                              │
│  ┌─────────────────────┐    ┌──────────────────────────────┐ │
│  │      CORE 0         │    │          CORE 1              │ │
│  │                     │    │                              │ │
│  │  ┌───────────────┐  │    │  ┌────────────────────────┐  │ │
│  │  │  TX Task      │  │    │  │  Hop Task              │  │ │
│  │  │  Priority: 15 │  │    │  │  Priority: 10          │  │ │
│  │  │  WDT: OFF     │◄─┼─┬──┼─►│  LFSR Channel Hopping  │  │ │
│  │  │               │  │ │  │  │  MAC Rotation          │  │ │
│  │  │  • Deauth TX  │  │ │  │  │  ESP-NOW Sync          │  │ │
│  │  │  • CTS TX     │  │ │  │  └────────────────────────┘  │ │
│  │  │  • Noise TX   │  │ │  │                              │ │
│  │  └───────────────┘  │ │  │  ┌────────────────────────┐  │ │
│  │                     │ │  │  │  Orchestrator Task     │  │ │
│  └─────────────────────┘ │  │  │  Priority: 8           │  │ │
│                          │  │  │  (if ROLE_ORCHESTRATOR)│  │ │
│              Binary      │  │  └────────────────────────┘  │ │
│              Semaphore ──┘  │                              │ │
│              (tx_gate)      │  ┌────────────────────────┐  │ │
│                             │  │  Arduino loop()        │  │ │
│                             │  │  Priority: 1           │  │ │
│                             │  │  Stats / LED / Health  │  │ │
│                             │  └────────────────────────┘  │ │
│                             └──────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

Core 0 is dedicated entirely to packet transmission — a tight busy-loop with the Task Watchdog Timer disabled for maximum duty cycle. Core 1 handles all logic: frequency hopping, ESP-NOW fleet coordination, LED status, and serial diagnostics.

Packet Types

Type Size 802.11 Frame Mechanism
Deauthentication 26 bytes Management (Type 0, Subtype 12) Spoofed broadcast frame forces all STAs to disconnect from the fabricated BSSID. Reason Code 7 triggers aggressive disconnect in most drivers.
CTS-to-Self 10 bytes Control (Type 1, Subtype 12) Sets the Network Allocation Vector (NAV) to 32ms on all receiving devices, creating a virtual "channel busy" that silences all transmissions.
Random Noise 512 bytes Invalid (random data) Raises the noise floor, causes CRC failures at receivers, and triggers CSMA/CA exponential backoff. At 1 Mbps DSSS, each frame occupies ~4.1ms of airtime.

Project Structure

FrequencyJammer/
├── README.md                 ← You are here
├── jammerv1/
│   └── jammer.ino            ← v1: Basic single-channel jammer (legacy)
├── jammerv2/
│   └── jammerv2.ino          ← v2: Optimized single-channel jammer (legacy)
└── jammerv3/
    └── jammerv3.ino          ← v3: Multi-channel frequency hopping system ★

Use jammerv3/jammerv3.ino — the v1 and v2 sketches are retained for reference only.


Bill of Materials

Core Logic

Qty Item Specification Purpose Est. Cost
3-4× ESP32-S3-WROOM-1U Dual-core LX7, 240MHz, U.FL/IPEX connector Core microcontroller — requires external antenna ~$6 each
3-4× ESP32-S3 Dev Board Breakout board with USB-C, voltage regulator Facilitates power, programming, and wiring ~$8 each

RF Components

Qty Item Specification Purpose Est. Cost
2.4GHz Yagi Antenna 15–18 dBi, directional, SMA connector "Sniper" — long-range focused beam interference ~$15
2.4GHz Omni Antenna 9 dBi, high-gain "rubber ducky", SMA "Bubble" — localized area saturation ~$8 each
3-4× U.FL to SMA Pigtail 10-15cm coaxial adapter cable Connects ESP32-S3 U.FL socket to SMA antennas ~$3 each
2.4GHz LNA/PA Module 2W–4W signal booster (Optional) Amplifies TX power beyond ESP32's native 20.5 dBm ~$25

Power & Housing

Qty Item Specification Purpose Est. Cost
1-2× 18650 Battery Pack 2S (7.4V), 3000mAh+, w/ step-down to 5V High-current portable power for field deployment ~$12 each
Buck Converter 7.4V → 5V/3A, USB-C output preferred Stable regulated power for ESP32 modules ~$5
1-2× Aluminum Project Box 100×60×25mm minimum, RF shielding Prevents self-interference with controller logic ~$8 each
Misc. Wiring Dupont jumpers, JST connectors, solder Assembly and interconnection ~$5

Estimated Total Cost

Configuration Nodes Approximate Cost
Minimum (1× Bubble) 1 ESP32-S3 + Omni ~$30
Standard (Sniper + 2× Bubble) 3 ESP32-S3 ~$100
Full Array (Orchestrator + Sniper + 2× Bubble) 4 ESP32-S3 ~$140

Prerequisites

Software

Tool Version Notes
Arduino IDE 2.x+ Or Arduino CLI
Arduino-ESP32 Core 2.x or 3.x Both ESP-IDF 4.x and 5.x are supported
USB Driver CP2102 or CH340 depending on dev board

Installing Arduino-ESP32 Core

  1. Open Arduino IDEFilePreferences
  2. Add to Additional Board Manager URLs:
    https://espressif.github.io/arduino-esp32/package_esp32_index.json
    
  3. Open ToolsBoardBoards Manager
  4. Search for "esp32" and install "esp32 by Espressif Systems"

Setup & Installation

1. Clone the Repository

git clone https://github.com/Lawlez/FrequencyJammer.git
cd FrequencyJammer

2. Open the Sketch

Open jammerv3/jammerv3.ino in Arduino IDE.

3. Select Board Settings

Setting Value
Board ESP32S3 Dev Module
USB CDC On Boot Enabled
CPU Frequency 240MHz (WiFi)
Flash Mode QIO 80MHz
Flash Size 4MB (32Mb)
Partition Scheme Default 4MB with spiffs
PSRAM Disabled
Upload Speed 921600

4. Configure the Device

Edit the #define configuration block at the top of jammerv3.ino (lines 58–161). See Configuration below.

5. Compile & Upload

Click Upload (or Ctrl+U / Cmd+U). The sketch compiles with zero external library dependencies.


Configuration

All parameters are compile-time #define constants. No runtime configuration or dynamic memory allocation.

Device Role

#define DEVICE_ROLE  ROLE_BUBBLE        // Choose one:
//                   ROLE_ORCHESTRATOR  — Master sync beacon broadcaster
//                   ROLE_SNIPER        — Focused single-target interference
//                   ROLE_BUBBLE        — Area saturation, follows hop pattern

Frequency Hopping

#define HOP_DWELL_US     10000   // Microseconds per channel (10ms = 100 hops/sec)
#define HOP_CHANNELS     13      // 802.11 channels 1-13
#define LFSR_SEED        0xACE1  // Hop sequence seed (non-zero, 16-bit)

Packet Types

#define ENABLE_DEAUTH    true    // Broadcast deauthentication frames
#define ENABLE_CTS       true    // CTS-to-Self NAV reservation frames
#define ENABLE_NOISE     true    // Random noise payload frames

TX Power

#define TX_POWER_DBM     20      // Max: 20 dBm (~100mW) on ESP32-S3

ESP-NOW Fleet Sync

#define ESPNOW_ENABLED          true    // Enable/disable fleet coordination
#define ESPNOW_RENDEZVOUS_CH    1       // Fixed channel for sync beacons
#define ESPNOW_SYNC_INTERVAL_MS 50      // Beacon broadcast interval
#define ESPNOW_MISS_THRESHOLD   10      // Missed beacons before autonomous fallback

Hardware & Diagnostics

#define LED_PIN          2        // GPIO for status LED (0 = disabled)
#define SERIAL_BAUD      115200   // Serial monitor baud rate (0 = disabled)
#define STATS_INTERVAL_MS 2000    // Stats print interval in milliseconds

TX Tuning

#define TX_BATCH_SIZE    8        // Frames per batch before yielding to hop task
#define NOISE_BUF_SIZE   512      // Random noise frame size in bytes
#define MAC_ROTATE_HOPS  5        // Rotate spoofed MAC every N hops

Flashing

Using Arduino IDE

  1. Connect ESP32-S3 via USB-C
  2. Select the correct Port under ToolsPort
  3. Hold the BOOT button on the dev board (if required by your board)
  4. Click Upload
  5. Release BOOT after "Connecting..." appears
  6. Wait for "Hard resetting via RTS pin..." — done

Using Arduino CLI

# Compile
arduino-cli compile --fqbn esp32:esp32:esp32s3 jammerv3/jammerv3.ino

# Upload (replace /dev/cu.usbmodem* with your port)
arduino-cli upload --fqbn esp32:esp32:esp32s3 -p /dev/cu.usbmodem14101 jammerv3/jammerv3.ino

# Monitor serial output
arduino-cli monitor -p /dev/cu.usbmodem14101 -c baudrate=115200

Usage

Single-Node Operation

  1. Flash jammerv3.ino with DEVICE_ROLE set to ROLE_BUBBLE
  2. Power on the ESP32-S3
  3. The LED blinks once (Bubble role indicator), then goes solid
  4. The device immediately begins:
    • Hopping across all 13 channels at the configured dwell rate
    • Transmitting deauth + CTS + noise frames on each channel
    • Rotating spoofed MAC addresses every 5 hops
  5. Open Serial Monitor at 115200 baud to see live stats

Multi-Node Fleet Operation

  1. Flash the Orchestrator — set DEVICE_ROLE to ROLE_ORCHESTRATOR on one node
  2. Flash the Bubble nodes — set DEVICE_ROLE to ROLE_BUBBLE on 1-2 nodes
  3. Flash the Sniper — set DEVICE_ROLE to ROLE_SNIPER on one node (optional)
  4. Power on all nodes — they auto-discover via ESP-NOW broadcast on the rendezvous channel
  5. The Orchestrator broadcasts sync beacons every 50ms containing:
    • Current epoch timestamp
    • LFSR hop seed
    • Active channel bitmask
    • Total node count
  6. Each node applies a MAC-derived offset to the hop sequence, ensuring different channel assignments across the fleet

Fleet Sync Recovery

If a Bubble/Sniper node loses sync (misses 10 consecutive beacons), it automatically falls back to autonomous hopping and will re-sync when beacons are heard again.

LED Status Indicators

Pattern Meaning
1 blink at boot Bubble role
2 blinks at boot Sniper role
3 blinks at boot Orchestrator role
Solid ON System armed and transmitting
Brief OFF pulse every 1s Heartbeat — operating normally

Deployment Configurations

"The Sniper"

1× ESP32-S3 + Yagi Antenna (15-18 dBi directional)
├── DEVICE_ROLE = ROLE_SNIPER
├── Point antenna at target for focused interference
└── Maximum range, minimum beam width

"The Bubble"

2× ESP32-S3 + Omni Antennas (9 dBi rubber ducky)
├── DEVICE_ROLE = ROLE_BUBBLE
├── Close-proximity area saturation
└── 360° coverage, follows orchestrated sweep pattern

"The Orchestrator"

1× ESP32-S3 (antenna optional — primarily coordinates)
├── DEVICE_ROLE = ROLE_ORCHESTRATOR
├── Broadcasts hop schedule to all fleet nodes via ESP-NOW
└── Also performs TX (can be disabled by setting all ENABLE_* to false)

Recommended Full Deployment

                    ┌──────────────────────┐
                    │    ORCHESTRATOR      │
                    │    (ESP-NOW Sync)    │
                    └──────────┬───────────┘
                               │ ESP-NOW Beacons
              ┌────────────────┼────────────────┐
              ▼                ▼                ▼
     ┌─────────────┐  ┌─────────────┐  ┌─────────────┐
     │   SNIPER    │  │   BUBBLE    │  │   BUBBLE    │
     │   (Yagi)    │  │   (Omni)    │  │   (Omni)    │
     │   ═══►      │  │   ◉         │  │   ◉         │
     │  Focused    │  │  360° Area  │  │  360° Area  │
     └─────────────┘  └─────────────┘  └─────────────┘

DJI OcuSync Calibration

DJI OcuSync uses FHSS (Frequency Hopping Spread Spectrum) for control/telemetry links. To calibrate the system against specific OcuSync versions:

Quick Presets

Target HOP_DWELL_US Hop Rate
OcuSync 2.0 (Mini 2, Air 2S, Mavic Air 2) 10000 ~100 hops/sec
OcuSync 3.0 / O3 (Mini 3 Pro, Mavic 3, Air 3) 5000 ~200 hops/sec
Aggressive (overwhelm adaptive selection) 3000 ~333 hops/sec

SDR-Assisted Calibration Procedure

  1. Capture — Use an SDR (HackRF, RTL-SDR v4, etc.) with GNU Radio, SigDigger, or Inspectrum to record the target's 2.4GHz spectrogram
  2. Measure — Count the frequency transitions per second visible in the waterfall display
  3. CalculateHOP_DWELL_US = 1,000,000 / observed_hop_rate
  4. Lead-hop — Subtract 500–1000µs from the calculated dwell to arrive on each channel before the target
  5. Cover all channels — OcuSync uses dynamic channel selection. Setting HOP_CHANNELS = 13 covers all possible escape channels

Note: OcuSync's hopping algorithm uses AES-256 encrypted seeds — the exact sequence is proprietary. These calibration values are empirical approximations from published SDR research.


Serial Monitor Output

Connect at 115200 baud. Example output:

╔══════════════════════════════════════════════════╗
║  JAMMERV3 — Frequency Hopping Interference Sys   ║
║  Target: ESP32-S3 | Channels: 1-13               ║
║  Role: BUBBLE      | Dwell: 10000µs              ║
╚══════════════════════════════════════════════════╝
[INIT] WiFi initialized. MAC: A0:B7:65:4C:D2:1F
[INIT] Node ID: 31 (0x1F)
[INIT] Packets built. Deauth: ON, CTS: ON, Noise: ON
[INIT] Spoofed MAC: 8A:3E:F1:6B:22:D0
[ESPNOW] Initialized. Role: BUBBLE
[INIT] ══════════════════════════════════════
[INIT] System ARMED. TX on Core 0, HOP on Core 1.
[INIT] Hop dwell: 10000 µs (100 hops/sec)
[INIT] ══════════════════════════════════════

[STAT] Ch: 7 | Hops:   200 | Frames:    4800 | 2400 fps | Sync:NO
[STAT] Ch:11 | Hops:   400 | Frames:    9600 | 2400 fps | Sync:YES
[STAT] Ch: 3 | Hops:   600 | Frames:   14400 | 2400 fps | Sync:YES

Reading the Stats Line

Field Description
Ch Current channel at time of print
Hops Total channel hops since boot
Frames Total frames transmitted since boot
fps Frames per second (current throughput)
Sync ESP-NOW fleet synchronization status

Troubleshooting

Symptom Cause Fix
Board reboots repeatedly WDT firing on Core 1 Ensure vTaskDelay() exists in loop(). Don't add blocking code to hop task.
"Upload failed" Board not in download mode Hold BOOT button while clicking Upload
No serial output Wrong baud rate or SERIAL_BAUD = 0 Set SERIAL_BAUD to 115200, monitor at same rate
0 fps in stats TX task not running Check semaphore creation (look for [FATAL] in serial output)
[ESPNOW] Lost sync Orchestrator out of range or powered off Move nodes closer, or increase ESPNOW_MISS_THRESHOLD
Compilation errors on ESP-IDF 5.x Callback signature mismatch The code handles this automatically via ESP_IDF_VERSION guards
LED stays off Wrong GPIO pin Check LED_PIN matches your board's onboard LED (often GPIO 2 or 48)

Technical Reference

Memory Footprint

Resource Size Allocation
Deauth frame buffer 26 bytes Static (compile-time)
CTS frame buffer 10 bytes Static (compile-time)
Noise buffer 512 bytes Static (compile-time)
Global state variables ~50 bytes Static (compile-time)
TX task stack 2,048 bytes Boot (FreeRTOS)
Hop task stack 4,096 bytes Boot (FreeRTOS)
Orchestrator task stack 3,072 bytes Boot (FreeRTOS, only if orchestrator)
Runtime heap allocation 0 bytes Never

Security Considerations

  • MAC rotation: Spoofed source MACs change every 5 hops using hardware RNG
  • Locally-administered bit: Always set in spoofed MACs to avoid OUI collisions
  • No String class: All output uses printf() to prevent heap fragmentation
  • Bounds-checked channels: Index always computed as (value % 13) + 1
  • Version guards: ESP-IDF 4.x/5.x callback signatures handled automatically

Known Limitations

  1. ESP32-S3 radio is half-duplex — cannot TX and RX simultaneously
  2. esp_wifi_80211_tx() transmits at ~1 Mbps DSSS for raw frames
  3. Maximum native TX power is 20.5 dBm (~100mW) without external PA
  4. CTS-to-Self is less effective against Wi-Fi 6 (802.11ax) devices with BSS Color
  5. Deauth frames are rejected by WPA3/PMF (802.11w) enabled networks
  6. OcuSync timing values are empirical estimates from SDR research, not official specs

Version History

Version File Description
v1 jammerv1/jammer.ino Basic jammer — single channel, random data TX, blocking loop
v2 jammerv2/jammerv2.ino Optimized — pre-filled buffer, channel 6 fixed, removed delay
v3 jammerv3/jammerv3.ino Full rewrite — dual-core FHSS, 3 packet types, LFSR hopping, ESP-NOW fleet coordination, OcuSync calibration

RF Research Project — Indoor Laboratory Use Only

About

Jamming 2.4Ghz Communication :) Fuck Drones!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages