0

WiFi problems
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

WiFi problems

by RedSafety on Fri Feb 08, 2019 3:23 pm

Hi all,

As no one has responded to my post of the Mon Feb 04, 2019 5:43 pm regarding "Intermittent stalling of code".

I did a bit more research to find that if wifi is lost, Adafruit io in my case reacts like I documented in my original post ie the programme halts at AdafruitIO::connect().

As I have a very steady cable internet connection of 213 Mbps, the question I have is what recoding is required to prevent this situation occurring i.e. when the internet connection is lost or I would suggest in the event of having an Adafruit network issue the programme you are executing locks up, currtly this is a total unacceptable situation.

RedSafety
 
Posts: 13
Joined: Mon Jan 14, 2019 4:26 pm

Re: WiFi problems

by brubell on Fri Feb 08, 2019 3:36 pm

The Deep Sleep code from the examples folder you're using was tested on a Feather Huzzah ESP8266, not a ESP32. The halting is most likely due to something with the ESP32, not Adafruit IO or your internet connection.

Here's an example of using the ESP32's deep-sleep mode from within the Arduino IDE editor: https://github.com/espressif/arduino-es ... WakeUp.ino

brubell
 
Posts: 245
Joined: Fri Jul 17, 2015 10:33 pm

Re: WiFi problems

by RedSafety on Sat Feb 09, 2019 5:37 am

Hi brubell
Thank you for responding to my post, I have looked at your example and unless I am missing something the core sleep coding is identical. Have you any other suggestions of areas that I need to explore?

RedSafety
 
Posts: 13
Joined: Mon Jan 14, 2019 4:26 pm

Re: WiFi problems

by RedSafety on Sat Feb 09, 2019 5:59 am

Brubell, just noticed this post:-
Looks like pilobond » Mon Feb 04, 2019 1:19 am “my device stops working when disconnected from Internet” post of Mon Feb 04, 2019 3:15 am is reflecting the same error as my problem.

RedSafety
 
Posts: 13
Joined: Mon Jan 14, 2019 4:26 pm

Re: WiFi problems

by brubell on Mon Feb 11, 2019 11:24 am

RedSafety wrote:Hi brubell
Thank you for responding to my post, I have looked at your example and unless I am missing something the core sleep coding is identical. Have you any other suggestions of areas that I need to explore?


Have you tied GPIO #16 to the reset pin per https://learn.adafruit.com/using-ifttt- ... -usage-2-2?

brubell
 
Posts: 245
Joined: Fri Jul 17, 2015 10:33 pm

Re: WiFi problems

by RedSafety on Mon Feb 11, 2019 2:57 pm

Brubell
Yes on ESP8266 GPIO #16 would be required to be configured like this . As I have stated I am using an ESP32, hence my understand is that this configuration is not required.
At the current time I would suggest that the discussion is switched from the use of the sleep mode, as you can see from my post of the “Sat Feb 09, 2019 10:59 am” others are having similar problems with WiFi dropping out causing problems. I have undertaken further investigation to find that this is a common problem with the ESP32. Below I have including a more in-depth fault log from my set-up.

Given my findings how are you addressed a drop in wifi , so that that this arising does not halt the Sketch that is running?

19:25:10.500 -> Adafruit IO Environmental Logger
19:25:10.535 -> Connecting to Adafruit IO...
19:25:10.535 -> AdafruitIO::connect()
19:25:10.670 -> [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
19:25:10.670 -> [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
19:25:10.773 -> ..[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 5 - STA_DISCONNECTED
19:25:11.529 -> [W][WiFiGeneric.cpp:357] _eventCallback(): Reason: 202 - AUTH_FAIL
19:25:11.766 -> .............................................................................

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
13:16:15.736 -> Adafruit IO Environmental Logger
13:16:15.770 -> Connecting to Adafruit IO...
13:16:15.770 -> AdafruitIO::connect()
13:16:15.872 -> [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START
13:16:15.872 -> [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 0 - WIFI_READY
13:16:16.041 -> New Client. RSSi: 0 dBm
13:16:16.041 -> .New Client. RSSi: -44 dBm
13:16:16.795 -> .[D][WiFiGeneric.cpp:345] _eventCallback(): Event: 5 - STA_DISCONNECTED
13:16:16.795 -> [W][WiFiGeneric.cpp:360] _eventCallback(): Reason: 202 - AUTH_FAIL
13:16:17.275 -> New Client. RSSi: 0 dBm
13:16:17.275 -> .New Client. RSSi: 0 dBm
13:16:17.786 -> .New Client. RSSi: 0 dBm
13:16:18.264 -> .New Client. RSSi: 0 dBm
13:16:18.776 -> .New Client. RSSi: 0 dBm
13:16:19.287 -> .New Client. RSSi: 0 dBm
13:16:19.792 -> .New Client. RSSi: 0 dBm

RedSafety
 
Posts: 13
Joined: Mon Jan 14, 2019 4:26 pm

Re: WiFi problems

by RedSafety on Thu Feb 14, 2019 3:54 pm

Brubell

Can you confirm whether you or one of your other colleagues can answer the question I have posted regarding how dropped wifi is being handled within Adafruilt IO so sketches do not lock up?
Best regards

RedSafety
 
Posts: 13
Joined: Mon Jan 14, 2019 4:26 pm

Re: WiFi problems

by abachman on Thu Feb 14, 2019 4:14 pm

Hi RedSafety,


Have you tried writing the sketch using the Adafruit MQTT library or plain HTTP? Under the hood, Adafruit_IO_Arduino is using the board packages' default WiFi client and https://github.com/adafruit/Adafruit_MQTT_Library to connect to IO.

If you can isolate the reconnection problem to one of those, that might help sort out what's going on.


- Adam B

abachman
 
Posts: 265
Joined: Mon Feb 01, 2010 12:48 pm

Re: WiFi problems

by RedSafety on Thu Feb 14, 2019 5:48 pm

Adam B
Thank you for the quick reply.
I can confirm that I have not used MOTT or HTTP in my sketches.
So can I confirm you require me to to carry out a test to see if I get a lost wifi connection using these techniques.
If this is correct can you suggest a sketch for a ESP 32 so I can test wifi integrity.

Best regards

RedSafety
 
Posts: 13
Joined: Mon Jan 14, 2019 4:26 pm

Please be positive and constructive with your questions and comments.