Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The NRF24L01 receiver isn't receiving the message #102

Open
shreyassahu opened this issue Aug 16, 2021 · 1 comment
Open

The NRF24L01 receiver isn't receiving the message #102

shreyassahu opened this issue Aug 16, 2021 · 1 comment

Comments

@shreyassahu
Copy link

//Transmitter code
#include <nRF24L01.h> //NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include <RF24.h>
#include <SPI.h>

int SentMessage[1] = {111};
RF24 radio(7,8); // NRF24L01 used SPI pins + Pin 9 and 10 on the NANO

const byte address[6] = "node1"; // Needs to be the same for communicating between 2 NRF24L01

void setup()
{
// pinMode(SwitchPin, INPUT_PULLUP);
// digitalWrite(SwitchPin,HIGH);

radio.begin(); // Start the NRF24L01
radio.openWritingPipe(address); // Get NRF24L01 ready to transmit
}

void loop()
{

  SentMessage[0] = {111};
  radio.write(SentMessage, 1);
  delay(100);

}

//Receiver Code
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
int RELAY=4;
RF24 radio(7, 8); // CE, CSN
int receivedMessage[1] = {111};
const byte address[6] = "node1";
void setup() {
// Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1, address);
// radio.setPALevel(RF24_PA_MIN);
radio.startListening();
pinMode(RELAY,LOW);
}

void loop()
{
while(radio.available())
{
radio.read(receivedMessage,1);

if(receivedMessage[0] == 111)
{
  digitalWrite(RELAY,HIGH);
}
else
{
  digitalWrite(RELAY,LOW);
}

// delay(2);
}
}

I am working on an automation project that uses NRF24L01 modules connected to an Arduino UNO(the receiver) and Arduino Nano(the transmitter). I have done the connections correctly. The receiver end doesn't work (the relay is not turning on) even though the transmitter is transmitting the message with the same address. What seems to be the issue here?

@chricloud9
Copy link

Having a similar issue on an STM32. Won't receive even though the transmitter is sending.

Have you checked the RPD address to see if it's receiving power to the receiver antenna?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants