Help with RF24Network and nRF24L01+

Hi to all!

I’m having again problems with RF24Network library :slight_smile:
I’m trying to create an arduino Network based on the library RF24Network developed by maniacbug and descrived here: http://maniacbug.wordpress.com/2012/03/30/rf24network/

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

I was able to setup the hardware correctly and so send and receive messages. I’ve then introduced a DHT11 sensor. My goal is to create a meshed network, but messages should not flow only from external leafes to node00, but also node00 should be able to send messages out to leafes, this to have interaction with external leafes, but doing so I noticed a strange behaviour.

Sending a char array sometimes the radioMessage received is overwritten by anothe rmessage. I cannot understood if it’s an issue on the program or the library doesn’t allow a Node00 to Nodexx comunication. This is the meshping example modified:

----->>>>>>> See attached file 'meshping_mod.txt'

The code should generate on every cycle a random char array formed by:
[node_number];0;1;[DHT11_humidity];[DHT11_temperature];0;0;0;10;50
OR
[node_number];0;1;[DHT11_humidity];[DHT11_temperature];0;0;0;0;4;
The last 5 values separated by commas are random added one or the other.

Now, loading this on two nodes, Address ‘0’ and address ‘5’ the output from the serial ports are follow:

Node0:

RF24Network/examples/meshping/
VERSION: Unknown
ADDRESS: 0
STATUS           = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xf0f0f0f03c 0xf0f0f0f05a
RX_ADDR_P2-5     = 0x69 0x96 0xa5 0xc3
TX_ADDR          = 0xf0f0f0a53c
RX_PW_P0-6       = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA            = 0x3f
EN_RXADDR        = 0x3f
RF_CH            = 0x64
RF_SETUP         = 0x07
CONFIG           = 0x0f
DYNPD/FEATURE    = 0x00 0x00
Data Rate        = 1MBPS
Model            = nRF24L01+
CRC Length       = 16 bits
PA Power         = PA_HIGH
||NO RADIO||
||NO RADIO||
[1095] >> APP Received '5;0;1;5500;2000;0;0;0;0;;50;' from 05   <--------
1096: APP Added 05 to list of active nodes.
||!! RADIO|
||NO RADIO||
||NO RADIO||
---------------------------------
2110: APP Sending active nodes to 05...
----------
[2614] >> APP Sending 0;0;1;5000;1900;0;0;0;0;4; to 05...
----------
2618: APP Send ok
||NO RADIO||
||NO RADIO||
||NO RADIO||
----------
[4145] >> APP Sending 0;0;1;5000;1900;0;0;0;10;50; to 00...
----------
4148: APP Send ok
[4152] >> APP Received '0;0;1;5000;1900;0;0;0;10;50;' from 00   <--------
||!! RADIO|
||NO RADIO||
||NO RADIO||
[5191] >> APP Received '5;0;1;5500;2000;0;0;0;0;4;' from 05   <--------
||!! RADIO|
||NO RADIO||
||NO RADIO||
---------------------------------
6199: APP Sending active nodes to 05...
----------
[6702] >> APP Sending 0;0;1;5000;1900;0;0;0;0;4; to 05...
----------
6707: APP Send ok
||NO RADIO||
[7232] >> APP Received '5;0;1;5500;2000;0;0;0;0;;50;' from 05   <--------
||!! RADIO|
||NO RADIO||
||NO RADIO||

Node5:

RF24Network/examples/meshping/
VERSION: Unknown
ADDRESS: 5
STATUS           = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xf0f0f0a53c 0xf0f0f0a55a
RX_ADDR_P2-5     = 0x69 0x96 0xa5 0xc3
TX_ADDR          = 0xf0f0f0f0c3
RX_PW_P0-6       = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA            = 0x3f
EN_RXADDR        = 0x3f
RF_CH            = 0x64
RF_SETUP         = 0x07
CONFIG           = 0x0f
DYNPD/FEATURE    = 0x00 0x00
Data Rate        = 1MBPS
Model            = nRF24L01+
CRC Length       = 16 bits
PA Power         = PA_HIGH
||NO RADIO||
||NO RADIO||
||NO RADIO||
||NO RADIO||
----------
[2096] >> APP Sending 5;0;1;4900;2400;0;0;0;0;4; to 00...
----------
2101: APP Send ok
||NO RADIO||
||NO RADIO||
||NO RADIO||
3628: APP Received nodes from 00
3628: APP Added 05 to list of active nodes.
||!! RADIO|
||NO RADIO||
----------
[4134] >> APP Sending 5;0;1;4900;2400;0;0;0;10;50; to 05...
----------
4139: APP Send ok
[4142] >> APP Received '0;0;1;4800;2100;0;0;0;0;;50;' from 00   <--------
4154: APP Added 00 to list of active nodes.
[4162] >> APP Received '5;0;1;4900;2400;0;0;0;10;50;' from 05   <--------
||!! RADIO|
||NO RADIO||
||NO RADIO||
||NO RADIO||
||NO RADIO||
----------
[6202] >> APP Sending 5;0;1;4900;2400;0;0;0;0;4; to 00...
----------
6207: APP Send ok
||NO RADIO||
||NO RADIO||
||NO RADIO||
7734: APP Received nodes from 00
||!! RADIO|
||NO RADIO||
----------
[8236] >> APP Sending 5;0;1;4900;2400;0;0;0;0;4; to 00...
----------
8240: APP Send ok
||NO RADIO||
||NO RADIO||
||NO RADIO||
||NO RADIO||
----------
[10267] >> APP Sending 5;0;1;4900;2400;0;0;0;10;50; to 05...

Well, you can notice often the radiomessage seems overwritten by the previous(?) message, in example:

[4142] >> APP Received ‘0;0;1;4800;2100;0;0;0;0;;50;’ from 00
[7232] >> APP Received ‘5;0;1;5500;2000;0;0;0;0;;50;’ from 05

Seems the double ‘;;’ are the radiomessage ‘5;0;1;4900;2400;0;0;0;10;50;’ overwritten by ‘5;0;1;4900;2400;0;0;0;0;4;’ resulting in:

‘0;0;1;4800;2100;0;0;0;0;;50;’

I’m not sure. The sent message, printing ‘radiomessage’ before sending it out, seems always correct, also I think the issue is on incoming traffic.

Could someone help me?

Thank’s a lot!

Simon

meshping_mod.txt (7.65 KB)

Hi Simon, did you ever get his working?

Jimster: Hi Simon, did you ever get his working?

Hello Jimster, I've solved all my issues. Well, it was not easy 'cause I'm a noob and haven't received much support and suggestions. This has forced me to RTFM (library and datasheet) in deep (what should be done almose always) and try-try-try-try. BTW now I've rewritten some parts of the code and solved.

If you need some help, let me know. I'll try my best to help you. Write here or PM me.

Bye, Simon

haven’t received much support and suggestions. This has forced me to RTFM

What a shame that you should have to be the one to RTFM. Surely, someone else should have read the f*ing manual for you.

PaulS: What a shame that you should have to be the one to RTFM. Surely, someone else should have read the f*ing manual for you.

Well, maybe I was misunderstood. I'm really noob with arduino and overall with electronic components... as well as writing in english :) I've read the overall documentation of RFNetwork on the Maniacbugs site, many times. There were many points not really understood by me. I've tried to read the datasheet too, but it's really difficult for me to deal with concepts I've never used before. C language is something new too, even if I've programmed with many different languages. (pointers, memory issues, aso.... uh!). I think Arduino is really a great project to let people like me, who hasn't experience, to join a new world. The forum let us place in contact and help together. That I've not received useful hints to solve my issues in this case is a fact. No bad at all, because there is nowhere written here I can find all answers on my Arduino doubts :) Most of the time I've found many people helping me, that's great. After some months I went back to Maniacbugs site (library author) and found someone commented about the radio size limit. I've then read another time the datasheet and understood something new that I was not able to understand before. Well, in this way I've token more time but I'm more proud to have found a solution by myself :) Elementary for most of you, not for me. Meaning someone else should read the manual for me and answer on my doubts was not my goal. If I ask something is 'cause I was not able to find exactly for an answer and is the reason why someone should ask on the forum.

Hope have clarified better my point of view and repeat my thanks to this great project and the whole community behind. Sorry if I've given another impression about that.

Simon

Hi Simon,

hope you can help, I'm very new to arduino, so sorry in advance for the stupid questions.

What I'm trying to do is have a central arduino with LCD display, which is taking readings of two analogue readings (local battery voltage and 5v input) from each of 4 remote arduino's. This is simple (ish) enough for me to just about manage. However I also want to be able to turn off the remote arduino's when they are not communicating with the central arduino.

My plan is to use a P-FET or latching relay to turn off the arduino's and I'd start them with soft power button.

I'm not sure which way is best to control the power on the remote arduino's, I thought of two options:

Option 1: Send a signal from the central arduino to keep the remotes on every 30 seconds, this would reset a counter on the remote arduino, if no on signal was received for 5 mins then the remote arduino would start shutdown process.

Option 2: (I'm not sure if this is even possible) Each remote arduino would send data to central, if it was unable to get a response from central arduino it would start shutdown process.

Each option would require some sort of bi-directional comms. Do you have any thoughts / opinions on the best way forward.

I'd be very very great full if you could help at all. RF comms is all very new to me.

Thanks

Jim

Hello!

First of all let me explain in 2 words what I’m trying to do:
Using the maniacbug library and starting from the meshping example I’m having a central node (00) on an arduino 2009 with ethernet shield that collect informations from (actually) two other nodes.
The node 00 can send out messages too. In this way, node00 can collect these informations and, if I send a message via ethernet (web-browser), node00 can forward the msg via radio. On one of them a relayboard gives me the ability to power on/off whatever is connected (actually nothing, eheh).
I’m planning to have the leafes always connected on 220V (->5v), but I’m looking as well to create my own nodes following the documentation to create low power nodes:

Low Power node description @maniacbug’s site:

Seems the life of those leafes should be great. The radio library has a sleep mode to place the module in standby.

But if you would like to power-down the arduino, having implemented a kind of bi-directional comunication, I could choose to send a message from node00 as well as power-down the radio if the leaf cannot reach the node00.

Option2 would be easier because when you send a message from the leaf to the node00 you have always a boolean return value if it was sent succesfully. Look at the meshping example:

    // Normal nodes send a 'T' ping
    if ( this_node > 00 || to == 00 )
      ok = send_T(to);
    
    // Base node sends the current active nodes out
    else
      ok = send_N(to);

    // Notify us of the result
    if (ok)
    {
      printf_P(PSTR("%lu: APP Send ok\n\r"),millis());
    }
    else
    {
      printf_P(PSTR("%lu: APP Send failed\n\r"),millis());

####
## YOU COULD INCREASE HERE A COUNTER. IF COUTER > MAX_FAIL, THEN SHUTDOWN.
####

      // Try sending at a different time next time
      last_time_sent -= 100;
    }

Hope it helps!

Simon

Thanks Simon, that's helped a lot

knowing what I'm trying to do, which example would you suggest I started to hack about to fit my needs?

meshping.pde from the RF24Network library. It's compliant on what you would like to create following option2.

Let me know :)

Simon

Hi Simon,
I have loadded your “sensornet_mod” but give me this message:

RF24Network/examples/meshping/
VERSION: Unknown
*** No valid address found. Send node address via serial of the form 011N
ERROR: This sketch cannot run on node 00

How do I configure to Node 00?
And I do to configure to Node 013?

Thank you!

AJoao