Skip to content

esp32/modnetwork: interface to the WIFI power save functions of ESP-IDF #6774

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

Closed
wants to merge 2 commits into from

Conversation

karfas
Copy link

@karfas karfas commented Jan 16, 2021

New function WLAN.wifi_ps() with zero or one parameter.
New constants in network:
WIFI_PS_NONE
WIFI_PS_MIN_MODEM
WIFI_PS_MAX_MODEM

When called without parameter, the function returns the current WIFI power save mode.
When called with one parameter, the power save mode is set to the value of the parameter and the previous power save mode is returned.

@tve
Copy link
Contributor

tve commented Jan 16, 2021

FYI: #5473

@karfas
Copy link
Author

karfas commented Jan 16, 2021

@tve: yes, I had seen #5473 before.
However, I think it's more flexible to have a dedicated function instead of a parameter to connect().
This allows to switch the WIFI speed depending upon current requirements (e.g. switch to PS_NONE when I have a lot of data to transfer).

Regards,
Thomas

…SP-IDF.

New function WLAN.wifi_ps() with zero or one parameter.
New constants in network:
  WIFI_PS_NONE
  WIFI_PS_MIN_MODEM
  WIFI_PS_MAX_MODEM

When called without parameter, the function returns the current WIFI power save mode.
When called with one parameter, the power save mode is set to the value of the parameter and the previous power save mode is returned.

esp32/modnetwork: code formatting
@EternityForest
Copy link

I'm using code adapted from here(In addition to some other stuff) and getting down to 7mA (With spikes when it wakes up) on a TTGo T-Display when using auto light sleep(Most of the current is probably from the USB chip).

It really is night and day. Is this still on the roadmap?

Seems like a lot of stuff has changed, but it integrated with a fork of master here just fine:

https://github.com/EternityForest/micropython/tree/dev-branch

tannewt added a commit to tannewt/circuitpython that referenced this pull request Aug 17, 2022
@karfas
Copy link
Author

karfas commented Sep 9, 2022

Closing this in favor of #8993, as the new PR

  • works for both ESP32 and ESP8266 ports
  • has a nicer interface (wlan.config(pm=X))

@karfas karfas closed this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants