This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3000 Force Re-scan

Is there any way to force a re-scan of the available APs on the CC3000?  If I turn off my test AP, the scan results will continue to show the AP for about a minute after it's been turned off.  I would like to be able to clear out all previously seen APs and restart the scan manually so I can see the test AP 'disappear' within a couple seconds.  It would also be acceptable if the scan rate could be increased so the scan results represent only APs that were seen within the last few seconds, but it's not clear how to do this using the set_scan_params function (if it's even possible).

Thanks,

Andy

  • Hi Andy,

         We are trying to reproduce your scenario and come back with an answer. Are you using a specific sample application?

    Miguel

  • Hi Andy,

    The wlan_ioctl_get_scan_results() return the populated table inside the CC3000 of the surrounding APs.

    The CC3000 populate this table according to generated scan policies.

    Few terminologies explanation: 

    • Dwell time - The amount of time the CC3000 sends probe request and listen to probe response/beacons per channel. It's important that this time will be long enough for the STA to hear all the APs on that channel. Advise to use defaults
    • Channels mask - There are up to 13 channel, However in some countries regulatory domains prevent you from usage of a channel
    • Scan cycle - Going for all supported channels and allocating the information for that. Calculated time: num of channel*dwell time
    • Interval - The amount of time between scan-cycle. 

    There are 2 different policies:

    • While the CC3000 is not connected to any AP.
      In that case the CC3000 issues a "scan cycle" wait "interval time[cycle number]" The last entry in the list will be repeated until a connection. 
      The purpose of that is to try to connect very fast to an AP, and if there are non, increase the interval to save TX power.
    • While the CC3000 is connected. In that case only a single interval is being used. Not sure exactly which one. (Igor?) 

    - Elad

  • Elad, thanks for the details.  So it sounds like it is not possible to force a scan cycle.  I am setting all scan params to defaults where all 16 interval array values are 2000.

    wlan_ioctl_set_scan_params(1, 20, 30, 2, 0x7FF, -100, 0, 205, intervals);

    Miguel, I started with the MSP430 basic wifi application but added some more commands for additional control.  The init is the same, but here are my additional commands.

    Connect:
    s = wlan_connect(WLAN_SEC_UNSEC, "PHS-37f", 7, NULL, NULL, 0);
    Disconnect:
    s = wlan_disconnect();
    Set scan params:
    s = wlan_ioctl_set_scan_params(1, 20, 30, 2, 0x7FF, -100, 0, 205, intervals);
    Show scan results:
    s = wlan_ioctl_get_scan_results(0, (unsigned char *)&r);
     Delete policy:
    wlan_ioctl_set_connection_policy(DISABLE, DISABLE, DISABLE);
    wlan_reboot();
    Reboot:
    wlan_reboot();
    
    
    
    
    void wlan_boot(void)
    {
    
      //
      // WLAN On API Implementation
      //
      wlan_init( CC3000_UsynchCallback, sendWLFWPatch, sendDriverPatch, sendBootLoaderPatch, ReadWlanInterruptPin, WlanInterruptEnable, WlanInterruptDisable, WriteWlanPin);
    
      //
      // Trigger a WLAN device
      //
      wlan_start(0);
    
    
      // Turn on the LED 5 to indicate that we are active and initiated WLAN successfully
      P3OUT |= BIT5;
    
      //
      // Mask out all non-required events from CC3000
      //
      wlan_set_event_mask(HCI_EVNT_WLAN_KEEPALIVE|HCI_EVNT_WLAN_UNSOL_INIT|HCI_EVNT_WLAN_ASYNC_PING_REPORT);
    }
    
    void wlan_reboot(void)
    {
      wlan_stop();
      P3OUT &= ~BIT5;
      P3OUT &= ~BIT7;
      DispatcherUartSendString("\r\nRestarting...");
      __delay_cycles(12000000);
      wlan_boot();
    }
  • Hi Andy,

    While the CC3000 is connected there is no active scan triggred.

    Yael

  • It looks like I can sort of force a scan by enabling the 'use profiles' policy and rebooting the module.  If there are no stored profiles, the CC3000 appears to start scanning immediately after boot without automatically connecting to an AP.  There is still an issue of it not returning all of the visible APs, but at least this looks like a way to force a scan while not being connected to an AP.