# Scan Channels

**URL:** <https://forums.digi.com/t/scan-channels/735>\
**Category:** XBee - Zigbee\
**Created:** [July 28, 2011, 10:27am UTC](https://forums.digi.com/t/scan-channels/735 "2011-07-28T10:27:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shedo](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@shedo](https://forums.digi.com/u/shedo)\
**Post date:** [July 28, 2011, 10:27am UTC](https://forums.digi.com/t/scan-channels/735/1 "2011-07-28T10:27:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [July 28, 2011, 12:58pm UTC](https://forums.digi.com/t/scan-channels/735/2 "2011-07-28T12:58:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shedo](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@shedo](https://forums.digi.com/u/shedo)\
**Post date:** [July 28, 2011, 1:02pm UTC](https://forums.digi.com/t/scan-channels/735/3 "2011-07-28T13:02:41Z")

</div>

> 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…

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [July 28, 2011, 1:23pm UTC](https://forums.digi.com/t/scan-channels/735/4 "2011-07-28T13:23:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shedo](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@shedo](https://forums.digi.com/u/shedo)\
**Post date:** [July 28, 2011, 1:35pm UTC](https://forums.digi.com/t/scan-channels/735/5 "2011-07-28T13:35:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [July 28, 2011, 1:54pm UTC](https://forums.digi.com/t/scan-channels/735/6 "2011-07-28T13:54:28Z")

</div>

You are thinking too hard 🙂 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

---

<div class="post-metadata">

**Author:** ![shedo](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@shedo](https://forums.digi.com/u/shedo)\
**Post date:** [July 28, 2011, 2:14pm UTC](https://forums.digi.com/t/scan-channels/735/7 "2011-07-28T14:14:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [July 28, 2011, 2:35pm UTC](https://forums.digi.com/t/scan-channels/735/8 "2011-07-28T14:35:41Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![shedo](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@shedo](https://forums.digi.com/u/shedo)\
**Post date:** [July 28, 2011, 4:19pm UTC](https://forums.digi.com/t/scan-channels/735/9 "2011-07-28T16:19:04Z")

</div>

Thanks alot for all… You helped me alot!!! 🙂

---

<div class="post-metadata">

**Author:** ![Diegui12](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@Diegui12](https://forums.digi.com/u/Diegui12)\
**Post date:** [March 4, 2015, 12:20am UTC](https://forums.digi.com/t/scan-channels/735/10 "2015-03-04T00:20:41Z")

</div>

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/#](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
