is it possible to use the RSSI value of the NRF51822 for collision avoidance?
How long does an RSSI measurement take?
I'm trying to implement a discovery protocol based on ESB or Gazell:
My idea at the moment for collision avoidance:
Before sending, the transmitter should wait a random time, then checking RSSI, and if free, starts to transmit. This process should be repeated N times, to be sure Node A get the response of all nodes.
Because the nodes are unknown and anonymous, i don't know the addresses (and can't set them for example in gazell to use different rf frequencies).
One difficulty to implement CSMA/CA on radio is that we don't know if there is a collision when we are transmitting.
The idea here is just simply use random delay for device B, C, D. We won't be guaranteed that A get response from all nodes. If you want you can implement a protocol that after A receive the response, it can send an ACK telling which device it already get the ping.
You should use a common RF address for all packets. But add ID of each device in the payload of the packet.
Also you should consider transmitting in different RF channels not just one, since relying on a single channel is risky. Each device should transmit several packets on each channel.
Thanks. A random wait is also easy to implement and should be sufficient for my needs.
But why one common rf address for all nodes? I planed that each device should get a unique address and a specific known broadcast address. Or are there any issues with ESB/Gazell?
The problem is that your device A doesn't know which address it should listen to if B, C, D gonna transmit with unique addresses. You need a common address that A can listen to. This is the same way how BLE advertising works. There is only one common address (0x8E89BED6) for all advertising packet, connection request packet, etc.
Ah, i didn't know that. So it is not possible to just receive all ESB/Gazell packets on air? Is this limited by the ESB/Gazell or the radio-hardware? Thank you for helping me.
Simply listen to all signals on a RF channel will just bring you heaps of noise. The radio need to have an address that it would look for . I guess you can find equipment with capability of sniffing all packets over a (or multiple) channel, but it's not possible with our chip.