Hi.
I ask for suggestions:
I built a little sketch that is waiting for a SSID to appear on the AIR, and then it performs some actions. Then, when the SSID disappear, it cleans up the settings done.
To check the SSID presence, the sketch try to connect to an SSID with the connectToAP function, then sleeps for a minute, then it tries again, and so on.
All is working fine, except if the SSID is absent for a long time (let's say more then 1 hour). In this case the sketch continues to try the connection at every minute, but even when the SSID comes back, it is not able to connect. The only way to get it working is to reset the board.
I tried to put a cc3000.begin() and a cc3000.deleteProfiles() before any connection tentative, but it looks it is not working.
So, it looks that after a certain number of failed connections, the connectToAP stops working.
Any suggestion or idea?
Thanks a lot
CC3000 stops after a while...
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: CC3000 stops after a while...
Nothing springs to mind immediately. Post the code you're using (between CODE tags please) and we'll see if we can find anything.
- cecio
- Posts: 29
- Joined: Sat Jun 14, 2014 12:21 pm
Re: CC3000 stops after a while...
Here it is. This is in the loop section. Quit simple indeed...
Code: Select all
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS,ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,SPI_CLOCK_DIVIDER);
// Try to connect to SSID
char *ssid = WLAN_SSID; /* Max 32 chars */
if (!cc3000.begin())
{
Serial.println(F("Unable to initialise the CC3000! Check your wiring?"));
}
cc3000.deleteProfiles();
if ( !cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY,2) )
{
Serial.println("Not Found");
// Do some stuff
}
else
{
Serial.println("Found!");
// Do some other stuff
// Disconnect from AP
cc3000.disconnect();
}
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: CC3000 stops after a while...
That looks straightforward enough.
I'll have to check with someone from the CC3000 team to see if there are any known issues in terms of memory exhaustion or quirks in the CC3000 itself.
I'll have to check with someone from the CC3000 team to see if there are any known issues in terms of memory exhaustion or quirks in the CC3000 itself.
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: CC3000 stops after a while...
Interesting, it might be some quirk internal to the CC3000. Let's try resetting the CC3000 between connects to help get it back into a good state. After you disconnect from the AP, try adding this call:
This will force the CC3000 to restart and should help if internally it's getting into a bad state. Give that a shot and let me know if it helps, thanks!
Code: Select all
cc3000.reboot();
- cecio
- Posts: 29
- Joined: Sat Jun 14, 2014 12:21 pm
Re: CC3000 stops after a while...
Thanks, I'll try this.....I'll let you know.
- cecio
- Posts: 29
- Joined: Sat Jun 14, 2014 12:21 pm
Re: CC3000 stops after a while...
Ok, I did some testing and here the results:
- the reboot call fixed the problem. Now the connect works every time
- during the testing I noticed a strange thing: sometimes the call to disconnect() hanged the whole sketch. This was not happening all the times, but at least once a day....
I get rid of this call, because now with the reboot() it wasn't necessary any more, so now all is working as expected.
Thanks,
- the reboot call fixed the problem. Now the connect works every time
- during the testing I noticed a strange thing: sometimes the call to disconnect() hanged the whole sketch. This was not happening all the times, but at least once a day....
I get rid of this call, because now with the reboot() it wasn't necessary any more, so now all is working as expected.
Thanks,
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: CC3000 stops after a while...
Oh good to hear it's working now with the reboot. Thanks for the followup!
Please be positive and constructive with your questions and comments.