TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: boostinallovryou on September 11, 2015, 03:43:07 PM

Title: Tinyshield wifi will not connect to network
Post by: boostinallovryou 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.

Title: Re: Tinyshield wifi will not connect to network
Post by: boostinallovryou 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.
Title: Re: Tinyshield wifi will not connect to network
Post by: mapex99 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:
Those two changes got my tinyduino up and running.
Title: Re: Tinyshield wifi will not connect to network
Post by: jcarter 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.
Title: Re: Tinyshield wifi will not connect to network
Post by: TinyCanadianCircuits on March 25, 2023, 01:38:30 AM
I hit a similar issue when getting started with the WiFi_TinyShield_Example code.
It just would not connect and kept giving status 6 - WL_DISCONNECTED.

Based on the note by boostinallovryou, I ran a scan of SSIDs in my area using:
WiFi101/examples/ScanNetworks code from GitHub
after modifying Serial. to SerialUSB. and adding the setPins()

Turns out that my access point was configured for 5GHz only and so didn't show up in the scan.
Turned on 2.4.GHz and TinyShield connected right off! :-)
Title: Re: Tinyshield wifi will not connect to network
Post by: lennevia on March 27, 2023, 01:00:00 PM
Wow! Thanks for sharing the fix you came up with! I'm sure that will come up more often with newer network hardware.

That would be so difficult to debug secondhand, seriously thanks so much for sharing.

Cheers,
RĂ©na