Questions about: RF24Network and nRF24L01+

Hi to all!

I'm trying to create an arduino Network based on the library RF24Network developed by maniacbug and descrived here: RF24Network for Wireless Sensor Networking | maniacbug

I'm starting using the 'meshping.pde' example: http://maniacbug.github.com/RF24Network/meshping_8pde-example.html

Until here I was able to do the following:

  • introduce a DHT11 sensor
  • send a string containing temperatures instead of integer values

Ok, it's not much but for me as beginner is enough.

Now I've some questions:

  1. Using nRF24L01+ without external antenna I've gained a little bit the range setting the setDataRate in RF24 class to RF24_250KBPS. Seems to work even if the print details of the RF24Network shows me 1Mbits speed. But the print details of the RF24 shows correctly 250. (bug?). BTW I't possible to attach an external antenna on a nRF24L01+. I dunno how, soldering? My model is something like that:

    and I've seen there are models with external antenna like that

  2. The meshping example is created to send messages from leafes to the '00' node. It's only up to the code contained in the 'void loop(void)' function if I would like to send messages from central node '00' up to the leafes or the library doesn's allow this? My prupose is to have a '00' that collects informations like temperature or whatever, but the same time that could contact the leafes to send messages that should in example trigger a relay connected to a leaf. It's possible?

  3. The sketch starts with a system that writes the arduino nodes into flash. How could I change the node in case of mistrakes?

  4. Last important point: The base station '00' should have nRF24L01+ to communicate with all the leafes, but has an ethernet shield (arduino 2009 + standard ethernet shield) that allows me to contact it from the IP network. I'ts possible to install both on the arduino 2009? Do I need particolar changes? Seems the RF24 library uses some pins used by the ethernet. How to handle this?

For now I've asked enough... for now :slight_smile:

Thank's a lot for the help!!!

Simon

Hello,

Sorry foro the late but I'm really busy these few days.

Question 1

No you can not solder an external antenna, because external antenna need an amplificator chip. But so from you can buy a similare product I use from sparkfun :

SparkFun Transceiver Breakout - nRF24L01+ (RP-SMA) - WRL-00705 - SparkFun Electronics with this antenna 2.4GHz Duck Antenna RP-SMA - WRL-00145 - SparkFun Electronics.

It works very well.

The NRF24 you show me (the one with antenna), is quite good but you need to provide an external 3.3V to power it.
The one from sparkfun get an regulator that allow you to power it until 7V. Up to you to decide which one is the best for your application.

Question 2:

Yes the node '00' can talk to the other without trouble.Try to look at the samples provided by maniacbug to understand how it works. If you don't succed, let me a message I will try to send you an exemple.

you can look at the doc for this feature :

RF24NetworkHeader header(recipient_address,'t');
  network.write(header,&message,sizeof(message));

This is a way to send a message from the root to one leaf in my opinion. For that create an header, then write to the network, the message will be processed to the right leaf.

Question 3:

Where did you 'read' that the node number is written into the flash/eeprom ? If you tell me, I can then help you.

Edit : Ok I saw it. It's in the nodeconfig files. So from it's easy to modify an id of the node in this exemple.
You juste have to open 'Serial Monitor' on the Arduino IDE with your arduino powered by the usb.
Then you just enter a number between 0 and 9 and press to the Enter button on the right.
It should change the id of the node.

Question 4:

I don't know. SPI device (as ethernet and Nrf24) can work together but not at the same time, one is active when the other is not. But you can switch them fastly.

Ask to the forum for this feature... I own an ethernet shield but I ve got no time to do experiment.

The other way could be very easy :

Buy an arduino mini pro, do the job with NRF24 with it.
then link this arduino with Serial (tx, rx) to the one that get the ethernet shield.

I needs only to realize of small protocol between the both to job.

Best Regards.

If you need more help, don't hesitate to send me again questions. Also if you succeed in your project, let me a message.

Raph

Hi Raph!

Thank you for the answer and this time sorry for my delay! I haven't received notifications on replies, maybe forgotten to flag the option :slight_smile:

Question1:
I'll try these antennas if the range provided by mines is not enough. Meanwhile the mesh-network of the library seems very interesting. Yes, my antennas works with 3.3V. I'm using the 3.3V from the arduino itself. For now it works.

Question2:
I've tried to edit succesfully the code. Now I'm able to send and receive from node 0 without problems. Seems straight forward :slight_smile:

Question3:
If the address is set you cannot modify it attaching the serial port. You cannot in the original code... If I call the function 'nodeconfig_listen();' I can force to ask the insert of a new node, also solved.

Question4:
Following some examples I've wired the radio using pins 8+9 ( RF24 radio(8,9); ) and having separating the use of the radio and the network, seems to work:

  // Pump the network regularly
  network.update();

  // Is there anything ready for us?
  while ( network.available() )
  {

// here RF24 stuff

  }

    EthernetClient client = server.available();
    if (client) {
      Serial.println("new client");
      // an http request ends with a blank line
      boolean currentLineIsBlank = true;
      while (client.connected()) {
        if (client.available()) {


// here ethernet request stuff

        }
      }
    }

Meanwhile I was handling how to store values read form the leafes into an array. I've asked a little bit here: Arduino Forum and received nice answers that points me to right place, hope. Now I've to move forth and add a relay board!

I'll let you know soon if all it's working succesfully!

Thank's a lot for your answers!

Simon