NFR24L01 Brick Wall
Posted: 15 Nov 2020, 17:08
I've got very excited, seeing on this forum, the wonderful things people are doing with these modules. With some experience of Arduino it looked like I could embark on a number of exciting new flying projects. However I have run into a brick wall. Started rather grand but have now boiled it down to a bare bones sketch and still getting nowhere! For prototyping, I'm using two Arduino Unos with breakout adapters and NRL24L01 modules. From a wiring perspective things could not be much simpler.
Uno 13 = SCK on breakout adapter
Uno 12 = MISO on breakout adapter
Uno 11 = MOSI on breakout adapter
Uno 10 = CSW on breakout adapter
Uno 9 = CE on breakout adapter
Uno 3.3V = VCC on breakout adapter
Uno Gnd = GND on breakout adapter
The transmitter sketch sends Hello World and the Receiver sketch is supposed to output that to the Serial monitor. The addresses are the same but radio.available never becomes true.
RF24 library is from ManiacBug which seems to be highly regarded.
I've called radio.printDetails() to see what the TX module is doing and am seeing a load of zeros which suggests the problem resides on teh TX side.
Here is the TX sketch
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include "printf.h"
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "80890";
void setup() {
Serial.begin(9600);
printf_begin();
printf("\n\rTest connection to modules\n\r");
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
radio.printDetails();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
Serial.println("Just sent Hello World");
delay(1000);
}
Here is the RX sketch
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "80890";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
else{
Serial.println("Nothing");
}
}
I'd welcome some help, can someone point me in the right direction? It might be me being really stupid, am I missing a key step or something?
Uno 13 = SCK on breakout adapter
Uno 12 = MISO on breakout adapter
Uno 11 = MOSI on breakout adapter
Uno 10 = CSW on breakout adapter
Uno 9 = CE on breakout adapter
Uno 3.3V = VCC on breakout adapter
Uno Gnd = GND on breakout adapter
The transmitter sketch sends Hello World and the Receiver sketch is supposed to output that to the Serial monitor. The addresses are the same but radio.available never becomes true.
RF24 library is from ManiacBug which seems to be highly regarded.
I've called radio.printDetails() to see what the TX module is doing and am seeing a load of zeros which suggests the problem resides on teh TX side.
Here is the TX sketch
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include "printf.h"
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "80890";
void setup() {
Serial.begin(9600);
printf_begin();
printf("\n\rTest connection to modules\n\r");
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
radio.printDetails();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
Serial.println("Just sent Hello World");
delay(1000);
}
Here is the RX sketch
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "80890";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
else{
Serial.println("Nothing");
}
}
I'd welcome some help, can someone point me in the right direction? It might be me being really stupid, am I missing a key step or something?