This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Rf24 fully connected network

Hi .thank u for reading this .First sorry for my english. This is the story:

I try to make a flexible mesh using multi nrf24l01+ more than 10 nodes. I searched so many topic about this but i didn't find good solutions for my purpose. All topics explain how to make tree topology network with rf24 and this topology need static nrf24 station to behave like  bridger for data packets in this model of network . When one of these stations disconnected connection will fail for that nodes under that disconnected station.

So I wrote some codes to make some fully connected network with rf24 that every rf24 node can connect and communicate to another direcly without any bridger (note: all of rf24s exist in a circle with 15 meters radius so every rf24 can listen to others directly and there is no range problem). I used two ways . In both ways I set rf24 to go rxMode and when I want send data rf24 swith to txMode for some milliseconds and then return to rxMode to listening for another rf24s, also I configured all rf24 moduls with same frequency(channels) , baudrate , crc , baudrate and turning esb on

1-

- using same address on rx and tx on all rf24s

-enabling dynamic ack

-for all send operation using NO_ACK command 

Every rf24 can hear another but rf24s don't response to transmitter with automatic ack(cause for no ack command) and the receiver mcu analyse data packet that contains something like ip and if ip is matched it will send acknowledgement(produced by mcu not rf24)manually in a normal packet with no-Ack packet to transmitter .transmitter will wait to receive acknowledgement data packet that produced from receiver'mcu . If menual acknowledgment packet receives transmitter sure for safe communication else it will try to send packet again. It is very similar to Enhanced Shock Burst but it handled by MCU not nrf24 core.

(Be advice Every packet will send with no-ack command )

This network is good but have some problems like these:

-there is heavy duty for MCU and pressure will apply on main microcontroller 

-when more than 5 nodes communicate with each other some bugs will happen and devices will fail or apply wrong date packet (I can't find where is bugs yet :/   )

-network speed is low (cause for spi speed , clock of mcu , processing data packet)

So i try to use to another way:

2-

Every rf24 has different physical mac address on Rx address 1 

And when transmmiter want to send data it will switch both tx address and rx0 address to receiver's mac address number 1 and try to send data with normal ack mode automatically handled with Enhanced Shock Burst in Rf24. I guess this is simple in theory and have to work perfectly. I use this solution for 3 nodes it works perfect . Communication is safe , high speed and easy to use. But for more 3 nodes it has lot of problems. Some times multi nodes will send ack to transmitter and apply data packet .some times no one answer to transmitter. I check code so many times and it doesn't have any problem,only think i guess is we cant change tx and rx0 address so many times and it must be const value . Is this true? Anyone can help me? Waiting for your answer or suggestions...

  • -when more than 5 nodes communicate with each other some bugs will happen and devices will fail or apply wrong date packet (I can't find where is bugs yet :/   )

    Try to use max CRC length (16-bit), also I suggest that when forwarding a packet, use a random delay of 0-3ms before transmit, this should reduce the risk of several receivers are trying to forward the same packet at the exact same time.

    Some times multi nodes will send ack to transmitter and apply data packet .some times no one answer to transmitter.

    Make sure that you check that handle both RX_DR, TX_DS and MAX_RT interrupt on all devices, and that both RX and TX pipes are empty. You may also look into increase retransmit delay if you are using long ACK payloads. Is there any difference if you add a dummy random value to the payloads.

Related