My nRF24L01 Initialization code is failing. My code generates these diagnostics:
CE PIN: 14, CSN PIN: 15
WIFI_POWER_LEVEL=1 <<< What I want to set this to
WIFI_DATA_RATE=1
WIFI_DATA_CHANNEL=124
Radio PA Level set to: 0 <<< what value was actually set to
Radio power level not set
Radio Data Rate set to: 0 <<< what value was actually set to
Radio Data Rate not set
Radio Channel set to: 0 <<< what value was actually set to
Radio Data Channel not set
Radio Initialization FAILED
Here is ,my code:
bool radioOK = true;
Serial.println ( F ( "\nINITIALIZING RADIO" ) );
Serial.print ( F ( "CE PIN: " ) );
Serial.print ( WIFI_CE_PIN );
Serial.print ( F ( ", CSN PIN: " ) );
Serial.println ( WIFI_CSN_PIN );
// Initialize the radio
radio.begin ();
// Set the transmit power to lowest available to prevent power supply related issues
Serial.print ( F ( "WIFI_POWER_LEVEL=" ) );
Serial.println ( WIFI_POWER_LEVEL );
Serial.print ( F ( "WIFI_DATA_RATE=" ) );
Serial.println ( WIFI_DATA_RATE );
Serial.print ( F ( "WIFI_DATA_CHANNEL=" ) );
Serial.println ( WIFI_DATA_CHANNEL );
radio.setPALevel ( WIFI_POWER_LEVEL );
Serial.print ( F ( "Radio PA Level set to: " ) );
Serial.println ( radio.getPALevel () );
if (radio.getPALevel () != WIFI_POWER_LEVEL) {
Serial.println ( F ( "Radio power level not set" ) );
radioOK = false;
}
// Set the speed of the transmission
radio.setDataRate ( WIFI_DATA_RATE );
Serial.print ( F ( "Radio Data Rate set to: " ) );
Serial.println ( radio.getDataRate () );
if (radio.getDataRate () != WIFI_DATA_RATE) {
Serial.println ( F ( "Radio Data Rate not set" ) );
radioOK = false;
}
// Use a channel unlikely to be used by Wifi, Microwave ovens etc
radio.setChannel ( WIFI_DATA_CHANNEL );
Serial.print ( F ( "Radio Channel set to: " ) );
Serial.println ( radio.getChannel () );
if (radio.getChannel () != WIFI_DATA_CHANNEL) {
Serial.println ( F ( "Radio Data Channel not set" ) );
radioOK = false;
}
if (!radioOK) {
Serial.println ( F ( "Radio Initialization FAILED" ) );
return false;
}
I am using the this library: GitHub - maniacbug/RF24: Arduino driver for nRF24L01
I have swapped the RF24 Wifi Chips many times to make sure that it's not hardware related.