• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32-CAM (AI-Thinker): Module 3 Unit2 trouble with WLAN connection after wake up from deep sleep mode

Q&A Forum › Category: ESP32 › ESP32-CAM (AI-Thinker): Module 3 Unit2 trouble with WLAN connection after wake up from deep sleep mode
0 Vote Up Vote Down
Guenter Wagner asked 5 years ago

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 

Question Tags: ESP32-CAM module 3 unit 2
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

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

0 Vote Up Vote Down
Guenter Wagner answered 5 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
That’s great!
I’m glad it is working now 🙂
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.