0

I am studying NRF24L01+ module. I see, that only 6 receivers can be connected with the transmitter, via their unique pipes. What I can’t get is why the pipe id (address) has 5 long bytes.

As to me,1 byte would be much more than enough. What is the purpose in 5-byte address in 5 bidirectional communications?

  • I see, that only 6 receivers can be connected with the transmitter source link? – Maximilian Gerhardt Nov 23 '19 at 20:32
  • 1
    @MaximilianGerhardt, In every worthy tutorial I found. In docs also: tmrh20.github.io/RF24/… – zhekaus Nov 23 '19 at 20:38
  • what would you do if you had a 100 clusters of 6 receivers each near each other? – jsotola Nov 23 '19 at 20:46
  • The datasheet (sparkfun.com/datasheets/Components/SMD/…) page 54 shows 6 pipes, and each pipe holds a 5 byte (max) address; (actually, RX addresses 2-6 only modify the last 8 bit of the pipe1)). So you can have 6 communication partners and each one is identified by a 40-bit address, so 2^40 possibilities. It comes down to address space (for addresses) and hardware limitations (number of pipes). If the address space was too small, you would have address collisions (two or more modules have the same address), which is bad. – Maximilian Gerhardt Nov 23 '19 at 20:49
  • @jsotola that question disturbs me too. how should I generate these pipe ids. – zhekaus Nov 23 '19 at 20:49
1

5 bytes = more than 1 million million unique addresses, although not all addresses (as the nRF24L01 datasheet points out) are advised, for instance because they mimic the nRF's preamble packet.

So what is the purpose of addresses?
The purpose is to ensure that radio transmissions are received at the intended radio module. Consider a radio network where you have 1 transmitter (TX) and 3 receivers (RXs) within range of one another, all using the same radio frequency (channel). Now all receivers will detect a message sent by the transmitter, but only act upon it, such as raising an interrupt flag, it if the TX and RX addresses match. To avoid chaotic communication, failed packets or on-air collisions you need each receiver to have a unique address. Consider these like a postal address. You should have an intuition of what would happen to your mail if both you and your neighbor had the exact same address. Since the 2.4 GHz band can be extremely busy in public places with WiFi and Bluetooth traffic (which as an aside, Bluetooth is based on the nRF protocol), having 40 address bits seems quite sensible, as the probability of matching addresses by chance is almost zero.

So what are pipes?
If you read the nRF datasheet, you will see that in TX mode the radio can only send on using one address. In RX mode, the radio will listen for messages on up to 6 different addresses. Why 6? This is likely arbitrary - a balance between register memory allocation, most probable number of nRF modules being used simultaneously and the likelihood of more efficient network topologies (such as star/tree networks) that do not require huge numbers of pipes. A pipe represents one of these 6 addresses that a radio can receive the message and send and an ACK packet if requested. That's all.

I hope this answer clears any confusion you had between nRF addresses and pipes.

| improve this answer | |
0

I see, that only 6 receivers can be connected with the transmitter,

That depends on how you define "connected". It is only possible for one transmitter to, at any one time, send data to up to 6 other devices (one per pipe). However, that is something that is very rarely done.

In practice no more than 2 pipes are needed for you to communicate with thousands of devices.

In general:

  • Pipe 0 is the pipe you send data on
  • Pipe 1 is the pipe you listen for incoming data on

You should always send on pipe 0 because that is the pipe that any ACK messages will be received on (set pipe 0's address to the address you are sending to).

With pipe 1 set to the receive address you are always ready to receive data from elsewhere.

The transmitter doesn't need to know about every other device - only the one device it is sending data to at any one moment in time.

You can set up multiple addresses on other pipes if you want to receive data that is being sent to different addresses, though there's not many circumstances where you'd want to do that (such as if you want to communicate with different pipe widths to different groups of nodes, effectively bridging between two separate networks).

In summary:

  • Pipe 0's address changes all the time depending on who you are sending to (assuming you are using Auto ACK)
  • Pipe 1's address is static and is your address that you will receive on.

To illustrate it more:

  • Node A has address "NODEA".
  • Node B has address "NODEB".
  • Node C has address "NODEC".

  • Node A has pipe 1 address set to "NODEA".
  • Node B has pipe 1 address set to "NODEB".
  • Node C has pipe 1 address set to "NODEC".

  • Node A sets pipe 0 address to "NODEC"
  • Node A sends a packet through pipe 0
  • Node C receives the packet on pipe 1 since it's addressed to "NODEC"
  • Node C responds with an ACK to its own address ("NODEC")
  • Node A receives the ACK on pipe 0 since it's address is "NODEC".

  • Node A sets pipe 0 address to "NODEB"
  • Node A sends a packet through pipe 0
  • Node B receives the packet on pipe 1 since it's addressed to "NODEB"
  • Node B responds with an ACK to its own address ("NODEB")
  • Node A receives the ACK on pipe 0 since it's address is "NODEB".

| improve this answer | |
  • what is the difference between pipes and addresses then? – zhekaus Nov 23 '19 at 21:29
  • A pipe is what you communicate through. An address is where you communicate from or to. – Majenko Nov 23 '19 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.