๐ŸŽ„โ›„โ„๏ธ๐ŸŽ It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! ๐ŸŽ„โ›„โ„๏ธ๐ŸŽ
0

HUZZAH32 ESP32 WiFi connection issue after Deep Sleep and Wa
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

HUZZAH32 ESP32 WiFi connection issue after Deep Sleep and Wa

by IsaiasP on Fri Feb 22, 2019 7:15 pm

Hello guys,
I have a HUZZAH32 board working with wifi with no problem, however, when it goes to Deep Sleep and Wakes Up thru GPIO33 (the only peripheral connected is the push button to wake up the ESP32) the board has WiFi connection issue, I'm using the Arduino IDE and the values of the variables for SSID and Password to connect to WiFi are still there because I print them to make sure they were not lost after Deep Sleep.
I tried another WiFi connection, my mobile phone to share WiFi connectivity and worked ok.
Do you know why and how can I fixed ?

Thanks in advance for any help.
Isaias

IsaiasP
 
Posts: 4
Joined: Tue Jan 22, 2019 9:48 pm

Re: HUZZAH32 ESP32 WiFi connection issue after Deep Sleep an

by adafruit_support_mike on Sat Feb 23, 2019 12:02 am

What is the connection issue?

You'll have to reconnect to the access point every time the ESP32 wakes up, even if the SSID and password are still in memory.

adafruit_support_mike
 
Posts: 59487
Joined: Thu Feb 11, 2010 2:51 pm

Re: HUZZAH32 ESP32 WiFi connection issue after Deep Sleep an

by IsaiasP on Sat Feb 23, 2019 11:12 am

Hi Mike, thanks for your response.

I have the code to reconnect to the AP every time the ESP32 wakes up.
After I upload or reset the HUZZAH32 there is no problem and the micro connects to the WiFi.
However, When it goes to Deep Sleep and Wakes Up it tries to reconnect to the WiFi with no success and stays in the loop printing **************.

I appreciate for any help you can provide.

This is the piece of code for your reference.

Code: Select all | TOGGLE FULL SIZE
#include <WiFi.h>

RTC_DATA_ATTR const char* ssid = "xxx";             // SSID of the WiFi Network.
RTC_DATA_ATTR const char* password = "yyy";   // Password of the WiFi Network.

void setup() {
 
  Serial.begin(115200);
  delay(1000);                   //Take some time to open up the Serial Monitor

  Serial.print("Connecting To: ");
  Serial.println(ssid);
  Serial.println(password);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print("*");
  }
  Serial.println("");
  Serial.println(WiFi.status());
  Serial.println("WiFi Connected.");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  esp_sleep_enable_ext0_wakeup(GPIO_NUM_33, 1);     //1 = High, 0 = Low
 
  Serial.println("Going to sleep now");
  delay(1000);
  esp_deep_sleep_start();
  Serial.println("This will never be printed");
}

void loop() {
  //This is not going to be called
}
Last edited by adafruit_support_mike on Mon Feb 25, 2019 1:33 am, edited 1 time in total.
Reason: added CODE tags

IsaiasP
 
Posts: 4
Joined: Tue Jan 22, 2019 9:48 pm

Re: HUZZAH32 ESP32 WiFi connection issue after Deep Sleep an

by adafruit_support_mike on Mon Feb 25, 2019 1:37 am

Try adding a call to .disconnect() before putting the ESP32 to sleep, and calling .reconnect() after it wakes up.

adafruit_support_mike
 
Posts: 59487
Joined: Thu Feb 11, 2010 2:51 pm

Re: HUZZAH32 ESP32 WiFi connection issue after Deep Sleep an

by IsaiasP on Mon Feb 25, 2019 3:51 pm

Hi Mike, ESP32 now is working with your advisement!.
Thanks!!!

Best regards
Isaias

IsaiasP
 
Posts: 4
Joined: Tue Jan 22, 2019 9:48 pm

Re: HUZZAH32 ESP32 WiFi connection issue after Deep Sleep an

by adafruit_support_mike on Tue Feb 26, 2019 2:22 am

Glad to hear it. Happy hacking!

adafruit_support_mike
 
Posts: 59487
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.