NRF24L01 Project Guidance

Hi, I'm working on a project using the NRF24L01, there will be about 25 devices using the RF24Mesh library. Currently I have one master and three slaves setup for my basic testing which is working ok.

The slaves have sensors connected so data is being sent to the master, I prefer every second but two is ok. Also the slaves have settings that need to be adjusted at any given time which is done from the master. I've setup some basic code to test this and it seems to be working but 4 NRF's is a quite different than 25...

My question is what would be the best approach to bring this all together, I've tried 2 of the 3 and it's basically the same results?

  • Master requests data from all slaves using a For loop?
  • Slaves have loop to send data every second, master doesn't ask for it, just comes?
  • Master requests data from one slave, once data is received master repeats with the other slaves?

When changing a setting.

  • If the master is asking X device to change a setting should incoming data from same slave be paused until setting has been changed?
  • If the master is asking X device to change a setting should all comms with all slaves be paused until setting has been changed?

Or is there a different approach I should be taking?

Thanks

As there appear to be occasions when the master needs to take charge to change settings I reckon all the communications should be under control of the master.

You have not told us what distances are involved - especially between the master and the most distant slave? If the distances are not large then there may be no need to use the Mesh library with all of the overhead that that brings to the party.

...R

Distance isn't really a problem but I figured the Mesh library would make addressing easier.

I understand a NRF can only communicate with up to 6 others, after that the message needs to go through one of the six to get to the master?

It's possible the hard programmed connection device is removed which would bring the network down from that point, sounds like the Mesh library takes care of all that automatically?

My hope is any number of the 25 or so devices can be connected or removed without worrying about addresses or physical location.

Using Mesh it feels like I just assign each device a nodeID and it takes care of the rest up to 255 devices?

robsworld78:
I understand a NRF can only communicate with up to 6 others,

That is not true. There is no limit to number of devices that can be communicated with.

There are 6 pipes which are places for storing received messages according to the addresses they have been sent to - and using that system you would be limited to 6 incoming addresses. However if your master receives all the incoming messages on a single address and if within the message there is an ID to identify the sender you can receive from a large number of senders.

However if your master is put in charge using the ackPayload system (in the style of the second example in my Tutorial) you don’t need to worry about incoming addresses. You just need an address for each slave the master needs to contact.

…R

Interesting, that might be the easiest way to start as I expect all slaves to be in range of the master, at least for now... However I really like the idea of having a repeater system so slaves could be placed all over the house and not worry about being in range of the master.

If all slaves had the same address how would I send a message to a specific slave to update a setting? Would all slaves read the message and discard if ID in message doesn't belong?

Where can I find your tutorial?

Thanks

robsworld78:
If all slaves had the same address

Normally each slave would have a unique address so the master can talk to them individually.

If they all had the same address you would have to disable acknowledgements which greatly reduces reliability.

When I mentioned single address in Reply #3 I was referring to the master - the address to which the slaves would send a message. But that is not relevant if you use the ackPayload system.

...R

Is there any trouble running certain slaves to be like repeaters for slaves being more faar away from the real master?

Railroader:
Is there any trouble running certain slaves to be like repeaters for slaves being more faar away from the real master?

That's what the Network and Mesh extensions to the RF24 library do. However there is a substantial overhead involved which will significantly reduce the maximum throughput.

...R

@Robin2
Thanks! So there are no technical obstacles. Depending on the task for such a slave the call for higher level libraries is obvious.

Robin2:
But that is not relevant if you use the ackPayload system.

Definitely using that as I'm changing settings on slaves, slave to master doesn't matter but yeah.