Small Nrf24l01 modules can only transmit not receive

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); 
}

I wonder if you are doing all these test while the Arduino is still powered? IF so, no wonder your stuff is dying.

Nah

you can auto acknowledge some message back to sender

Switching off AutoAck while testing gives less information, why would you do that?
The receiver does not show receives, it just prints a structure, regardless of any receives.
Back-to-back packets are overwritten in the receiver and not printed at all.
Sending would be moderated by Serial, but since there is no Serial.begin(); call,
there should not be any output anyway.

The transmitter sketch is missing the needed radio.stopListening(); call.

https://nrf24.github.io/RF24/classRF24.html#a6f144d73fc447c8ac2d1a4166210fd88

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.