• 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 problem restarting ble/bluetooth after light/deep sleep

Q&A Forum › Category: ESP32 › ESP32 problem restarting ble/bluetooth after light/deep sleep
0 Vote Up Vote Down
Edo Ceder asked 4 years ago

Hi,

We are using the ESP32-PICO-D4 on a dev board.
We use light sleep in our code to save battery when there is no need for processing.

However, it seems that once you disable BLE there is not way to re-init the device and be able to communicate again.
We’ve searched everywhere but no one seems to have been able to solve this.
Have you had experience with light sleep and BLE?
Thanks,
Edo

Question Tags: #BLE #LIGHTSLEEP
6 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
I’ve never experimented with light sleep with Bluetooth.
Light sleep turns off Wi-Fi and Bluetooth. So, I guess that you need to enable it again after waking up.
Take a look at this discussion, it might help (it is about deep sleep, but might have some useful information for your case): https://github.com/nkolban/esp32-snippets/issues/354
It can also be useful to take a look at the Bluetooth API: 

  • https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_bt_main.html
  • https://docs.espressif.com/projects/esp-idf/en/v3.0-rc1/api-reference/system/sleep_modes.html#wifi-bt-and-sleep-modes

I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
Edo Ceder answered 4 years ago

Hi Sara,
Thanks for your quick reply and for the materials you found.
Unfortunately we have scanned these materials and many others, but to no avail.
The problem is restarting BLE, not shutting it off. This is a problem even if no sleep (light or otherwise) is induced.
Thanks and best regards,
Edo

0 Vote Up Vote Down
Steve Mercer answered 4 years ago

A quick search showed this. I have not done anything with BLE as yet but was surprised that the ESP32 can only do either WiFi or BLE but not both at the same time. I am going to have to rethink my project.

0 Vote Up Vote Down
Edo Ceder answered 4 years ago

Thanks for getting involved, Steve. The link you attached is about one aspect of BLE. Going into light sleep will disable all BLE.

Not sure why you say that ESP32 can only do either BLE or WiFi. In our project we use ESP-NOW (Thanks RNT for exposing this great inter-device comm method to us) which is WiFi based as well as BLE without a problem (beside the BLE restart issue, which others seem to encounter as well)..

If you want to share your project here, maybe one of us can help…

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

Hi again.
I’ve searched for a while and it seems that many people have the same issue. But I couldn’t find any proper solution: https://github.com/nkolban/esp32-snippets/issues/351
Regards,
Sara

0 Vote Up Vote Down
Steve Mercer answered 4 years ago

I guess I went down the wrong rabbit hole whilst looking into this. I read a post saying you had to restart the ESP32 if you switched between BLE and WiFi.

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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 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.