I was wondering if it's possible to have a bunch of nRF24 sensor nodes that all talk to a central gateway that collects info. For example, a single gateway can read from 4 sensor nodes (let's say they're reading temperature or something). I'm curious if it's possible to, say, grab any 4 sensor nodes from a pile of 100 nodes (theoretical case in which they're manufactured) and somehow pair them up with any gateway.
Looking at it from the surface the "easiest" way of doing this would be to set every single sensor node to the same channel (or "pipe" as they call it) and just transmit data with maybe a unique ID prefix followed by the sensor data. The gateway would always be looking at that hard-coded channel/pipe and the you could have a button on each sensor node that when pushed, manually broadcasts data to that channel and the gateway can pick it up and store that device ID (as a side note, do nRF24 modules have hard-coded unique ID's that can be read?). Presumably this would solve the problem where 2 gateways are near each other because each gateway would only grab data from their respective sensor nodes.
However, there are some questions I have:
Is it possible to secure the data transmission? If all sensor nodes talk to gateways on the same channel, could someone intercept the data (not a huge deal but just wondering)?
Is there better RF hardware or methods for doing something like this? For example, each sensor node can be analogous to a wireless mouse with a dongle, and to connect them to a gateway you simply plug each dongle into the gateway? In this case the gateway may not be a full computer like Raspberry Pi and it would be great if we could do without this sort of thing, but maybe this could make setup easier? But then how would the dongles be made with quantity in mind?
I'd also need to worry about the process of de-registering a node from the gateway and/or adding new ones preferably without a screen or display.
I've just started playing with the nRF24's myself. What about having a default channel/pipe for new nodes, and a different channel/pipe for established nodes. When a new node is powered on, it makes communication with the gateway, or maybe the gateway is always checking for new nodes, possibly every couple seconds, or you have a button on the gateway that you press so it goes into that mode (much like a wireless wifi router). Anyways the node makes communication with the gateway and the gateway assigns the node an address, and gets moved into the established nodes list.
To un-register a node, maybe a button on each node that when held down for line 3-5 seconds, tells the master that it wants to be removed from the established nodes list.
In nRF24-speak a channel is a wireless frequency. For any two nRF24s to communicate they must both use the same channel. It is perfectly possible to change channels under software control but there is a great risk that communication is completely lost.
And pipe means a place where an incoming message can be placed according to the address of the message.
Think of the pipes as a bunch of post-boxes in an apartment building. Each post box has the the apartment number and when a letter is popped through the letter box someone looks at it, checks the apartment number and puts it into to post-box for that apartment. When the occupier comes home s/he checks his/her post-box and collects the letter. The nRF24 address fulfils the same role as the apartment number.
Consequently any nRF24 sending a message must use the same channel as the listener and must use an address that is recognized by the listener.
You could pre-program your 100 nRF24s to send to a specific common address.
Your Master nRF24 could be programmed to put messages for that address into a particular Pipe so that the Arduino would know that such a message came from a "new" slave. It could then send a message to the slave containing a different address that the slave would store in its Arduino EEPROM memory and use for all future communications. The Master would put messages on that address into a different pipe so that the Arduino would know that they came from a "known" slave.
Whether all that is worth the trouble is another matter. It seems to me you would get much the same or better functionality a lot easier by simply including an ID byte in the message from the slave. Initially the byte might be 0 and then the Master could send a different value (again to be stored in the EEPROMmemory) and that stored value would be used in future. This has the advantage that the Master could issue any of 254 different values to identify each slave.
The main advantage of changing the address would be to prevent someone who knows the default address from using the system. However if the system automatically issues the "special" address there seems nothing to prevent the hacker from accessing the system.