Hi all:
I got couple of NRF24L01+ -- but I cant seem to make it talk to each other after trying different things for two days.
The actual links to the modules are
http://www.ebay.com/itm/231240845376?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
I initially tried to make an Arduino Nano talk with my Raspberry Pi, but the sender and receiver are not able to talk with each other. To further debug the issues, I decided to print the status of one module every 10 seconds. It seems like the module is not able to hold its addresses.
My connections to the NANO are as follows:
IRQ -> Blank
VCC/Gnd -> External power supply
MISO -> D12
MOSI ->D11
CSN -> D8
CE -> D7
SCK -> D13
For power, I tried multiple things:
A radio shack DC adapter 3V
CR2450 3.3V batteries
I am using DuPont connectors to connect the power supply to the module. Will that make a difference?
I also added 1 and 10 micro farad capacitors across the power supply (Hard to do it across the module as I am using a bread board), but that doesn't seem to help.
Here is my program and its output. Any help is appreciated. I am so disappointed that I am not able to make these things work when so many people have had success.
Rick
Program:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include <printf.h> // Printf is used for debug
//
// Hardware configuration
// Set up nRF24L01 radio on SPI bus plus pins 7 & 8
RF24 radio(7,8);
bool radioNumber = 0;
byte addresses[][6] = {"1Node","2Node"}; // Radio pipe addresses for the 2 nodes to communicate.
// Role management: Set up role. This sketch uses the same software for all the nodes
// in this system. Doing so greatly simplifies testing.
typedef enum { role_ping_out = 1, role_pong_back } role_e; // The various roles supported by this sketch
const char* role_friendly_name[] = { "invalid", "Ping out", "Pong back"}; // The debug-friendly names of those roles
role_e role = role_pong_back; // The role of the current running sketch
byte counter = 1; // A single byte to keep track of the data being sent back and forth
void setup() {
Serial.begin(115200);
Serial.println("Starting..");
printf_begin();
radio.begin();
radio.enableAckPayload(); // Allow optional ack payloads
radio.enableDynamicPayloads(); // Ack payloads are dynamic payloads
if(radioNumber){
radio.openWritingPipe(addresses[1]); // Both radios listen on the same pipes by default, but opposite addresses
radio.openReadingPipe(1,addresses[0]); // Open a reading pipe on address 0, pipe 1
}else{
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1,addresses[1]);
}
radio.startListening(); // Start listening
radio.writeAckPayload(1,&counter,1); // Pre-load an ack-paylod into the FIFO buffer for pipe 1
}
void loop() {
printf("----------------------------------------------\n");
radio.printDetails();
printf("----------------------------------------------\n");
delay(5000);
}
Output when using the battery:
----------------------------------------------
STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 a = 0x0000800f00 0x00f8030000
RX_ADDR_P2-5 a = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0300c00360
RX_PW_P0-6 a = 0x00 0x60 0x00 0x60 0x00 0x60
EN_AA = 0x00
EN_RXADDR a = 0x60
RF_CH = 0x00
RF_SETUP a = 0x60
CONFIG = 0x60
DYNPD/FEATURE a = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
----------------------------------------------
----------------------------------------------
STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 a = 0x0000c01f00 0x0000f80100
RX_ADDR_P2-5 a = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0000e00360
RX_PW_P0-6 a = 0x00 0x60 0x00 0x60 0x00 0x60
EN_AA = 0x00
EN_RXADDR a = 0x60
RF_CH = 0x00
RF_SETUP a = 0x60
CONFIG = 0xe0
DYNPD/FEATURE a = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
----------------------------------------------
----------------------------------------------
STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 a = 0x0000800f00 0x0000f80300
RX_ADDR_P2-5 a = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0000e00360
RX_PW_P0-6 a = 0x00 0x60 0x00 0x60 0x00 0x60
EN_AA = 0x00
EN_RXADDR a = 0x60
RF_CH = 0x00
RF_SETUP a = 0x60
CONFIG = 0xe0
DYNPD/FEATURE a = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
----------------------------------------------
----------------------------------------------
STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 a = 0x0000c00f00 0x0000fc0100
RX_ADDR_P2-5 a = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0300c00360
RX_PW_P0-6 a = 0x00 0x60 0x00 0x60 0x00 0x60
EN_AA = 0x00
EN_RXADDR a = 0x60
RF_CH = 0x00
RF_SETUP a = 0x60
CONFIG = 0x60
DYNPD/FEATURE a = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
----------------------------------------------
----------------------------------------------
STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 a = 0x0000c00f00 0x00f8010000
RX_ADDR_P2-5 a = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0000e00360
RX_PW_P0-6 a = 0x00 0x60 0x00 0x60 0x00 0x60
EN_AA = 0x00
EN_RXADDR a = 0x60
RF_CH = 0x00
RF_SETUP a = 0x60
CONFIG = 0x60
DYNPD/FEATURE a = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
----------------------------------------------
I am using this RF24 Library: GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices