I'm working on a project I started using the WebClientRepeating example. I've got one fix that might help some people, and an issue as well.
DHCP connection
Occassionally I would get a good connection, but most of the time I would get "0.0.0.0" as an IP address. I finally figured out that if I waited longer, I would eventually get an IP. Here's an enhancement to the existing SimpleLink sketches that will fix this problem. Basically - I read the IP from the CC3000 and loop until I have something other than 0.0.0.0. I've found that when I'm developing - constantly reconnecting to the WiFi router - it can take a while to get an address.
//Begin original code
Serial.println("Waiting for DHCP address....");
// wait for 5 seconds for connection:
delay(5000);
//end original code
//begin DHCP fix
IPAddress ip = WiFi.localIP();
while(ip[0] == 0)
{
ip = WiFi.localIP();
Serial.println("No DHCP Addr - waiting for DHCP address... again...");
delay(5000);
}
//end DHCP fix
My problem
What I've run into now is that the sketch seems to run for a while, but eventually everything stops working. I've got it running logging messages to serial like in the original sketch, but after a while - the connections fail constantly. Sometimes it's a few minutes, sometimes it's an hour. I've added code to check the IP, and the IP is still set. I doubt it's WiFi stability since it's the same one my laptop is connected to.
Anybody have similar problems? Any ideas on how to fix? My next move is to just move back to the CCS library for TI and convert it for the 5529LP (the current download only works for the experimenter's board last time I looked).