Hello,
Problem: I'm having issues with my NRF24 modules for a while now, the wiring and all seems OK but for some reason I can't get them to work. From the 1000 messages I send probably, like only 8 got received, this gives me the idea that the wiring is OK but that the problem is somewhere else.
Library using: Library
I used the default (in my Arduino library thingy) library first called RF24, but then I saw Robin and a few others on multiple threads that I should use this one, sadly it didn't help.
Module using (NRF24): Click here
I'm using a real Arduino Uno (running on windows PC) and a clone Arduino Mega (running on my Macbook)
The pinout is as 'default':
VCC -> 3.3V
GND -> GND
MOSI -> 11
MISO -> 12
SCK -> 13
CSN -> 8
CE -> 7
The Transmitter test code:
#include <nRF24L01.h>
#include <RF24.h>
#include <SPI.h>
#define radio_SS_pin 8
#define radio_CE_pin 7
RF24 radio(radio_CE_pin, radio_SS_pin);
const char SendHint3[] = "SendText";
const byte adres[][6] = {"10101","01010"};
void setup() {
Serial.begin(115200);
radio.begin();
radio.setChannel(116);
radio.setPALevel(RF24_PA_MIN);
radio.openWritingPipe(adres[1]);
radio.openReadingPipe(1,adres[0]);
delay(1000);
radio.stopListening();
}
void loop() {
radio.write(&SendHint3, sizeof(SendHint3));
Serial.println("Send");
delay(100);
}
Receiver code:
#include <SPI.h>
#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>
RF24 myRadio (7, 8);
char ReceiveHint3[] = " ";
byte adres[][6] = {"10101","01010"};
void setup()
{
Serial.begin(115200);
myRadio.begin();
myRadio.setChannel(116);
myRadio.setPALevel(RF24_PA_MIN);
myRadio.openWritingPipe(adres[0]);
myRadio.openReadingPipe(1,adres[1]);
myRadio.startListening();
}
void loop()
{
if ( myRadio.available())
{
while (myRadio.available())
{
myRadio.read(&ReceiveHint3, sizeof(ReceiveHint3) );
}
Serial.println("RECEIVED!" );
Serial.println(ReceiveHint3);
}
}
So yet again: I'm receiving something, but only like 10x times each 1000 messages!
Thanks for any help, I hope that I've provided enough information!
Edit: I know about these power problems, but that shouldn't be the main issue to get it not receiving, I've seen enough video's who didn't do it, I did order NRF24 sockets to get it working hopefully more properly.