I'm having an issue with getting two nRF24l01+ modules working, I can safely rule out hardware and library issues as I can run the pingpair example from the RF24 library with no issues on the same boards in the same pin configuration.
However when I attempt to use the modules with my code I have an issue with the recipient node repeatedly outputting "Got RF message of type -1" to serial, from what I can tell it is getting stuck in the while loop in poll_radio().
I can't see where the issue is as I have pretty similar code as the pingpair demo.
Any notice anything I am doing wrong here?
Thanks,
Dan
Receiving node code is here: https://github.com/DanNixon/BubbleCopter/tree/master/FlightController
Sending node code:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "rf_comm.h"
RF24 radio(9,10);
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
void setup()
{
Serial.begin(57600);
Serial.println("Bubble copter control dev");
radio.begin();
radio.setRetries(15,15);
radio.setPayloadSize(sizeof(rf_message));
radio.openWritingPipe(pipes[1]);
radio.openReadingPipe(1, pipes[0]);
radio.startListening();
radio.printDetails();
}
void loop()
{
radio.stopListening();
rf_message msg;
msg.type = THROTTLE;
msg.value = analogRead(0);
msg.divisor = 1;
int ok = radio.write(&msg, sizeof(rf_message));
if(ok)
{
Serial.println("Message sent");
}
else
{
Serial.println("Message send failed");
}
radio.startListening();
delay(250);
}