Hello, i am doing the course ESP32-CAM. It´s a really very inspirating book. Well done.
Realizing the Module 3 Unit 2 : Motion Detector with Photo Capture and Email Notifications i got following issue: When the ESP32 starts (going on power or after reset) it connects immediately to my WLAN and send email with the photo. I´m using the external antenna. Then the ESP32 is goinig in deep sleep mode. With a movement in front of the PIR it wakes up and tries to connect to WLAN. But i get no connection. In the terminal you see the “dots” growing. After reset the esp connects fast to the WLAN. Any idea how this issue could be solved ? Thanks a lot in advance . best regards guenter
Hi.
Can you try disconnecting wi-fi before going to sleep and see if that solves the problem?
Include this library:
#include <esp_wifi.h>
An then, call the following function before going to sleep:
esp_wifi_disconnect(); delay(50);
Then, tell me if it solved the problem.
Regards,
Sara
Hi Sara,
Thank you very much for your fast answer. Your hint solves the issue. Thanks a lot. I use the standard library
#include <WiFi.h> and insert the disconnect command. Now it runs perfectly.. See code lines:
esp_sleep_enable_ext0_wakeup(GPIO_NUM_13, 1);
Serial.println("Going to sleep now");
WiFi.disconnect();
delay(1000);
esp_deep_sleep_start();
great support and best regards
guenter