Pages: 1 ... 6 7 [8] 9 10 ... 17   Go Down
Author Topic: RF24 Library: Driver for nRF24L01(+) 2.4GHz Wireless Transceiver  (Read 92973 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 120
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello guys,

I have a very similar problem yesterday when using a NANO and a vero/UNO board (with seperate ucb/serial)
I seemed to have All the symptoms above, I nearly threw the whole lot in the bin...

In the end, I made a second vero/UNO board

My assumption was that 'maybe' the USBinterface on the NANO board was in someway conflicting with timings of the RF board when viewing serial data

All I want is a high speed on way data transfer with no acks, and I got it...
Perhaps I still have some tweaking to go but it seems to work for me :@)

Logged

while (z--) { snore; }

Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Big thanks for this amazing libary, at the momment I already tried all the examples included, and even made some modifications.

I want to go further but there are some basic concepts I miss, tried on google, in the main site, taking closer look to the examples, but nothing, I just dont understand some things. I really want to go deeper but I feel a good tutorial is missing. Here are some of the things I dont get.

Whats a pipe? How it changes if I want 2 or 6 nodes to speak.

const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
What the numbers mean?

Maybe after the explanation, I will figure how to solve the next issue, but just in case; How do I need to set the pipes if my network is static 6 nodes, one base. The nodes some times send data to the base and then the base answers with some other data back to the emiting node…

Thanks for any help!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wonder this, if I do this in code:

radio.begin();
radio.setRetries(15,15);
radio.setPALevel(RF24_PA_LOW);
radio.setDataRate(RF24_250KBPS);
radio.setPayloadSize(10);
radio.setChannel(10);
radio.setAutoAck(true);
radio.printDetails();

It's still showing this when I look status of module:
Data Rate        = 1MBPS
Model            = nRF24L01
CRC Length       = 16 bits
PA Power         = PA_HIGH

Should radio.setDataRate(RF24_250KBPS); affect immediately?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Should radio.setDataRate(RF24_250KBPS); affect immediately?
I don't know, but I'd try moving the call to begin() to the end.
Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 828
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's still showing this when I look status of module:
Data Rate        = 1MBPS
Model            = nRF24L01
CRC Length       = 16 bits
PA Power         = PA_HIGH

Should radio.setDataRate(RF24_250KBPS); affect immediately?

This will never work, because the 250KBPS speed is only available on the newer nRF24L01+ chip, not the older nRF24L01. Get the data sheets from Nordic and read up on the chip differences.

« Last Edit: December 27, 2012, 09:03:14 pm by pico » Logged

WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks much this thread, PaulS and Pico, I got this working at least some way. Now I've Mega which has W5100 ethernet to connect Cosm, and with 433Mhzh transmitter to control Nexa by using it's webserver, and now also nRF24L01+ to read temperatures from Nano with nRF24L01+ ds18b20. This works ok but code looks bad, I think I need to use interrupts, more studying  smiley-roll


Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1867
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Finnduino,

Can you please tell us more details of how you have the  nRF24L01 and Ethernet interfaces wired? What did you need to do to get them both working together?

Thanks!
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Kuala Lumpur, Malaysia
Offline Offline
Full Member
***
Karma: 4
Posts: 195
Anything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've tried several libraries and found this library the best and have the best range... thank you to maniacbug for such a wonderful libraries..

I'm using a compatible wireless module from inhaos.com ( http://www.inhaos.com/product_info.php?products_id=35 ) for my testing...

I've a question to ask, can this library or future enhancements ack similar like serial TX/RX on both sides ?




Logged

Germany
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks much this thread, PaulS and Pico, I got this working at least some way. Now I've Mega which has W5100 ethernet to connect Cosm, and with 433Mhzh transmitter to control Nexa by using it's webserver, and now also nRF24L01+ to read temperatures from Nano with nRF24L01+ ds18b20. This works ok but code looks bad, I think I need to use interrupts, more studying  smiley-roll

hey finnduino,

just like terryking228, i think it would be interesting to know how you managed to get an ethernet shield working together with a NRF24l01+ module at the same time smiley-wink

cheers,
stefan
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Having following Arduino (clone) 1280 <--> NRF24L01, hopefully I checked these ok:
51: MOSI
GND: GND
52: SCK
50: MISO
48: CE
49: CSN
3V: VCC
GND: GND
Pin6 is connected to 433Mhz transmitter
Pin5 is connected to 433Mhz receiver (not used but just connected)
Pin22 has thermometers (2pcs)
w5100 network board is normally attached to default pins of 1280, not yet any other problems than this is slow...

Some parts of my currently ugly code:
#include <ERxPachube.h>
#include <SPI.h>
#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
#include <Udp.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <NexaTransmitter.h>
#include <RF24Network.h>
#include <RF24.h>

--- clip -- ... and so on
byte mac[] = { 0xE8, 0xB3, 0x3A, 0x30, 0x41, 0x65};
IPAddress ip(192,168,1,13);
IPAddress device(192, 168, 1, 13); // Only if useDhcp is false
IPAddress gateway(192, 168, 1, 1); // Only if useDhcp is false
IPAddress subnet(255, 255, 1, 0); // Only if useDhcp is false
IPAddress dnsIP(192, 168, 1, 1); // Only if useDhcp is false
int ONE_WIRE_BUS = 22 ;
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress thermometer;

//radio:
RF24 radio(48,49);
RF24Network network(radio);
const uint16_t this_node = 0;
const uint16_t other_node = 1;

struct payload_t
{
  unsigned long ms;
  unsigned long counter;
};

void setup(){
      
Ethernet.begin(mac, ip,dnsIP,gateway,subnet);
  pinMode(ledPin, OUTPUT);  
   dataout.addData(0);
   dataout.addData(1);
   dataout.addData(2);
pinMode(txPin, OUTPUT);
// clip enabling Nexa 433Mhz  ---
NexaTransmitter remote(6,  12345678); // Create the nexa remote on pin6 with remote id
// radio up:
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 90, /*node address*/ this_node);
// end setup
//After that there is void loop(), having things like:
  network.update();
  while ( network.available() )
  {
    // If so, grab it and print it out
    RF24NetworkHeader header;
    payload_t payload;
    network.read(header,&payload,sizeof(payload));
    Serial.print("Received packet #");
    Serial.print(payload.counter);
//and so on
}

Here screenshot how test version is currently working, I go to web page, then it at least somehow shows current temperature 25,12'C from sensor connected directy to Mega1280 but also 22'C received from 2.4Ghz sensor. It's sending those values to Cosm and 433Mhz switches are controlled by http GET commands

« Last Edit: February 03, 2013, 11:08:12 am by finnduino » Logged

Kuala Lumpur, Malaysia
Offline Offline
Full Member
***
Karma: 4
Posts: 195
Anything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to maniac bug libraries, I managed to get both Arduino UNO & Raspberry Pi connected using the nRF24L01+

http://arduino-for-beginners.blogspot.com/2013/02/setup-nordic-nrf24l01-rf-modules-to.html

Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Stanley

I see in your link the nrf24 lashup on a breadboard. Do you have any trouble with the power supply there. This is in light of discussion at.

http://arduino.cc/forum/index.php/topic,149551.0.html

I see a couple of electrolytics on the breadboard but they don't seem to be related to the nrf24.

I am expecting some nrf24s soon and am currently planning a new proto shield.

« Last Edit: February 19, 2013, 09:11:30 pm by Nick_Pyner » Logged

Kuala Lumpur, Malaysia
Offline Offline
Full Member
***
Karma: 4
Posts: 195
Anything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I see in your link the nrf24 lashup on a breadboard. Do you have any trouble with the power supply there. This is in light of discussion at.

No issues at all for all Inhaos modules, the regular nRF24L01+ modules or even the ones with PA+LNA and Ext 2dBi antenna...

Are you expecting issues or facing such power issues ??
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you expecting issues or facing such power issues ??

In the light of your comment, no.  I believe these things should be addressed by the board manufacturer in accordance with the recommendations of the chip manufacturer and should not be something for the end user to get too paranoid about. 

However there have been some issues and bypass caps have been seen as solution. See the abovementioned link. As to it being the routine solution, who would know?

For all that, I have reserved space on my proto for a tantalum right next to the power pins, so I have no qualms about installing it. I have not yet received my transceivers and I'm just trying to have all the ducks lined up as I have to have everything up and running by the end of May.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maniacbug, great job on the library, really looks complete, only im having problems getting it to work with a pair of nrf24l01+ modules. I am pretty sure they are wired correctly. Can't seem to get any of the rf24 examples to work. Here is the radio.printDetails from both modules with the getting started code in it.

*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
ROLE: Ping out
STATUS           = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xf0f0f0f0e1 0xf0f0f0f0d2
RX_ADDR_P2-5     = 0xc3 0xc4 0xc5 0xc6
TX_ADDR          = 0xf0f0f0f0e1
RX_PW_P0-6       = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA            = 0x3f
EN_RXADDR        = 0x03
RF_CH            = 0x4c
RF_SETUP         = 0x27
CONFIG           = 0x0f
DYNPD/FEATURE    = 0x00 0x00
Data Rate        = 250KBPS
Model            = nRF24L01+
CRC Length       = 16 bits
PA Power         = PA_HIGH


*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK
ROLE: Pong back
STATUS           = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xf0f0f0f0d2 0xf0f0f0f0e1
RX_ADDR_P2-5     = 0xc3 0xc4 0xc5 0xc6
TX_ADDR          = 0xf0f0f0f0d2
RX_PW_P0-6       = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA            = 0x3f
EN_RXADDR        = 0x03
RF_CH            = 0x4c
RF_SETUP         = 0x27
CONFIG           = 0x0f
DYNPD/FEATURE    = 0x00 0x00
Data Rate        = 250KBPS
Model            = nRF24L01+
CRC Length       = 16 bits
PA Power         = PA_HIGH

on the ping out module is get:
Now sending 26533...failed.
Failed, response timed out.

in the serial terminal, and nothing in the pong back. I am using the Leonardo arduino modules and Arduino ver 1.52 software. All the signals look ok on a scope. the only signal that looks a bit strange is the 3.3vdc, which has a .2vpp ripple on it, really don't think this is the problem though. any feedback is greatly appreciated.
« Last Edit: February 24, 2013, 05:20:27 pm by egghead » Logged

Pages: 1 ... 6 7 [8] 9 10 ... 17   Go Up
Jump to: