Go Down

Topic: Using nRF24L01+ (Read 2 times) previous topic - next topic

Siddiki

Hello, i am using 2 nRF24L01+ modules with 2 arduinos. i have an arduino mega 2560 and an arduino mega 1280. i want to send my data from one to the other. i have tried a dozen of programs but i m not able to get the accurate data. the data i receive is 00 or a corrupted data. i have tried the ping client and ping sever pair.. at sever side i was getting ('got packet' and 'reply sent') and at client side i was getting (ping: 1029, 2056 etc etc it was adding around 1000 to previous value each time). please help me out in this project. i want to know every thing, the pin connections, codes for transmitter and receiver sides.. please help me out !!! :~

Thank you,
Samad Siddiqui

Nick_Pyner

Hi

Since you are using Megas, your problem might have something to do with the power to the nRF module. I am trying to find out about this.

Docedison

@ OP. There are a large number of posts regarding the nRF24XX and nRF24LXX devices. My recommendation is to read them all. Search this website as well as Google nRF24L00''s for whatever you find. it's a bit of reading but in almost every post or article I've found more and useful data.
Maniacbug's library is well done and easy to use, I recommend it highly.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

shiu748

Hello

Which library are you using in your program as there are a number of libraries available for nRF24L01+ radio modules.

Shiv

oric_dan

#4
Feb 27, 2013, 01:40 am Last Edit: Feb 27, 2013, 02:01 am by oric_dan Reason: 1
I just received a couple of nRF24L01 modules, and hooked them up. I used the following
library, and the GettingStarted example sketch from the library, and they worked the
first time great, which kind of amazing considering how many other devices and libraries
need serious debugging to get to work. Yay!

http://maniacbug.github.com/RF24/index.html
https://github.com/maniacbug/RF24/

First off, you need to power at 3.3V **ONLY**.  5V will kill the modules. However,
according to the datasheet, the I/O pins are 5V tolerant. The UNO and Mega boards
cannot provide much current at 3.3V, but these modules only require around 13 mA,
so that should be ok [I think].

Then, connect the SPI pins to the usual places, and the module CS pin to Arduino D10,
and CE pin to D9. The IRQ pin on the module isn't needed, at least for the GS sketch.
I simply jumpered all the module pins to the Arduino board pins without any shields.

Note - these callouts may need changing for the Mega board. I'm using a UNO-compatible
board.

Actually, there are several bugs in the maniacbug GettingStarted sketch. The initial
signon responds with some garbage, and the modules don't go into receive mode properly
at startup, but you just have to press 'T' on one side and 'R' on the other side to get them
to talk, and they go.

I just did a little range test, and it's fairly pathetic with these things. Going from one room
to another is only good for about 25 feet [8 m] through a standard wood frame wall. I guess
that's about what to expect for 2.4 Ghz and 0 dbm [1 mW] output.

shiu748

A greater range would be achieved if you use 1Mbps or 256kbps air data rate.

Nick_Pyner

#6
Feb 27, 2013, 03:04 am Last Edit: Feb 27, 2013, 03:14 am by Nick_Pyner Reason: 1
I need two walls and 15m. 256kbps sounds plenty fast enough for my needs. How do I ensure this rate?

Thank you.


A greater range would be achieved if you use 1Mbps or 256kbps air data rate.

oric_dan


A greater range would be achieved if you use 1Mbps or 256kbps air data rate.

Ok, the library defaults to 1 Mbps data rate, so I patched it 250 Kbps, and the
range increased from about 25 feet [8 m] up to roughly 40 feet [12 m]. Now
going through the wall of the house to the outside.

Nick_Pyner


Ok, the library defaults to 1 Mbps data rate, so I patched it 250 Kbps, a


Sounds great, but what are we talking about here?

Is the library RF24.h?

I see line 32 therein has a red zero

Code: [Select]
typedef enum { RF24_1MBPS = 0, RF24_2MBPS, RF24_250KBPS } rf24_datarate_e;

so can I just alter that to

Code: [Select]
typedef enum { RF24_1MBPS, RF24_2MBPS, RF24_250KBPS = 0 } rf24_datarate_e;

?

It looks promising........

oric_dan

#9
Feb 27, 2013, 06:19 am Last Edit: Feb 27, 2013, 08:28 am by oric_dan Reason: 1
No, in RF24.cpp is the following function, and I patched the last line as shown,
Code: [Select]
void RF24::begin(void)
{
 ....
 if( setDataRate( RF24_250KBPS ) )
 {
   p_variant = true ;
 }
 // Then set the data rate to the slowest (and most reliable) speed supported by all
 // hardware.

// MODIFIED - 02/26/13.
//  setDataRate( RF24_1MBPS ) ;
 setDataRate( RF24_250KBPS );
 ....
}

Don't ask me what the comment means, I don't know.

Nick_Pyner

OK Thank you.
I'll try that out.
My RF24s have just arrived.



shiu748

Which library are you using. I would recommend using the NRF24 library. Changing the air data rate is easy, just go through the examples given in the library.

oric_dan


Which library are you using. I would recommend using the NRF24 library. Changing the air data rate is easy, just go through the examples given in the library.

See reply #4.

shiu748

You are using RF24 library. I would recommend using the NRF24 library, that is what I used for my research. Its simple and easy to understand.

oric_dan

All in all, I was "very very" happy to find that maniacbug's library and examples worked
without any MAJOR debugging efforts. In contrast, I spent several weeks mucking with the
stupid JeeNode library and s.w. before it would ever work, and then I only got lucky in the
end - ie, found a sketch in the Arduino Cookbook that worked right the first time.

OTOH, after just 1 day of testing, I'm already very disappointed with the nRF24L01 modules.
Power is too weak, and range is too small. They are basically ok for "in the same room".

After playing with Xbees for 7 or 8 years, it's very hard to beat them for ease of use and long
usable range. Nothing else comes even close, even if they are a more expensive. Maybe you
get what you pay for. The only real problem with XBees is that most of the shields are poorly
designed.

Go Up