Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ESP32) Fix bluetooth after light-sleep; de-init for deep-sleep #3655

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

todd-herbert
Copy link
Contributor

@todd-herbert todd-herbert commented Apr 18, 2024

Currently:

  • When ESP32 devices enter light-sleep (power saving), BLE advertising is reset and disabled.
  • If phone remains connected during light-sleep, it is possible to use BLE when the node wakes.
  • If phone loses BLE connection during light-sleep, it is not possible to reconnect to the node.
  • This does not appear to be an intentional behavior, and this "locked out" state does not appear to give any power savings.

Pull Request:

  • When ESP32 device prepares to enter light-sleep, no calls to NimBLE to stop advertising.
  • During light-sleep, advertising stops automatically, even without explicit calls to NimBLE. Power consumption measured same as with current code.
  • After waking from light-sleep, BLE regains full normal function.
  • NimBLE de-init enabled for ESP32 devices entering deep-sleep. Modest reduction in deep-sleep current. Device resumes normal BLE function after exiting deep-sleep.

@thebentern thebentern merged commit 747c713 into meshtastic:master Apr 18, 2024
70 checks passed
@todd-herbert todd-herbert deleted the esp-lightsleep-ble branch April 18, 2024 14:21
@meshtastic-bot
Copy link

This pull request has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/dodeepsleep-with-msectowake/12338/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants