fix(nrf24): power down WiFi PHY during jamming to clear 2.4GHz band#2517
Open
r13xr13 wants to merge 1 commit into
Open
fix(nrf24): power down WiFi PHY during jamming to clear 2.4GHz band#2517r13xr13 wants to merge 1 commit into
r13xr13 wants to merge 1 commit into
Conversation
The NRF24 jammer transmits on 2.4GHz — the same band as the ESP32 WiFi radio. When WiFi is active, the two radios desense each other's front-ends, causing jamming to fail completely. This fix: - Saves WiFi mode, stops WiFi, and disables the PHY before jamming - Restores WiFi state after jamming completes - Adds a shared SPI bus mutex (cc_nrf_spi_mutex) to prevent contention between NRF24, CC1101, LoRa, and W5500 on the same physical SPI pins Tested on: T-Embed CC1101, Cardputer, ESP32-S3 variants Fixes: jammers not working when WiFi is active (issue BruceDevices#2508, BruceDevices#2511)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The NRF24 jammer transmits on 2.4GHz — the same ISM band as the ESP32 internal WiFi radio. When WiFi is active (station mode, AP mode, or sniffer), the two radios desense each other's front-ends. The jammer appears to transmit but the signal never reaches the target because the WiFi PHY is saturated. Users report "no jammers work" on v1.15 (#2508).
Additionally, on boards where NRF24 and CC1101 share physical SPI pins (SCK/MOSI/MISO), there is no coordination mechanism for SPI bus access, risking transaction corruption when both drivers are active.
Changes
src/modules/NRF24/nrf_jammer.cpp— WiFi power management during jamming:esp_phy_disable()) to clear the 2.4GHz bandsrc/main.cpp— Shared SPI bus mutex:SemaphoreHandle_t cc_nrf_spi_mutex(file scope extern)xSemaphoreCreateMutex()insetup()nrf_jammer.cppfor use in SPI-critical sectionsTesting
CC_NRF_SPIbusFixes #2508, references #2511