Verify transmission with NRF24l01

Hello!
I have some trouble with two NRF24l01 modules. I am using to arduino uno, and trying to transmit from one Nrf24 to the other.
I used this to transmit:

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int SW1 = 7;
 
void setup(void) {
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(pipe);
}
 
void loop(void) {
  if (digitalRead(SW1) == HIGH) {
  msg[0] = 111;
  radio.write(msg, 1);
  }
}

And this to receive:

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 3;

void setup(void) {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();
  pinMode(LED1, OUTPUT);
}

void loop(void) {
  if (radio.available()) {
    bool done = false;    
    while (!done){
      done = radio.read(msg, 1);      
      Serial.println(msg[0]);
      if (msg[0] == 111) {
        delay(10);
        digitalWrite(LED1, HIGH);
      }
      else digitalWrite(LED1, LOW);
      delay(10);
    }
  }
  else{
    Serial.println("No radio available");
  }
}

But serial monitor from receiver shows: No radio available.

I want to test each device, one by one. How can I see if the transmitter transmits something? How can I test this?

moderatore:
+ added code tags = # button above smileys
+ code layout = CTRL-T in the IDE ==> improves readability

I would start with add a delay(1000) after a 111 was sent. otherwise there might be send dozens of bytes after a keypress

setup() is missing a pinMode(SW1, INPUT); statement

some debug statements could help to trace

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

int msg[1];
unsigned long count = 0;

RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int SW1 = 7;
 
void setup(void) 
{
  Serial.begin(9600);
  Serial.println("Start RF24 sender");

  radio.begin();
  radio.openWritingPipe(pipe);
}
 
void loop(void) {
  if (digitalRead(SW1) == HIGH) {
    msg[0] = 111;
    radio.write(msg, 1);

    Serial.print("sent msg: ");
    Serial.println(count++);
  }
}

update: missed some header files

I tried your solution. I uploaded your program, I declared the input, and put the delay. I still see "no radio available" in Serial Monitor. But I don't understand how can I test if the transmitter works.

I missed some header files in the post. Can you post the (Serial) output of the transmitter? Can you post the schematic how you connected the transmitter?

What do you mean by the serial output of transmitter? I just linked 6 wires from transmitter to Arduino like this. 1 - GND 2 - VCC 3.3V !!! NOT 5V 3 - CE to Arduino pin 9 4 - CSN to Arduino pin 10 5 - SCK to Arduino pin 13 6 - MOSI to Arduino pin 11 7 - MISO to Arduino pin 12 8 - UNUSED

I used external voltage sources to supply the transmitter/receiver at 3.3V( between 3.2 -3.6) . I made a link for the nrf GND, arduino GND and source GND. There is no schematic. The library and the link scheme were taken from http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

I’m as new to this set up as you are and having spent a happy few hours ripping out wires, putting them back inserting many serial.prints all over my code I finally found a suggestion about soldering a 10uF cap across Vcc and Gnd on the Transiever modules.
Hey ho things started working.
Just as an aside, I downloaded most of the nrf24l01 libraries I could find and the one that I found easiest was the MIRf library I.e. It compiled and my temperatures flew across the ether…
Now just got to figure the rest of it out… I managed to break it again … Too many flying leads.

So to summarise try 10uf between vcc (3.3) and ground
Oh and good luck
Richard

I tried the capacitors but still not working. Please can you give me your library and your programs which worked for you? My email is: vvlad18@gmail.com . I don't know what to do. I tried to think that the nrf are damaged

Hi Vlad,

Have sent library + ino files to you.. sorry for delay