Scan Channels

Hi all,
I’m new in the xbee world, and i have a question.
I want to set Scan Channels and i understand how but i can’t understand how write the value.

Example:

I read in the manual that:

if the operating
channel is 0x0B, set SC to
0x0001. If the operating channel
is 0x17, set SC to 0x1000.

but I can not understand how calculate the number from 0x17 to 0x1000

or calculate range that i want…

For example, setting SC to 0x281 enables
scanning on channels 0x0B, 0x12, and 0x14, in that order.

Can you help me?

Why do you want to set this? Are you trying to force use of a single channel? This risks picking a useless channel.

Normally, you leave the SC=0x1FFE in all devices and let the coordinator try to find a clear, usage channel. The other devices ‘scan’ through all enabled channels to find a coordinator.

Why do you want to set this? Are you trying to force use of a single channel? This risks picking a useless channel.

Normally, you leave the SC=0x1FFE in all devices and let the coordinator try to find a clear, usage channel. The other devices ‘scan’ through all enabled channels to find a coordinator.

thanks for the answer but i need to set the channel or the range channel…

Okay, understand that there are 2 weird things here.

First, Zigbee channels are numbered 11 to 26. Why? Are they planning to steal channels 0-10 from lower spectrum some day? heck if I know.

Second, these are often given as hex, as 0x0B to 0x1A. Digi docs sometimes are a bit cavaler and just talk about channel 0D without including the 0x.

So when you mention “17” - make sure you understand if you want 17 (so 0x11) or 23 (so 0x17)

Do a Google search of ‘Zigbee channels’ and you’ll find lots of nice graphs and details.

So >MY UNDERSTANDING< (which may be wrong) is that 0x281 would be channels 11, 18 and 20 (0x0B, 0x12 and 0x14). So the first channel (11 or 0xB) is 0x0001.

Ok, but i can’t understand the mechanism to translate the sequence of channel (11,18,20) to hex number 0x281 or sigle channel 0xB to 0x0001. For example if i want set the sequence 12,13,16 how can calculate the corrisponding number?

You are thinking too hard :slight_smile: Just write it down on paper (or Excel if you are fancy)

11 (0x0B) = 0x0001
12 (0x0C) = 0x0002
13 (0x0D) = 0x0004
14 (0x0E) = 0x0008
15 (0x0F) = 0x0010
16 (0x10) = 0x0020
17 (0x11) = 0x0040
18 (0x12) = 0x0080
19 (0x13) = 0x0100
20 (0x14) = 0x0200
21 (0x15) = 0x0400
22 (0x16) = 0x0800
23 (0x17) = 0x1000
24 (0x18) = 0x2000
25 (0x19) = 0x4000
26 (0x1A) = 0x8000

Thanks alot… :slight_smile: then if i want a set of channels should i sum the respective value?

Yes - technically you ‘OR’ them together, but adding/summing should work as well.

I created a wiki page for you: http://www.digi.com/wiki/developer/index.php/Channels%2C_Zigbee

So if you want the four channels which do not overlap the standard 3 WiFi bands, you’d want ZB channels 15, 16, 21, and 22. So you would set the coordinator’s scan_channel/SC to 0x0C30.

Generally, leave all other nodes with the default SC. They will waste a small amount of time during the original association, but it allows you to change your mind more easily in the future & only change one SC value.

Thanks alot for all… You helped me alot!!! :slight_smile:

Hello guys.

I’m trying to scan just one channel. II’m using waspmote v1.1 and xbee 802.15.4 S1.

I tried using the example http://www.libelium.com/development/waspmote/examples/802-07-energy-scan/#

But appears the following error:

C:\Users\Diegui\Desktop\Papeo\Ramos\Teoría de Información y Código\Software\waspmote-ide-v.01-windows\hardware\cores\wasp_v018/WaspXBeeCore.h:1621: error: ‘Sd2Card’ does not name a type

In function ‘void setup()’:
In function ‘void printEnergyChannel()’:
Bad error line: -4

What does this mean ? Please any help