NRF24L01+ No radio available

Hi All,

I'm having trouble getting started with the NRF24L01+ modules. I started with Maniacbug's RF24 library and the basic joystick Rx/Tx sketch as described in this video from Juilian Ilet: 1-Day Project: Arduino and nRF24L01+ Data Transceiver - YouTube. I tried the TMRh20 branch. Tried the Getting Started sketch and the pingpair_test. Tried UNO with Pro Mini, UNO with UNO, 3.3v not 5v. With and without the baseboards. Checked and re-checked pin setup. Added capacitors. Tried three different radio modules (I'm pretty sure I've not fried all three of them)... all I ever get is "No radio available".

My gut tells me I'm missing something very basic as all of the issues I've read were at least getting a signal. Any help would be greatly appreciated.

Hi
Do you see the radio details in your terminal software at power on ?.

Are the cs/csn pin assignments correct for your setup.

Triple check your data/control lines to and from the mcu/ide/radio.

Which terminal software are you using and is it correctly setup for TX.

Essef 8)

Ps i use BRAYS terminal

Output:

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS		 = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1	 = 0x0000000000 0x0000000000
RX_ADDR_P2-5	 = 0x00 0x00 0x00 0x00
TX_ADDR		 = 0x0000000000
RX_PW_P0-6	 = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA		 = 0x00
EN_RXADDR	 = 0x00
RF_CH		 = 0x00
RF_SETUP	 = 0x00
CONFIG		 = 0x00
DYNPD/FEATURE	 = 0x00 0x00
Data Rate	 = 1MBPS
Model		 = nRF24L01
CRC Length	 = Disabled
PA Power	 = PA_MIN

Pin setup:

CE 9
CSN 10
SCK 13
MO 11
MI 12
IRQ 2

Sketch:

/*
 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */

/**
 * Example for Getting Started with nRF24L01+ radios. 
 *
 * This is an example of how to use the RF24 class.  Write this sketch to two 
 * different nodes.  Put one of the nodes into 'transmit' mode by connecting 
 * with the serial monitor and sending a 'T'.  The ping node sends the current 
 * time to the pong node, which responds by sending the value back.  The ping 
 * node can then see how long the whole cycle took.
 */

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"

//
// Hardware configuration
//

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10 

RF24 radio(9,10);

//
// Topology
//

// Radio pipe addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

//
// Role management
//
// Set up role.  This sketch uses the same software for all the nodes
// in this system.  Doing so greatly simplifies testing.  
//

// The various roles supported by this sketch
typedef enum { role_ping_out = 1, role_pong_back } role_e;

// The debug-friendly names of those roles
const char* role_friendly_name[] = { "invalid", "Ping out", "Pong back"};

// The role of the current running sketch
role_e role = role_pong_back;

void setup(void)
{
  //
  // Print preamble
  //

  Serial.begin(57600);
  printf_begin();
  printf("\n\rRF24/examples/GettingStarted/\n\r");
  printf("ROLE: %s\n\r",role_friendly_name[role]);
  printf("*** PRESS 'T' to begin transmitting to the other node\n\r");

  //
  // Setup and configure rf radio
  //

  radio.begin();

  // optionally, increase the delay between retries & # of retries
  radio.setRetries(15,15);

  // optionally, reduce the payload size.  seems to
  // improve reliability
  //radio.setPayloadSize(8);

  //
  // Open pipes to other nodes for communication
  //

  // This simple sketch opens two pipes for these two nodes to communicate
  // back and forth.
  // Open 'our' pipe for writing
  // Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)

  //if ( role == role_ping_out )
  {
    //radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  //else
  {
    //radio.openWritingPipe(pipes[1]);
    //radio.openReadingPipe(1,pipes[0]);
  }

  //
  // Start listening
  //

  radio.startListening();

  //
  // Dump the configuration of the rf unit for debugging
  //

  radio.printDetails();
}

void loop(void)
{
  //
  // Ping out role.  Repeatedly send the current time
  //

  if (role == role_ping_out)
  {
    // First, stop listening so we can talk.
    radio.stopListening();

    // Take the time, and send it.  This will block until complete
    unsigned long time = millis();
    printf("Now sending %lu...",time);
    bool ok = radio.write( &time, sizeof(unsigned long) );
    
    if (ok)
      printf("ok...");
    else
      printf("failed.\n\r");

    // Now, continue listening
    radio.startListening();

    // Wait here until we get a response, or timeout (250ms)
    unsigned long started_waiting_at = millis();
    bool timeout = false;
    while ( ! radio.available() && ! timeout )
      if (millis() - started_waiting_at > 200 )
        timeout = true;

    // Describe the results
    if ( timeout )
    {
      printf("Failed, response timed out.\n\r");
    }
    else
    {
      // Grab the response, compare, and send to debugging spew
      unsigned long got_time;
      radio.read( &got_time, sizeof(unsigned long) );

      // Spew it
      printf("Got response %lu, round-trip delay: %lu\n\r",got_time,millis()-got_time);
    }

    // Try again 1s later
    delay(1000);
  }

  //
  // Pong back role.  Receive each packet, dump it out, and send it back
  //

  if ( role == role_pong_back )
  {
    // if there is data ready
    if ( radio.available() )
    {
      // Dump the payloads until we've gotten everything
      unsigned long got_time;
      bool done = false;
      while (!done)
      {
        // Fetch the payload, and see if this was the last one.
        done = radio.read( &got_time, sizeof(unsigned long) );

        // Spew it
        printf("Got payload %lu...",got_time);

	// Delay just a little bit to let the other unit
	// make the transition to receiver
	delay(20);
      }

      // First, stop listening so we can talk
      radio.stopListening();

      // Send the final one back.
      radio.write( &got_time, sizeof(unsigned long) );
      printf("Sent response.\n\r");

      // Now, resume listening so we catch the next packets.
      radio.startListening();
    }
  }

  //
  // Change roles
  //

  if ( Serial.available() )
  {
    char c = toupper(Serial.read());
    if ( c == 'T' && role == role_pong_back )
    {
      printf("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK\n\r");

      // Become the primary transmitter (ping out)
      role = role_ping_out;
      radio.openWritingPipe(pipes[0]);
      radio.openReadingPipe(1,pipes[1]);
    }
    else if ( c == 'R' && role == role_ping_out )
    {
      printf("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK\n\r");
      
      // Become the primary receiver (pong back)
      role = role_pong_back;
      radio.openWritingPipe(pipes[1]);
      radio.openReadingPipe(1,pipes[0]);
    }
  }
}
// vim:cin:ai:sts=2 sw=2 ft=cpp

Looks like your powering the Nrfs from the 3.3v line on your ide,s, but the 5v to 3.3v conversion is already taken care of by your nrf adapter boards (same as mine) your performing the voltage regulation twice and losing juice in the process.

So move the VCC from 3.3v to 5v on your duinos as your effectively under powering the nrfs.

Essef 8)

PS obviously only use 5v with your breakout board :cry:

Thank you.

No Problem, hope its the cure :o if not re-post and ill help were possible.

Essef 8)

I'm getting an initial response now. This is with the TMRh20 Getting Started:

RF24/examples/GettingStarted/

*** PRESS 'T' to begin transmitting to the other node

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 a = 0x65646f4e32 0x65646f4e31
RX_ADDR_P2-5 a = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x65646f4e32
RX_PW_P0-6 a = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR a = 0x02
RF_CH = 0x4c
RF_SETUP a = 0x07
CONFIG = 0x0f
DYNPD/FEATURE a = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

Except that on transmit it hangs up at "Now sending":

*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending

Switching over to the ManiacBug Getting Started, I get a running time out:

Now sending 5277...failed.

Failed, response timed out.

Running the TMRh20 sketch again, I tried pulling pins 9/10 from the UNO and putting them back. I assume it is just talking to itself with a "0" response:

Sent 8767956, Got response 0, round-trip delay: 209205632 microseconds

Now sending

Interestingly, a couple of random responses in the list came back with data. I didn't capture it, but it was something like:

Sent 8767956, Got response #######, round-trip delay: 209205632 microseconds

Now sending

I wasn't watching the other UNO, so I don't know if the RX led flashed. Should I expect the RX led to flash if everything were working correctly? Could this have been an anomaly, or is it proof positive of at least a couple successful responses?

I thought the generic UNO may be faulty, so I tested each board as ping/pong and got the TX led as expected on both.

I tried all this in both the ManiacBug and TMRh20 sketches, noting that TMR defines pins 7/8 instead of 9/10.

Other questions:
Does the status returned in the initial setup, "STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0" and the following lines, return solely from the UNO, or does it indicate there is some return coming from the RF module? What can be determined from the status info? For instance, I might guess "RX_P_NO=7" means receiver pin 7, yet neither sketch defines pin 7.

And finally:
Can I have both UNO’s plugged into my two USB ports at the same time? Does this effect USB power output? Serial communication? I tried with both connected, as well as having the pong module disconnected and powered externally. I tried that power supply at 6, 7.5 and 9 volts, thinking it might still be a power issue.

ok
looks like your making progress

You can run both unos but beware !, if the usb port isnt protected internally you could damage it permanently so best to run on psu,s once the sketches are loaded.

The pins cs/csn are assignable by the user just make sure you remember to swap them on the ide when using various sketches.

Due to speed differences and signal length you may or may not see activity on the rx/tx leds.

Load the pingpairdyn sketch i found this a good way for looking at signal quality/packet loss and a general "my setups working ok test" etc etc.

Essef :8)

Heres my cs/csn assigners.

I just comment in whichever setup im using at the time

//RF24 radio(9,10); // USE WITH UNO_IDE + FLYING LEADS
//RF24 radio(3,4); // USE WITH UNO_IDE + NRF SHEILD
//RF24 radio(53,48); // USE WITH MEGA_IDE
//RF24 radio(7,8); // USE WITH ATTINY84

you can chop and change the pin assignments to suit your needs.

ESSEF :8)

Follow up: I've finally got a basic Tx/Rx running after switching out RF modules.

On the module in question I had soldered a 100uF capacitor (that's all I had on hand). Perhaps I fried something during soldering, or it was bad from the start, since it still doesn't work after removing the capacitor.

After the module switch I was getting intermittent success; mostly no radio, then some data, more no radio, and so on. That I believe is due to poor connections on the clone UNO. The data seemed to come through when moving the board around and jiggling the connections.

I've switched back to the Pro Mini and data is coming through cleanly. So it seems my earlier attempts at testing my different RF modules were sabotaged by the poor connections.

Anyhow, this has been a lesson in how to debug as much anything. Don't make assumptions. Keep trying different solutions. And for anyone else who's very new to this, just keep at it. You'll learn as you go.