Radio channels
Last updated
Last updated
The XBee 3 802.15.4 module works on the 2.4 GHz band, and there are 12 channels available. The values are between 0x0C-0x17 (12 values).
Due to the frequency band used is a free band, a channel may be jammed by other network transmissions. To avoid that jamming, it is recommended to scan all the channels to choose the channel with less energy.
List of channels to scan for all Active and Energy Scans as a bitfield:
bit 0: 0x0B bit 4: 0x0F bit 8: 0x13 bit 12: 0x17
bit 1: 0x0C bit 5: 0x10 bit 9: 0x14 bit 13: 0x18
bit 2: 0x0D bit 6: 0x11 bit 10: 0x15 bit 14: 0x19
bit 3: 0x0E bit 7: 0x12 bit 11: 0x16 bit 15: 0x1A
Setting this parameter to 0xFFFF will cause all the channels to be scanned.
The API functions store the list in a related array called scanChannels
.
Example of use:
Related variables:
The maximum energy on each channel is returned, starting with the first channel selected in the Scan Channels parameter. The amount of time this energy scan is performed is specified as an API function input. This time is calculated in this way (2\^ED)*15.36 ms.
The recommended process for choosing a free channel is:
1. Change the list of channels to scan all the channels.
2. Perform an energy scan channel on those channels.
3. A channel is chosen among the scanned channels, selecting the channel with minimum energy.
Example of use:
Related variables:
Energy scan example: https://development.libelium.com/802-07-energy-scan/
The amount of time specified to scan each channel may affect the detected energy. In our tests, selecting the minimum value was not sufficient to detect the energy, so it is recommended to select a higher value.
After testing, a usual energy value for a free channel is around -84 dBm and -37 dBm for an occupied one. When the energy scan is performed, these values may be used to determine whether a channel is occupied or not.
This protocol provides some parameters to diagnose the current state of the network. 802.15.4 uses CSMA-CA to avoid various nodes start transmitting at the same time. The process is described next:
1. A random delay is waited for. This time is specified by a back-off algorithm.
2. Performs a Clear Channel Assessment.
3. If the detected energy is above the CCA threshold, steps 1-3 will be repeated up to 4 times. If the detected energy is under the CCA threshold, the packet is transmitted.
4. Broadcast transmissions has already finished because ACKs are not sent. Unicast transmissions wait for ACK. If ACK is not received, steps 1-4 will be repeated up to 3 times.
It specifies the minimum value at which the back-off algorithm starts. First time this algorithm is executed, it waits a random delay: (2\^BE-1)*0.32 ms. BE is the back-off algorithm exponent and it starts at the value 'Random Delay'. In the same attempting of sending a packet, the exponent is increased in one.
Example of use:
Related variables:
Clear Channel Assessment Threshold. Prior to transmitting a packet, a CCA is performed to detect energy on the channel. If the detected energy is above the CCA Threshold, the module will not transmit the packet. By default, this value is -44 dBm. In our tests, an occupied channel with some nodes transmitting has around -37 dBm, so it is a tighten value.
Example of use:
Related variables:
Counter of Clear Channel Assessment in CSMA-CA process. It specifies the number of times a packet has been discarded due to the energy on the channel was above the CCA Threshold.
Example of use:
Related variables:
Counter of acknowledgment failures. It specifies the number of times a packet has been sent and its ACK has not been received.
Example of use:
Related variables:
Maximum number of retries the module will execute in addition to the 3 retries specified by 802.15.4 protocol. For each XBee retry, the 802.15.4 can execute up to 3 retries. If the transmitting module does not receive an ACK after 200 ms, it will re-send the packet up to 3 times. This is an upper-MAC level, so the CSMA-CA process explained before is executed each retry.
Example of use:
Related variables:
Using these parameters, a bad behaviour of a channel could be detected, and the process to choose a new channel should be executed.