I have 9 small Nrf24 modules (no external antenna) that I can't get to receive data properly (they only grab data once every two minutes or so).
They are a mix of real and fake ones and at least 3 of them have been able to reliably receive data in the past.
As mentioned in the title these peculiar modules while unable to receive data can all transmit flawlessly. I tested the transmitting using 4 other big modules (with external antenna) and on all four of those I was able to receive data from all 9 of the small ones.
The interesting part is that with no physical or software change to the circuit by only swapping the small receiving module for the big one it starts receiving data (even without unplugging the Arduino). If you're wondering I tried using only the small modules to both transmit and receive between each other and that came out empty as well however it did seem to be able to get data a bit more often (once every 15-50 seconds).
I don't think this is a power issue considering the big modules work just fine and software seems out of the question as well since the same code works on the big ones but not the small ones, this becomes even more perplexing considering I've had at least three of those small modules successfully receive data across relatively large distances before so them suddenly not working seems hard to believe and even if they were broken why would they transmit without any issues.
Receiver Code
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
const uint64_t pipeIn = 0xE8E8F0F0E1LL;
RF24 radio(10, 9); // (CE, CSN)
struct MyData {
int pot_value;
int pot_value2;
int pot_value3;
int pot_value4;
int On;
int x;
};
MyData data;
void recvData()
{
while ( radio.available() )
{
radio.read(&data, sizeof(MyData));
}
}
void setup()
{
Serial.begin(115200);
radio.begin();
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(1,pipeIn);
radio.startListening();
}
void loop()
{
recvData();
Serial.print(data.pot_value);
Serial.print("\t");
Serial.print(data.pot_value2);
Serial.print("\t");
Serial.print(data.pot_value3);
Serial.print("\t");
Serial.print(data.pot_value4);
Serial.print("\t");
Serial.print(data.On);
Serial.print("\t");
Serial.println(data.x);
}
Transmitter Code
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(10, 9); // (CE, CSN)
const uint64_t pipeOut = 0xE8E8F0F0E1LL;
struct TransmitData {
int pot_value;
int pot_value2;
int pot_value3;
int pot_value4;
int On;
int x;
};
TransmitData data;
void setup() {
radio.begin();
radio.setAutoAck(false);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipeOut);
}
void loop() {
data.pot_value = analogRead(A1);
data.pot_value2 = analogRead(A2);
data.pot_value3 = analogRead(A3);
data.pot_value4 = analogRead(A4);
data.On = digitalRead(1);
data.x = digitalRead(2);
radio.write(&data, sizeof(TransmitData));
Serial.print(data.pot_value);
Serial.print("\t");
Serial.print(data.pot_value2);
Serial.print("\t");
Serial.print(data.pot_value3);
Serial.print("\t");
Serial.print(data.pot_value4);
Serial.print("\t");
Serial.print(data.On);
Serial.print("\t");
Serial.println(data.x);
}