TinyCircuits

Tinyshield wifi will not connect to network

Tinyshield wifi will not connect to network
« on: September 11, 2015, 03:43:07 PM »
I have the following stack:
Processor with lipo support, battery is connected
USB
Wifi
Protoboard

When I try the webclient or wifi test sketches from the Adafruit CC3000 library I see the wifi is initialized properly, I can see all the networks around me via ssid scan, but the device never connects to my network.  I even see my network in the ssid scan.  I have tried on two different networks and both fail.  Both are WPA networks.  The passphrases are correct.  The port numbers (2, A3, 8, etc) have been changed in the sketch.

When I turn on debugging in the CC3000 library it says "Waiting to connect.....Timed out"  Does this over and over.

Any help would be appreciated.  Thanks in advance.


Re: Tinyshield wifi will not connect to network
« Reply #1 on: September 12, 2015, 11:09:40 AM »
I have more information after trying different things and adding debug to the ti driver.

Tried on ide 1.6.x and 1.0.6.  No change.
Tried with and without protoboard connected.  No change.

Debug shows that the connect call is proper but after a few seconds a disconnect is received by the call back from the cc3000.  No data with it, just a disconnect.

Tried on my second network again and it began to "try" to work but not completely.  Meaning it would sometimes connect, sometimes get a dhcp address, but never resolve a name to ip.

All of this is just flaky.  AP is 25 feet away.  Rssi is around 35 as reported by device.  I think this board just isnt ready for primetime.  Going to take it all back to my retailer and get a refund.  Thanks for trying.

Re: Tinyshield wifi will not connect to network
« Reply #2 on: September 20, 2015, 03:24:50 PM »
I had the same issues as you but was able to get it to work.  Here a few things to try:
  • Try running the "webclient" example,  I think the wifi chip get's locked up using the "buildtest" example
  • Once that is up and running I would suggest adding "#define SEND_NON_BLOCKING 1" to the socket.cpp file if you notice your system hanging.
Those two changes got my tinyduino up and running.

Re: Tinyshield wifi will not connect to network
« Reply #3 on: September 27, 2015, 10:56:54 AM »
I had some problems initially getting my wifi to connect.

Since the Adafruit website is covered with warnings about problems with newer IDEs, I'm only using 1.0.6.

First thing to notice is you need to set the serial monitor to 115200.

I modified the buildtest sketch with the pin names as directed, and it was unable to resolve www.adafruit.com (just waits forever, never times out).  I poked around my Wifi router config, and noticed that the address reported by the program (192.168.1.62) was outside the range my DHCP server was supposed to give out (192.168.0.0/24), and the DNS server and gateway (192.168.1.1)  were incorrect.

(Also, while my Wifi router could see my tinywifi MAC, it reported that no DHCP address had been assigned).

It appears that part of the Wifi config is saved inside the CC3000 chip. (The instructions for setting a static IP hint at this). I was able to get mine to work by uncommenting the code to activate DHCP:

/* Optional: Revert back from static IP addres to use DHCP.
     See note for setStaticIPAddress above, this only needs to be
     called once and will be remembered afterwards by the CC3000.
  */
 
  if (!cc3000.setDHCP()) {
    Serial.println(F("Failed to set DHCP!"));
    while(1);
  }

Apparently, if the chip is EVER used for not-DHCP, it remembers it. Kinda whack, because that means that if there was any testing done on the product, it risks leaving weird state behind.

After this change, I successfully received a valid DHCP IP, and the gateway & DNS server set correctly, and the rest of the buildtest program worked.