开发者

How do you set the channel on a XBee PRO series 2?

I've got three XBees. 2x PROs and a standard, all series 2s. I've configured one PRO and one standard to be router/endpoints on channel 0 and PAN 234 (this is the default channel and PAN ID when selecting the "XBP24-B"/"XB24-B" "ZNET2.5 ROUTER/END DEVICE AT" profile (version 1247 for both).

However the one PRO I've set with the "ZNET 2.5 COORDINATOR AT" profile has a channel of E (though if I keep flashing the device with the same profile, this changes from 12-F).

Obviously if the coordinator doesn't have the same channel, nothing will work, but I can't see any way of setting the channel manually..?

The CH setting in X-CTU is read only, and I can see any other UI element to change the channel:

How do you set the channel on a XBee PRO series 2?

I've even been into the terminal and typed (words in brackets are what the terminal returns):

+++ (OK) ATCH (E) ATCH0 (ERROR) ATCH 0 (ERROR) ATCH00 (ERROR) ATCH 00 (ERROR) ATCH E (ERROR) ATCHE (ERROR)

I've Googled and Googled to no avail. incredibly frustrating, can anyone help?! I've had them working previous as a matter of fluke as I kept flashing the hardware until the channel num开发者_运维技巧bers match up, but this is obviously ridiculous!


Channel selection with the XBee ZB (S2, S2B, S2C) series of modules works differently than with the XBee 802.15.4 (S1) modules. Channel selection is automatic with ZB (as opposed to it being manual with the 802.15.4 modules).

You normally never need to manipulate the channel selection parameters with ZB. Modules find each other and associate with each other if they can.

If your modules just can't seem to find each other it usually comes down to a mismatch in the PAN settings (ID), security settings (LK), or network joining permission settings on the coordinator (NJ).

Not a lot of information exists on the web outside of the Digi's XBee ZB OEM manual. For reference sake, channel selection with ZB works like this:

  1. XBee ZB Coordinator is powered up
  2. The XBee ZB Coordinator reads its SC parameter and builds a list of candidate channels to scan
  3. The XBee ZB Coordinator then performs an energy scan on each candidate channel
  4. The XBee ZB Coordinator then chooses the channel with the least amount of energy on it

This procedure aims to pick a channel with the least amount of noise on it be it from microwave ovens, WiFi networks, or anything else that might be transmitting on the 2.4GHz frequency band.

Any router or end devices joining a network with consult their SC parameters first, then they will try and search for networks they can join which match their PAN and security parameters. They will join and stay joined to the first network they can--with some minor exceptions (see the JV and NW parameters, for example).

If you want to force a channel selection you must set the SC parameter to enable only a single channel. The SC parameter is a bitmask1. Each bit set in the mask will enable one additional channel. What's tricky about this parameter is that the first bit (bit 0) is not channel 0, it's channel 11 (0x0B). For ease of use, if you wanted to lock an XBee ZB to a single channel here would be the values:

+---------------+---------------+------------------+-------------------------+
| Channel (Dec) | Channel (Hex) | XBee ZB SC Value |    XBee Availability    |
+---------------+---------------+------------------+-------------------------+
|            11 | 0xB           | 0x1              | All                     |
|            12 | 0xC           | 0x2              | All                     |
|            13 | 0xD           | 0x4              | All                     |
|            14 | 0xE           | 0x8              | All                     |
|            15 | 0xF           | 0x10             | All                     |
|            16 | 0x10          | 0x20             | All                     |
|            17 | 0x11          | 0x40             | All                     |
|            18 | 0x12          | 0x80             | All                     |
|            19 | 0x13          | 0x100            | All                     |
|            20 | 0x14          | 0x200            | All                     |
|            21 | 0x15          | 0x400            | All                     |
|            22 | 0x16          | 0x800            | All                     |
|            23 | 0x17          | 0x1000           | All                     |
|            24 | 0x18          | 0x2000           | All                     |
|            25 | 0x19          | 0x4000           | S1, S2B, S2C (not S2)   |
|            26 | 0x1A          | 0x8000           | S1 only                 |
+---------------+---------------+------------------+-------------------------+


Obviously if the coordinator doesn't have the same channel, nothing will work, but I can't see any way of setting the channel manually..?

I'm not sure if what you say above is right. From http://ftp1.digi.com/support/documentation/90000976_C.pdf (you should look at the correct version for your hardware, though), it looks like the purpose of a coordinator is to automatically determine the channel:

Coordinator Operation

Forming a Network

The coordinator is responsible for selecting the channel, PAN ID (16-bit and 64-bit), security policy, and stack profile for a network. Since a coordinator is the only device type that can start a network, each ZigBee network must have one coordinator. After the coordinator has started a network, it can allow new devices to join the network. It can also route data packets and communicate with other devices on the network. To ensure the coordinator starts on a good channel and unused PAN ID, the coordinator performs a series of scans to discover any RF activity on different channels (energy scan) and to discover any nearby operating PANs (PAN scan). The process for selecting the channel and PAN ID are described in the following sections.

Channel Selection

When starting a network, the coordinator must select a "good" channel for the network to operate on. To do this, it performs an energy scan on multiple channels (frequencies) to detect energy levels on each channel. Channels with excessive energy levels are removed from its list of potential channels to start on.

I've actually never used the Digi XBee radios (just some of their other radios), so I don't know much about coordinators. I think that their user interface typically does expose all of the valid commands, so it probably won't work to try sending them manually (as you discovered).

You may find more experts on the Digi forums.


Hmm. strange, keep going over the settings again and finally got it working with 2-way comms?! :S

  1. Setup one a coordinator
  2. Setup other two as router/end devices
  3. Set the Device High (DH) to 0 and the Device Low (DL) to FFFF (this means everything sent from this module should be received by everyone)
  4. Set Negotiate Channel to 1 (Enabled), which means the only time a router/end device can set it's own channel is when it finds a coordinator on the same channel (this clearly wasn't happening in my case)

Everything else was left as default.

Leave coordinator powered on when configuring router/end devices so you can check they pair correctly.

As I said, I've used this configuration before and it just didn't work, so I don't know what kicked it into life this time, but it worked?!


One thing to take into account is that ZigBee channels extend from 11 to 26, zero is not a valid option.

Since that's the case, are you able to try the command ATCH11 ?

If that command succeeds, then perhaps the ATCH command wants a decimal input between 11 and 26?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜