connection issues

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
base1379
 
Posts: 1
Joined: Sat Feb 20, 2021 3:22 pm

connection issues

Post by base1379 »

Hi,

I've been experiencing this annoyance for years and decided I needed to make a post before I snap.

When connecting to wifi with various circuit boards (nodeMCU, esp8266, feather huzzah32), it seems when using the following code:
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
there's about a 50% chance it will connect, and 50% chance it won't. When it doesn't, it just prints periods forever. My remedy for this is to either reset the board or momentarily cut power (disconnect USB cable between board and computer). A power cycle usually results in a successful connection quickly.

I'm seeing similar behavior when running the "adafruitio_06_digital_in.ino" example with a feather huzzah32 at this block of code:
while(io.status() < AIO_CONNECTED) {
Serial.print(".");
delay(500);
}
I notice that every other time I press reset, it will succeed with failures in between (I'm pressing reset at the end of the line of periods):

Connecting to Adafruit IO.................................................................Connecting to Adafruit IO.
12:28:32.239 -> Adafruit IO connected.
12:28:36.463 -> sending button -> 1
12:28:37.382 -> sending button -> 0
12:28:38.254 -> sending button -> 1
12:28:38.804 -> sending button -> 0
12:28:44.782 -> Connecting to Adafruit IO..........................................Connecting to Adafruit IO.
12:29:09.939 -> Adafruit IO connected.
12:29:14.167 -> sending button -> 1
12:29:14.857 -> sending button -> 0
12:29:18.263 -> Connecting to Adafruit IO..............................Connecting to Adafruit IO.
12:29:37.378 -> Adafruit IO connected.
12:29:40.861 -> sending button -> 1
12:29:40.952 -> sending button -> 0
12:29:44.260 -> Connecting to Adafruit IO...........................Connecting to Adafruit IO.
12:30:01.564 -> Adafruit IO connected.
12:30:05.478 -> sending button -> 1
12:30:05.569 -> sending button -> 0
12:30:08.793 -> Connecting to Adafruit IO.......................Connecting to Adafruit IO.
12:30:24.201 -> Adafruit IO connected.
12:30:29.897 -> Connecting to Adafruit IO....................Connecting to Adafruit IO..
12:30:44.053 -> Adafruit IO connected.
12:31:42.353 -> sending button -> 1
12:31:42.444 -> sending button -> 0

And similar behavior when disconnecting the USB cable:
12:32:17.977 -> Adafruit IO connected.
12:32:26.385 -> sending button -> 1
12:32:26.524 -> sending button -> 0
12:32:54.831 ->
12:32:54.831 -> Adafruit IO connected.
12:33:00.380 -> sending button -> 1
12:33:00.473 -> sending button -> 0
12:33:42.627 ->
12:33:42.627 -> Adafruit IO connected.
12:33:49.738 -> sending button -> 1
12:33:49.876 -> sending button -> 0

The blank lines above are failures, I disconnect the cable after a successful connection and reconnect but nothing happens, no "."s, nothing.
A second disconnect/reconnect results in "Adafruit IO connected." after the blank line.

I apologize for what I'm guessing is a trivial matter, but I've searched for solutions (literally for years now) and haven't been able to figure it out.

Thanks,
Wolfgang

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”