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

Radio and Connection Sleep/Reopen #63

Open
calittle opened this issue Aug 13, 2019 · 6 comments
Open

Radio and Connection Sleep/Reopen #63

calittle opened this issue Aug 13, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@calittle
Copy link

This is an enhancement request to provide for dropping a connection and shutting off the radio after a specified time period of no use or after a fixed time period. Upon request e.g. post(), WifiManager will turn on the radio and reestablish the connection and reset the timer. This could be useful for battery-powered projects where always-on radio and connections will drain the battery quickly.

@calittle calittle changed the title Connection Sleep or Timeout Radio and Connection Sleep/Reopen Aug 13, 2019
@siddacious
Copy link
Contributor

@brentru Does the NINA firmware have a shutdown feature?

@mscosti
Copy link
Contributor

mscosti commented Aug 24, 2019

I'm not sure exactly what 'low power mode' does, but NINA does support putting it into a low power mode: https://github.com/adafruit/nina-fw/blob/master/main/CommandHandler.cpp#L148-L162

@ladyada
Copy link
Member

ladyada commented Aug 24, 2019

thats as good as yr gonna get. anyone want to implement that function as a PR? :)

@kattni kattni added the enhancement New feature or request label Apr 29, 2020
@anecdata anecdata mentioned this issue Jun 6, 2020
@anecdata
Copy link
Member

anecdata commented Jan 15, 2021

The two pull requests above summarize the current state of power control of the ESP32 NINA co-processor:

  • NINA sets a nominal lower power mode by default that reduces power usage to about half when not communicating with the AP. This is the normal level of opereation already. There is a higher power saving mode that would require NINA and ESP32SPI changes, but also may introduce operational differences.
  • A disconnect() function is now available in ESP_SPIcontrol, reducing average power usage to about half in common use cases. This function can now be used directly in user code, or could be incorporated into higher-level libraries like WiFiManager.

@brentru
Copy link
Member

brentru commented Jan 15, 2021

A disconnect() function is now available in ESP_SPIcontrol, reducing average power usage to about half in common use cases. This function can now be used directly in user code, or could be incorporated into higher-level libraries like WiFiManager.

Exciting - I want to incorporate this into MiniMQTT.

@anecdata
Copy link
Member

anecdata commented Jan 17, 2021

Just a note that ESP32SPI NTP using esp.get_time() doesn't play well with staying disconnected until needed since the ESP32 needs some interval (~15 seconds I believe) after connection before it will return valid seconds. HTTP/TCP/UDP/etc at the circuitpython level has no such limitation.

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

No branches or pull requests

7 participants