Arduino pro mini te362 and nRF24L01+

Hello Friends,

Im currently working with 2 arduino pro mini te362, a dc to dc Buck converter voltage to 3.3v, 2-6000 maH 3.7v 18650 batteries and nRF24L01 +.

Wired as followed...

Arduino Pro Mini te362 to nRF24L01
(arduino) Pin 13 going to 5 sck (nRF24L01)
(arduino) Pin 12 going to 7 miso (nRF24L01)
(arduino) Pin 11 going to 6 mosi (nRF24L01)
(arduino) Pin 10 going to 4 csn (nRF24L01)
(arduino) Pin 8 going to 3 Ce (nRF24L01)

nRF24L01 has been connected dircectly to battery/dctodc buck converter 3.3v and ground

I have separated power directly to the arduinos both with 5v dctodc buck converter and direct connection through wire to computer

I am currently trying to get communication between the two boards/Rf transmitters with no success. the code I'm running is the standard example codes that come with RadioHead library the server side I'm using the arduino/file/Examples/RadioHead/nRF24/nRF24_server and on the client side I am using arduino/file/Examples/RadioHead/nRF24/nRF24_client.

I verify then upload both individually into one and the other. With no success of connection.
now I have tried several troubleshooting techniques to try and correct my issue. With little to no success. I have tried changing arduino boards because I have several of them along with the nRF24L01 with the same results. I have also put a 100uF cap on the nRF24L01 to try is see if it will help nothing. The serial monitor on the server side will say "init failed" then nothing else. The serial monitor on the client side will say "Sending to nrf24_server No reply, is nrf24_server running?" for eternity.

If someone would be so kind in helping me with this issue I would appreciate it.

@neoteb, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project :wink: See About the Installation & Troubleshooting category.

We would be only too pleased to help you but you have to help us by providing real information not just a catalogue of things you tried to get it working.

So first off you need to post a schematic so we can see what you have. A list of what is wired to what simply will not cut it in electronics.

Next we need to see your code in order to spot if you have a mistake in that.

Once we have that information we can begin to help you.

Word sallad wirings never beat a real wiring diagram...

IMG_1106

Server side

// nrf24_server.pde
// -- mode: C++ --
// Example sketch showing how to create a simple messageing server
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_client
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (Anarduino Mini Details) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
RH_NRF24 nrf24;
// RH_NRF24 nrf24(8, 7); // use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini

void setup()
{
Serial.begin(9600);
while (!Serial)
; // wait for serial port to connect. Needed for Leonardo only
if (!nrf24.init())
Serial.println("init failed");
// Defaults after init are 2.402 GHz (channel 2), 2Mbps, 0dBm
if (!nrf24.setChannel(1))
Serial.println("setChannel failed");
if (!nrf24.setRF(RH_NRF24::DataRate2Mbps, RH_NRF24::TransmitPower0dBm))
Serial.println("setRF failed");
}

void loop()
{
if (nrf24.available())
{
// Should be a message for us now
uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (nrf24.recv(buf, &len))
{
// NRF24::printBuffer("request: ", buf, len);
Serial.print("got request: ");
Serial.println((char*)buf);

  // Send a reply
  uint8_t data[] = "And hello back to you";
  nrf24.send(data, sizeof(data));
  nrf24.waitPacketSent();
  Serial.println("Sent a reply");
}
else
{
  Serial.println("recv failed");
}

}
}

Client Side

// nrf24_server.pde
// -- mode: C++ --
// Example sketch showing how to create a simple messageing server
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_client
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (Anarduino Mini Details) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
RH_NRF24 nrf24;
// RH_NRF24 nrf24(8, 7); // use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini

void setup()
{
Serial.begin(9600);
while (!Serial)
; // wait for serial port to connect. Needed for Leonardo only
if (!nrf24.init())
Serial.println("init failed");
// Defaults after init are 2.402 GHz (channel 2), 2Mbps, 0dBm
if (!nrf24.setChannel(1))
Serial.println("setChannel failed");
if (!nrf24.setRF(RH_NRF24::DataRate2Mbps, RH_NRF24::TransmitPower0dBm))
Serial.println("setRF failed");
}

void loop()
{
if (nrf24.available())
{
// Should be a message for us now
uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (nrf24.recv(buf, &len))
{
// NRF24::printBuffer("request: ", buf, len);
Serial.print("got request: ");
Serial.println((char*)buf);

  // Send a reply
  uint8_t data[] = "And hello back to you";
  nrf24.send(data, sizeof(data));
  nrf24.waitPacketSent();
  Serial.println("Sent a reply");
}
else
{
  Serial.println("recv failed");
}

}
}

Thats the error you get when there is a wiring problem, or the NRF24s are faulty and the Pro Mini cannot talk to the NRF24.

@srnet @Grumpy_Mike

I have been requested to post wiring diagram and the code. So hopefully that will help with information better if anything else is needed to understand my issue please let me know I will be more then happy to comply with your requests. Both boards are wired the exact same way and they both are using breakout boards to help with programming them. Other projects I do not have issues with these Arduino's first one I have run into that is giving me an issue. Weird thing is that I'm just testing first to see if they can communicate but not going any further than that right now because no communcation.

@srnet @Grumpy_Mike

I happen to stumble upon a previous post that looks almost similar in the issue.

So weird not sure what is going on with this please if someone can help with this. Maybe its a way to program differently for this arduino to communicate to the nRF24L01 maybe its the pins for CE and CSN not sure. Someone with more experience then myself which is the majority of this forum I would greatly appreciate it. Do some confirmation would be great.

So OK on the code, but you were not requested to post a wiring diagram but a schematic.
What you have posted is just a collection of pictures with some lines indicating some connections. From a seeing what you have done point of view it is not very helpful.
For example there is no way to see where the buck converter is getting its power from, and no indication as to what those wires going into the other components do.

@srnet @Grumpy_Mike

The PinOut diagram I found is a spark fun, I also found a generic one for the arduino pro mini te362 The one I have is from xcsource.

Look what you have to do is to incorporate all that into a schematic, not drip feed individual bits.
It is almost as if you don't know what a schematic looks like. Would you like me to point you to one?
Reading a schematic
http://blog.makezine.com/archive/2011/01/reading-circuit-diagrams.html
Colin's Lab video on reading a schematic
https://www.youtube.com/watch?v=9cps7Q_IrX0

@Grumpy_Mike

The code you posted looks like two server side programs, should one of them be a client side program ?

@srnet

I believe your right let me reapply

Server side

// nrf24_server.pde
// -- mode: C++ --
// Example sketch showing how to create a simple messageing server
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_client
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (Anarduino Mini Details) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
RH_NRF24 nrf24;
// RH_NRF24 nrf24(8, 7); // use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini

void setup()
{
Serial.begin(9600);
while (!Serial)
; // wait for serial port to connect. Needed for Leonardo only
if (!nrf24.init())
Serial.println("init failed");
// Defaults after init are 2.402 GHz (channel 2), 2Mbps, 0dBm
if (!nrf24.setChannel(1))
Serial.println("setChannel failed");
if (!nrf24.setRF(RH_NRF24::DataRate2Mbps, RH_NRF24::TransmitPower0dBm))
Serial.println("setRF failed");
}

void loop()
{
if (nrf24.available())
{
// Should be a message for us now
uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (nrf24.recv(buf, &len))
{
// NRF24::printBuffer("request: ", buf, len);
Serial.print("got request: ");
Serial.println((char*)buf);

  // Send a reply
  uint8_t data[] = "And hello back to you";
  nrf24.send(data, sizeof(data));
  nrf24.waitPacketSent();
  Serial.println("Sent a reply");
}
else
{
  Serial.println("recv failed");
}

}
}

Client Side

// nrf24_client.pde
// -- mode: C++ --
// Example sketch showing how to create a simple messageing client
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_server.
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (Anarduino Mini Details) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
RH_NRF24 nrf24;
// RH_NRF24 nrf24(8, 7); // use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini

void setup()
{
Serial.begin(9600);
while (!Serial)
; // wait for serial port to connect. Needed for Leonardo only
if (!nrf24.init())
Serial.println("init failed");
// Defaults after init are 2.402 GHz (channel 2), 2Mbps, 0dBm
if (!nrf24.setChannel(1))
Serial.println("setChannel failed");
if (!nrf24.setRF(RH_NRF24::DataRate2Mbps, RH_NRF24::TransmitPower0dBm))
Serial.println("setRF failed");
}

void loop()
{
Serial.println("Sending to nrf24_server");
// Send a message to nrf24_server
uint8_t data = "Hello World!";
nrf24.send(data, sizeof(data));

nrf24.waitPacketSent();
// Now wait for a reply
uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);

if (nrf24.waitAvailableTimeout(500))
{
// Should be a reply message for us now
if (nrf24.recv(buf, &len))
{
Serial.print("got reply: ");
Serial.println((char*)buf);
}
else
{
Serial.println("recv failed");
}
}
else
{
Serial.println("No reply, is nrf24_server running?");
}
delay(400);
}

That code wont compile if copied.

For details on how to correctly post code, read here;

@srnet @Grumpy_Mike
Just more information with pictures to help

Over View Real time

Looks like you have CE wired to pin 9 on the 'schematic' and picture, but the library code is expecting it on pin 8 ?

Any progress report ?

Was it a wiring error ?

@srnet

Thank you so much for responses and help beside the wiring diagram and other issues that you see meaning the mixture between board diagram and program they are the same. The issue I found was grounding not solid curtesy of bread board jumping wires once it was a solid connection started working when I was moving wires it would work then not work found one of the - holes for one of the wires was a little loose. Now it works the nrf24l01 with out external antenna needs almost direct sight to get a good connection the one with external antenna has awesome range.

I read that pin 8 and pin 9 can be used the same way so I tried both pins separately and reimplemented the code changing the pin corresponding with what I put in real time along with in code to see if it would fix the problem.

Thank you so much for the information on posting I do not want to aggravate people but sometimes the process of learning.. Some people with patients is a blessing.

Server side

// nrf24_server.pde
// -*- mode: C++ -*-
// Example sketch showing how to create a simple messageing server
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24  if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_client
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (http://www.anarduino.com/mini/) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
//RH_NRF24 nrf24;
RH_NRF24 nrf24(9, 10); //   use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini

void setup()
{
  Serial.begin(9600);
  while (!Serial)
    ; // wait for serial port to connect. Needed for Leonardo only
  if (!nrf24.init())
    Serial.println("init failed");
  // Defaults after init are 2.402 GHz (channel 2), 2Mbps, 0dBm
  if (!nrf24.setChannel(1))
    Serial.println("setChannel failed");
  if (!nrf24.setRF(RH_NRF24::DataRate2Mbps, RH_NRF24::TransmitPower0dBm))
    Serial.println("setRF failed");
}

void loop()
{
  if (nrf24.available())
  {
    // Should be a message for us now
    uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    if (nrf24.recv(buf, &len))
    {
      //      NRF24::printBuffer("request: ", buf, len);
      Serial.print("got request: ");
      Serial.println((char*)buf);

      // Send a reply
      uint8_t data[] = "And hello back to you";
      nrf24.send(data, sizeof(data));
      nrf24.waitPacketSent();
      Serial.println("Sent a reply");
    }
    else
    {
      Serial.println("recv failed");
    }
  }
}

Client Side

// nrf24_client.pde
// -*- mode: C++ -*-
// Example sketch showing how to create a simple messageing client
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_server.
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (http://www.anarduino.com/mini/) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
//RH_NRF24 nrf24;
RH_NRF24 nrf24(9, 10); // use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini

void setup()
{
  Serial.begin(9600);
  while (!Serial)
    ; // wait for serial port to connect. Needed for Leonardo only
  if (!nrf24.init())
    Serial.println("init failed");
  // Defaults after init are 2.402 GHz (channel 2), 2Mbps, 0dBm
  if (!nrf24.setChannel(1))
    Serial.println("setChannel failed");
  if (!nrf24.setRF(RH_NRF24::DataRate2Mbps, RH_NRF24::TransmitPower0dBm))
    Serial.println("setRF failed");
}


void loop()
{
  Serial.println("Sending to nrf24_server");
  // Send a message to nrf24_server
  uint8_t data[] = "Hello World!";
  nrf24.send(data, sizeof(data));

  nrf24.waitPacketSent();
  // Now wait for a reply
  uint8_t buf[RH_NRF24_MAX_MESSAGE_LEN];
  uint8_t len = sizeof(buf);

  if (nrf24.waitAvailableTimeout(500))
  {
    // Should be a reply message for us now
    if (nrf24.recv(buf, &len))
    {
      Serial.print("got reply: ");
      Serial.println((char*)buf);
    }
    else
    {
      Serial.println("recv failed");
    }
  }
  else
  {
    Serial.println("No reply, is nrf24_server running?");
  }
  delay(400);
}