Closed justcallmekoko closed 1 week ago
Did you read the ebyte manual for your particular models? I've heard that the ebyte modules don't respect the specified data rate. There's nothing the software can do about that.
The channel thing is certainly weird. Have you tried reducing the SPI speed?
RF24 radio(H_CE, H_CS, 16000000)
This is your problem. The nRF24L01 only supports a max of 10MHz (the lib default). So, the bits output/input over the SPI bus at 16MHz are not interpreted properly.
We've seen other users have better success with using slower SPI speeds (like 6 or 4 MHZ) on ESP-based MCUs. There seems to be a high impedance on those boards' SPI lines.
@2bndy5 I read through what I could with the ebyte manuals but they are all in chinese. I do see what you are talking about though regarding the SPI speed. It is written in the data sheets that it maxes out at 10mhz. I have gone ahead and adjusted that and it seems to have helped with the improper channel setting as well as the data rate setting. The datasheets suggest both of these ebyte modules are capable of 2 MBPS.
The only issue that still doesn't make sense to me (and this might not be a firmware or lib issue) is the fact that this thing, according to the HackRF, is still only transmitting between 2425mhz and 2431mhz even though I am selecting frequencies between 2400mhz and 2480mhz. The datasheets still corroborate that these modules should have no problem operating in this frequency range.
Are you sure your HackRF is sniffing packets from the nRF24L01 radios? I've never used one of those.
You could verify that the channels are properly used by running the examples/scanner/scanner.ino sketch (with Arduino or PlatformIO). That example allows 1 node to transmit a carrier wave on a specified channel, meanwhile another node can be used to scan the entire spectrum. The carrier wave emitted by one node should show in the scanner output run by another node. This is the way most governments mandate hardware certification/tests of radios.
[!caution] The scanner example for Arduino does not handle line endings very well. I've tried to compensate for this, but my recent tests showed it was better to just disable line endings in the Arduino IDE's serial monitor's input field.
I did a quick search for the e-byte manuals:
Not sure if they're the right ones, but they are in English.
Excellent find with the english PDFs! I will give those a more in depth read. I'm very confident the HackRF is picking the traffic from my modules. I'm sitting in my basement with relatively low RF traffic. While the NRF modules are transmitting, big ol' red streaks down the RF feed on the HackRF. As soon as I remove power from the ESP32, the red stops.
When using the black pcb nrf24 modules, the red streaks on the hackrf appear from 2400mhz to 2480mhz as intended. Using the ebyte modules, only from 2425mhz to 2431mhz.
I will give the datasheets a read and find out if there is anymore info in there.
Please also verify with the scanner example.
Switching radio modules did the trick. Not sure if the ones I was using were all crapped out but with some new modules, I am no longer running into any issues
What radio module do you use?
E01-2G4M27SX (nRF24L01+), E01-ML01DP5 (nRF24L01+PA+LNA)
What driver board(s) do you use?
ESP32-WROOM (ESP32 Dev Kit)
If using Linux, what OS are you using?
No response
If using Linux, what RF24 driver did you select?
None
Describe your problem
The Problem
For context I am trying to create an protocol analysis device powered by NRF24. One of it's features will be to transmit test data to test reception of other 2.4ghz modules. I noticed a few problems when switching from the generic knock off NRF24L01+PA/LNA modules sold on amazon (the ones with the black PCB and SMA connector) to a couple different modules made by Ebyte which allegedly sport NRF24L01 ICs.
The problems I am facing seem to be miscommunications between the ESP32 host and the NRF24 module connected via SPI. The ESP32 and NRF24 boot, the ESP32 runs through its initial configuration of the NRF24, outputs from
printDetails
and starts transmitting data on random channels.During the intial configuration, the data rate is set to 2 MBPS. When outputting from
printDetails
, the data rate accurately reflects 2 MBPS only about half of the time. The other half it reflects 1 MBPS.While transmitting I output the random number the ESP32 uses to set the NRF24 channel as well as the channel the NRF24 gets set to using
getChannel
. In theory these should be the same number however they are wildly different during runtime (please see serial output below).During transmission, I find on the HackRF One that there is only traffic being transmitted between 2428Mhz-2430Mhz even though frequencies are randomly selected between 2400Mhz-2480Mhz. All frequencies outside of 2428-2430 either have VERY light traffic or none at all.
Additionally, I noticed the
TX_ADDR
changes sporadically between0xe7e7e7e7e7
and0xffffffffff
every few reboots.Serial Output
Troubleshooting Steps
Of course I googled my ass off and browsed the open and closed issues seeing if there was anyone else who was experiencing problems with these specific modules. Believe me, opening a new repo issue is the last thing I want to do.
Per the folks of the internet, I have connected a 10uF electrolytic capacitor between voltage and ground on all of my NRF24 modules, working or otherwise. No noticeable changes in performance.
I ensured my SPI connections between the ESP32 and the NRF24 modules is correct.
I ensured my dupont wires were not the issue by using the same wires to connect an NRF24 module which I verified to function properly.
I have created a source code which just executes the initial configuration and loops through randomly cycling between channels 0 and 80.
Question
I believe I have verified the only difference in hardware and firmware configuration is the NRF24L01 module itself. Is there an explanation or even awareness about this strange SPI miscommunication between the MCU and these Ebyte NRF24L01 modules? I say "SPI miscommunication" only because I don't know what else to attribute it to as SPI seems to work with these modules 90% of the way.
TLDR
Ebyte NRF24 modules reporting wrong
getChannel
aftersetChannel
and wronggetDataRate
aftersetDataRate
but other SPI communication functions as expected. See code andSerial Output
.What is the RX code?
No response
What is the TX code?