Go Down

Topic: RF24 Library: Driver for nRF24L01(+) 2.4GHz Wireless Transceiver (Read 236435 times) previous topic - next topic

KarmaProd

Right, some kind of progress, but even more puzzles:-

Occaisonally when resetting, one of my units will show the addresses (pipe) as E2 & D2, whilst the other shows both as D2.

If I try transmitting from the E2/D2 then I get nothing. If I try transmitting from the D2/D2 then the E2/D2 responds as you expect and works ping/pomg. If I then change the D2/D2 to 'R' and the E2/D2 to 'T; then it works again! Strange, it will only work that way round AFTER I've had it working the opposite way.

I suspect that if both units show E2/D2 correctly then I could reliably transmit from either first and it will work.

Anyone have any idea as to what is going on here?
tack, I had the same problems as you:

«I often see different address (0xe7e7e7e77f) from the programmed one (0xf0f0f0f0e1), i.e.,
RX_ADDR_P0-1    = 0xe7e7e7e77f 0xf0f0f0f0d2
or both 0xf0f0f0f0d2»

«Occaisonally when resetting, one of my units will show the addresses (pipe) as E2 & D2, whilst the other shows both as D2»

«If I try transmitting from the E2/D2 then I get nothing. If I try transmitting from the D2/D2 then the E2/D2 responds as you expect and works ping/pomg. If I then change the D2/D2 to 'R' and the E2/D2 to 'T; then it works again! Strange, it will only work that way round AFTER I've had it working the opposite way


Maybe you have no problems any more, but I believe this could help other people as well. I fixed these problems uncommenting lines from 89 to 98:
Code: [Select]
 if ( role == role_ping_out )
  {
    radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  else
  {
    radio.openWritingPipe(pipes[1]);
    radio.openReadingPipe(1,pipes[0]);
  }

paco1990

Hello, I am new to the forum,

I apologize I can help, I have a problem with arduino due and NRF24L01,
I can not establish connection with the arduino due that I have, I have tried with several libraries, and at the moment I'm working with rf24, I modified the libraries and miss connections due and I can not get the connection, and you remove the NRF24L01 and send me various data, and hope you can help me, thanks in advance

GazS

Hi,  this great little board has caused me so much frustration with poor / no connection and inconsistent range,  please see my YouTube clip for an unbelievable easy fix

https://youtu.be/JWN9SUhMHhI

I hope my suffering will help others ! , please let me know how you get on. 

Cheers,  Gaz

ankushg989

Hello friends,

tell me what is use of each and every following function in RF_network library

Code: [Select]
bool send_T(uint16_t to);
bool send_N(uint16_t to);
void handle_T(RF24NetworkHeader& header);
void handle_N(RF24NetworkHeader& header);


what is mean by 'header' here?

cjcj1949

I'm using the optimized library at
http://tmrh20.github.io/RF24/index.html

The GettingStarted sketch works ok. I've added a comparison between the tx data and rx data as the output can be misleading if the radios are both switched to tx rather than both to rx.

The range is about 10 metres through three brick walls at the second to lowest setting. Both 1 Mb and 250k Mb work at this range and power.

The other power settings work as well, including the highest power. I was surprised that no decoupling/reservoir capacitor was needed.

I am using two Unos with pin to socket wiring.


hosein

Hi
i'm working with NRF24l01 by avr.
but my library don't work correctly and reset micro suddenly…
i cant test my NRF to send and receive my data…
plz help me…

haro

hi
I have some problem for compiling nrf24lo1. in 1.6.4 version my code freezes the compiler while in 1.6.3 causes many errors.
I will attach the code and errors.
thanks for help

haro

every library witch i added to software makes errors in compiling. why?????!!!
somebody!!
anybody????

haro

i think find out something.
Im using nano board but for compiling i should change the board type.
is it correct?

Isaac96

@haro, did you download the RF24 library and place it in your libraries folder in your sketchbook?

@maniacbug, do you know what the power consumption of a NRF24L01+ is? Does anyone?
Do not PM me for help. I will delete immediately.
CONNECT THE GROUNDS!

After Tuesday, even the calendar goes W T F

vader7071

I have been searching and have not come across this yet.  I was hoping you could help.

Using the libraries, how would I adjust the transmit power of the nRF24L01?  I read on the data sheet that there are 2 bits you change (either a 11, 10, 01, or 00) to adjust the output power of the unit.

Is there a way to do that using the libraries that I have overlooked?
Creatively engineering consent since 1976.

Avamander

Please DO NOT use this discontinued library.

Update your copy to https://github.com/TMRh20/RF24. It is a fork of maniacbug's version but has gone a long way since.

(Also solder capacitors to your modules 100uF, they should fix most communication issues)

@haro, did you download the RF24 library and place it in your libraries folder in your sketchbook?

@maniacbug, do you know what the power consumption of a NRF24L01+ is? Does anyone?
Datasheet has the data. If I remember correctly, 14mA when transmitting and a few uA when powered off.


I have been searching and have not come across this yet.  I was hoping you could help.

Using the libraries, how would I adjust the transmit power of the nRF24L01?  I read on the data sheet that there are 2 bits you change (either a 11, 10, 01, or 00) to adjust the output power of the unit.

Is there a way to do that using the libraries that I have overlooked?
The continued library fork (github.com/TMRh20/RF24) has the functionality added and the documentation tells a bit more about how to use it.

hi
I have some problem for compiling nrf24lo1. in 1.6.4 version my code freezes the compiler while in 1.6.3 causes many errors.
I will attach the code and errors.
thanks for help
The library you are using is outdated. Use the new fork (github.com/TMRh20/RF24). The new version will not give you the errors.

abdolhamednik

would u please help me on
what are pipes and their addresses and the relationship?

 I want my nRF network to send data to base station even if some defined links are lost, so that an nRF calls the other nRF to take his data and if does not find it, calls another nRF and so on. It means data from any node will finally reach the base station.
Am I right that Library 'RF24network' can not help me?
For example, assume a network of 3 nRF's. I want every nRF to transmit a data that recently received plus 2. what should pipes and addresses be?
for example is it right:
1st nRF: write @ addr A0, read @ pipe0 + addr A2
2nd nRF: write @ addr A1, read @ pipe0 + addr A0
3rd nRF: write @ addr A2, read @ pipe0 + addr A1
??

Robin2

"pipe" is a rather unfortunate choice of name for what is really the ID number for a device. Conceptually very like a phone number.

If you want to transmit data to another device you must know the "number" of the receiving device. And the receiving device also has to know its own number.

If you really need a network I don't have any experience from which to help you.

Perhaps it would be sufficient to have a master and several slaves. The master can send a message to each slave in turn and get a reply. Each slave has a different ID or PIPE. If you use writeAckPayload() the slave can send the data back as part of the automatic acknowledgement and your program does not have to bother with switching between sending and listening.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

ArduStooge

I am really new to arduino and recently bought pair of NRF24L01 to remotely control LEDs blinking. So far I managed to get the LEDs blinking but there are couple problems :

1) If I use library from ManiacBug there's always a lag between button pressed on TX and the actual result on RX.
The lag disappears if I use  library from G Copeland http://forum.arduino.cc/index.php?topic=230681.0 but with this library the result is inaccurate. This means if button A is pressed sometimes LED A blinks but can sometimes blinks other LEDs as well. And always blinks the previous LED blinked regardless which button is pressed.
The best result that I got is when I use Copeland's library for TX and ManiacBug libary for RX. There is no lag and very accurate but ideally I would like to use same library so I don't lose track.

2) When one LED is blinking after a button pressed, the other LEDs cannot blink even if the buttons are pressed. I think this is because I use "delay" function. I tried to use digital blinking from 'Blink W/O Delay' example but so far can only write code for 1 LED.

The code is  below for TX :

Code: [Select]
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int Button1 = 6;
int Button2 = 7;
int Button3 = 8;


void setup(void){
 Serial.begin(9600);
 radio.begin();
 radio.openWritingPipe(pipe);}

void loop(void){
 if (digitalRead(Button1) == LOW){
 msg[0] = 111;
 radio.write(msg, 1);
 }
 
 if (digitalRead(Button2) == LOW){
 msg[0] = 222;
 radio.write(msg, 1);
 }
 
 if (digitalRead(Button3) == LOW){
 msg[0] = 77;
 radio.write(msg, 1);
 }
 
 digitalWrite(Button1, HIGH);
 digitalWrite(Button2, HIGH);
 digitalWrite(Button3, HIGH);
 }



The code is  below for RX :

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

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

void loop(void)
  {
 digitalWrite(LED1,LOW);
 digitalWrite(LED2,LOW);
 digitalWrite(LED3,LOW);
 if (radio.available()){
   bool done = false;   
   while (!done)
   {
     done = radio.read(msg, 1);     
     Serial.println(msg[0]);
//expecting message '111' to blink LED1
     if (msg[0] == 111)
       {
        digitalWrite(LED1, HIGH);
        delay(500);
        digitalWrite(LED1, LOW);
         delay(500);}
         
//expecting message '222' to blink LED2         
     if (msg[0] == 222)
       {
        digitalWrite(LED2, HIGH);
        delay(500);
        digitalWrite(LED2, LOW);
        delay(500);}   
//expecting message '77' to blink LED3
     if (msg[0] == 77)
       {
        digitalWrite(LED3, HIGH);
        delay(500);
        digitalWrite(LED3, LOW);
        delay(500);}     
     else {digitalWrite(LED1, LOW);
     digitalWrite(LED2,LOW); digitalWrite(LED3,LOW);}
     delay(1);}}}



Go Up