scan channel using digimesh

I’m using waspmote nodes +Xbee pro s1 configured as digimesh. I need to scan a channel before sending a packet.
While these functions exists already in 802.15.4 so I did add same functions in the API. I make a small code in waspmote IDE to check if there is any problem using my new functions. it compile correctly. I don’t have any errors. I change the CCA value in digimesh module with 2C.
The problem is that I get 0 for all scanned channel.
I can’t find where the problem is.
Help please.

Try lowing the CCA threshold value. Having it to high can result in no channels.

1/What do you suggest as new CCA value
2/ this is my code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uint8_t PANID[2]={0x12,0x34};

void setup()
{
// Inits the XBee DigiMesh library
xbeeDM.init(DIGIMESH,FREQ2_4G,NORMAL);

// Powers XBee
xbeeDM.ON();
xbeeDM.setChannel(0x0D);
if( !xbeeDM.error_AT ) XBee.println(“Channel set OK”);
else XBee.println(“Error while changing channel”);

// Chosing a PANID : PANID=0x1234
xbeeDM.setPAN(PANID);
if( !xbeeDM.error_AT ) XBee.println(“PANID set OK”);
else XBee.println(“Error while changing PANID”);

// choosing a node identifier
xbeeDM.setNodeIdentifier(“node01”);

}

void loop()
{

// set the list of channels to scan as a Bitmap.
// 0xFFFF scan all possible channels
xbeeDM.setScanningChannels(0xFF,0xFF);

// get the maximal energy on each scanned channel
// The actual scan time on each channel is measured as
// Time = [3000 + (2 ^ input) x 16 x 100] ms
// Range: from 0 to 6
xbeeDM.setDurationEnergyChannels(6);
// print information
printEnergyChannel();
}
/*

  • printEnergyChannel
  • This function prints all stored energy
  • for each channel in units of dBm
    */
    void printEnergyChannel()
    {
    USB.print(F("

----------------------“));
USB.print(F(”
Energy Scan (dBm)“));
USB.print(F(”
----------------------"));

USB.print(F("
channel 0x0C: "));
USB.print(xbeeDM.energyChannel[0]*(-1),DEC);

USB.print(F("
channel 0x0D: "));
USB.print(xbeeDM.energyChannel[1]*(-1),DEC);

USB.print(F("
channel 0x0E: "));
USB.print(xbeeDM.energyChannel[2]*(-1),DEC);

USB.print(F("
channel 0x0F: "));
USB.print(xbeeDM.energyChannel[3]*(-1),DEC);

USB.print(F("
channel 0x10: "));
USB.print(xbeeDM.energyChannel[4]*(-1),DEC);

USB.print(F("
channel 0x11: "));
USB.print(xbeeDM.energyChannel[5]*(-1),DEC);

USB.print(F("
channel 0x12: "));
USB.print(xbeeDM.energyChannel[6]*(-1),DEC);

USB.print(F("
channel 0x13: "));
USB.print(xbeeDM.energyChannel[7]*(-1),DEC);

USB.print(F("
channel 0x14: "));
USB.print(xbeeDM.energyChannel[8]*(-1),DEC);

USB.print(F("
channel 0x15: "));
USB.print(xbeeDM.energyChannel[9]*(-1),DEC);

USB.print(F("
channel 0x16: "));
USB.print(xbeeDM.energyChannel[10]*(-1),DEC);

USB.print(F("
channel 0x17: "));
USB.print(xbeeDM.energyChannel[11]*(-1),DEC);

}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
it does not depend on CCA value.
I can’t find where could be the problem