8000 esp8266, esp32: WiFi: clarification about PowerManagement attributes · Issue #15168 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
8000

esp8266, esp32: WiFi: clarification about PowerManagement attributes #15168

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

Open
2 tasks done
massimosala opened this issue May 30, 2024 · 1 comment
Open
2 tasks done

Comments

@massimosala
Copy link
massimosala commented May 30, 2024

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues and didn't find any that matched.

Documentation URL

https://docs.micropython.org/en/latest/library/network.WLAN.html

Description

Trying to disable PowerManagement on a esp board acting as client WiFi.

The last doc says:

Constants
WLAN.PM_PERFORMANCE
WLAN.PM_POWERSAVE
WLAN.PM_NONE

I tried from REPL:

from network import *
nic = WLAN(STA_IF)
nic.config(pm = WLAN.PM_NONE)

dir(nic)
['__class__', 'PM_NONE', 'PM_PERFORMANCE', 'PM_POWERSAVE', 'active', 'config', 'connect', 'disconnect', 'ifconfig', 'isconnected', 'scan', 'status']

Questions:

  1. So the attributes are available also on the nic instance: is it wanted or is just a leftover from the past ?

  2. esp32: do these attributes make obsolete the previous setting listen_interval ?

@glenn20
Copy link
Contributor
glenn20 commented Jul 1, 2024
  1. So the attributes are available also on the nic instance: is it wanted or is just a leftover from the past ?

This is as expected, ie. PM_NONE etc are effectively attributes of the WLAN class, so they will appear as attributes of instances of WLAN as well, so you may just as well use nic.PM_NONE as WLAN.PM_NONE.

  1. esp32: do these attributes make obsolete the previous setting listen_interval ?

I am not aware of a listen_interval setting (I checked back as far as v1.17).

For the esp32, the levels correspond to the setting decribed in the Espressif docs. The default value for the listen_interval when using PM_POWERSAVE is 3 (which can't be changed from micropython). See PR #8993 for more discussion about the pm settings.

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

No branches or pull requests

2 participants
0