Hi,
I was testing co-existence of 15.4 networks and observed some unexpected behavior of sensor nodes. The following are the steps I took:
1) Start a network of two nodes, collector #1 and sensor #1, in non-beacon mode, with 2-GFSK 200kbps phy. Pan ID = 0x5678, channel mask = 0F00000000000000000000000000000000 (only first 4 channels are selected) and security key (key 1).
2) Start another collector (collector #2) in non-beacon mode with the same phy, the same channel mask: but a different PAN-ID = 0x1234 and a different security key (key2). At this point, collector can detect that the first channel is being used by another network, and successfully starts network on channel 2
3) Start another sensor (sensor #2) in non-beacon mode with the same phy, the same channel mask, and PAN-ID = 0x1234 and security key2. At this point, I would expect this sensor node to first attempt the first channel then try other channels in the mask after some time. But somehow this sensor node will just stuck in joining state forever.
4) If I remove the first channel from channel mask in sensor #2, then it can join collector #2 quickly.
5) If I turn of collector #1, then sensor #2 can also quickly join collector #2.
My question is, is there a way we can force sensor #2 to automatically switch to channel 2 if attempts to join network on channel #1 fails? There seems to be some sort of scanning when a sensor attempts join a network.
/*!
* @brief Send scan request
*
* @param type - type of scan: active, passive or orphan
*/
static void sendScanReq(ApiMac_scantype_t type)
{
ApiMac_mlmeScanReq_t scanReq;
/*Turn receiver ON for SCAN */
ApiMac_mlmeSetReqBool(ApiMac_attribute_RxOnWhenIdle, true);
/* set common parameters for all scans */
memset(&scanReq, 0, sizeof(ApiMac_mlmeScanReq_t));
/* set scan channels from channel mask*/
memcpy(scanReq.scanChannels, defaultChannelMask,
APIMAC_154G_CHANNEL_BITMAP_SIZ);
scanReq.scanType = type;
if(CONFIG_MAC_BEACON_ORDER == JDLLC_BEACON_ORDER_NON_BEACON)
{
scanReq.scanDuration = CONFIG_SCAN_DURATION;
}
else
{
scanReq.scanDuration = CONFIG_MAC_BEACON_ORDER;
}
scanReq.maxResults = 0;/* Expecting beacon notifications */
scanReq.permitJoining = false;
scanReq.linkQuality = CONFIG_LINKQUALITY;
scanReq.percentFilter = CONFIG_PERCENTFILTER;
scanReq.channelPage = CONFIG_CHANNEL_PAGE;
/* using no security for scan request command */
memset(&scanReq.sec, 0, sizeof(ApiMac_sec_t));
/* send scan Req */
ApiMac_mlmeScanReq(&scanReq);
}
Such scan seems mainly about energy with consideration of PAN-ID and security key. Can we somehow to use security key and pan id during the scan? That will greatly reduce likelihood of network collision.
Please advise, thanks.
ZL