We have designed a product with the CC3220SFMODA that awakes from hibernation, makes a connection to the AP, then sends a request to our Server. Before the device makes connection with the server it does a scan to see how many visible and hidden SSIDs are available. We know that we can't see the SSID of the hidden APs but for our application we just need to know if a hidden SSID is present at all.
If we set up a hidden AP and then do a scan the device will only see that the hidden AP exists 10% of the time or less. It is worth noting that we are able to connect to hidden APs even if they do not show up in the scan but we need them to show up in the scan for our application. Additionally, visible APs always show up successfully in the scan. Only hidden SSIDs are inconsistently scanned.
In this block of code you can see that the scan parameters are set and then a scan is performed immediately afterwards. This is pretty straightforward and follows closely the examples from TI's resource explorer.
_i16 Status = 0;
Display_printf(display, 0, 0, "Set Scan Parameters\r\n");
//Set Scan Parameters
SlWlanScanParamCommand_t ScanParamConfig;
ScanParamConfig.RssiThreshold = -100;
ScanParamConfig.ChannelsMask = 0x1FFF; /* channels 1-13 */
Status = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS,
sizeof(ScanParamConfig), (_u8* )& ScanParamConfig);
if( Status )
{
/* error */
}
//Set Scan policy
Display_printf(display, 0, 0, "Set Scan Policy\r\n");
_u32 intervalInSeconds = 20;
Status = sl_WlanPolicySet(SL_WLAN_POLICY_SCAN, SL_WLAN_SCAN_POLICY(1,1),
(_u8*)&intervalInSeconds,sizeof(intervalInSeconds));
if( Status )
{
/* error */
}
alertus_delay(1000);
Display_printf(display, 0, 0, "Get Network List\r\n");
SlWlanExtNetworkEntry_t netExtEntries[10] = {0};
_u8 i;
Display_printf(display, 0, 0, "Get Network attempt #1");
resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
//Try to get results again if first attemt fails
int getScanTries = 2;
while((resultsCount == SL_ERROR_WLAN_GET_NETWORK_LIST_EAGAIN) &&
(getScanTries < 5)){
Display_printf(display, 0, 0, "Get Network attempt # %d", getScanTries);
//Wait 1 second
alertus_delay(1000);
//Try again
resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
getScanTries++;
}
uint8_t closest_AP = 0;
//If scan was succesful
if(resultsCount > 0){
Display_printf(display, 0, 0, "APs found: %d\r\n", resultsCount);
Display_printf(display, 0, 0, "Print Network List\r\n");
//Cycle through AP and find lowest RSSI of save networks
int p = 0;
//Set RSSI to unreasonably low value
int rssiVal = -100;
valid_config = 0;
int hiddenAPfound = 0;
for(p = 0; p < resultsCount; p++){
//Capture RSSI here to prevent API overwrite during logic
int APrssi = netEntries[p].Rssi;
Display_printf(display, 0, 0, "AP # %d: %s\r\n", p, netEntries[p].Ssid);
Display_printf(display, 0, 0, "RSSI: %d\r\n", netEntries[p].Rssi);
//If hidden AP no need to check if it is the closest
if(netEntries[p].SsidLen < 4){
hiddenAPfound++;
continue;
}
Here is an example of our debug printout associated with the above code block. In this case it is when the device DOES see a hidden SSID. This happens in 10% or less of scans.
The device still returns RSSI and a blank SSID this is the behavior we desire
Here is an example of the hidden SSID NOT being found.
Can anyone offer assistance with resolving this issue? We'd like to know whether or not we are using the API appropriately or if there is some other issue unrelated to our application code.
Thank you
Rodney T
Tool Versions:
Simplelink Version: 4.40.0.07
Compiler Version: TI v20.2.7.LTS
XDCtools Version: 3.62.1.14_core