Hi,
I would like to configure my ESP32 board to disable WiFi power save mode from MicroPython.
How can this be done ?
From Espressif docs at
https://docs.espressif.com/projects/esp ... _wifi.html
it can be done with: esp_wifi_set_ps(WIFI_PS_NONE) , as by default ESP32 wifi is configured with WIFI_PS_MIN_MODEM
What is the equivalent in MicroPython ?
Note that the only other place where I have seen this mentionned is here, dating back to 2019...
viewtopic.php?f=2&t=7317&p=41719&hilit= ... _ps#p41719
Looking forward to any comment or advice...
ESP32 - configuring wifi power save mode from micropython
Re: ESP32 - configuring wifi power save mode from micropython
There are already two different pull requests regarding WIFI Power save:
https://github.com/micropython/micropython/pull/6774 (mine)
https://github.com/micropython/micropython/pull/5473
I have no idea when someone will decide to merge one of them.
Regards,
Thomas
https://github.com/micropython/micropython/pull/6774 (mine)
https://github.com/micropython/micropython/pull/5473
I have no idea when someone will decide to merge one of them.
Regards,
Thomas
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
My repositories: https://github.com/karfas
Re: ESP32 - configuring wifi power save mode from micropython
Thanks for pointing out these 2 pull requests.
I checked both of them, and I think I prefer your approach (6774), although if none of them is gets merged, it won't help much...
I'm trying to use the ESP32 in a home automation system where the board must send and respond to MQTT messages with fairly low latency (< 300 ms). With the ESP32 default WIFI_PS_MIN_MODEM, latency when receiving MQTT messages can be anywhere between 400 and 3000 ms due the Wifi modem going into power save mode quickly after sending packets... Just not acceptable for my application, considering that the board is not operating from battery.
I think I will try to create a small mpy file with the one function esp_wifi_set_ps() exposed. It might be easier than recompiling the entire micropython image. What do you think ?
I checked both of them, and I think I prefer your approach (6774), although if none of them is gets merged, it won't help much...
I'm trying to use the ESP32 in a home automation system where the board must send and respond to MQTT messages with fairly low latency (< 300 ms). With the ESP32 default WIFI_PS_MIN_MODEM, latency when receiving MQTT messages can be anywhere between 400 and 3000 ms due the Wifi modem going into power save mode quickly after sending packets... Just not acceptable for my application, considering that the board is not operating from battery.
I think I will try to create a small mpy file with the one function esp_wifi_set_ps() exposed. It might be easier than recompiling the entire micropython image. What do you think ?
Re: ESP32 - configuring wifi power save mode from micropython
Did you have any luck with creating a MPY file or did you find another way to configure power save for the ESP32 wifi ?
Thomas
Thomas
-
- Posts: 144
- Joined: Mon Jul 25, 2022 9:45 pm
Re: ESP32 - configuring wifi power save mode from micropython
Any work on this issue? I am seeing some real performance differences between ESP32 and ESP8266 when responding to MQTT communication. The ESP8266 is snappy, the ESP32 takes 1 to 5 seconds to receive and respond to MQTT traffic initially, speeds up, then slows again. The same happened PicoW, but there is a documented method in the Pico SDK, on how to disable the WiFI sleep feature. Appears need the same on ESP32.
Re: ESP32 - configuring wifi power save mode from micropython
I use power_save for a ESPNow Gateway using an image found at https://github.com/glenn20/micropython-espnow-images. Only for the ESP32.
Docs:
https://micropython-glenn20.readthedocs ... spnow.html
Docs:
https://micropython-glenn20.readthedocs ... spnow.html
Re: ESP32 - configuring wifi power save mode from micropython
And a third at https://github.com/micropython/micropython/pull/8993 . (I missed the earlier PRs before I posted mine).karfas wrote: ↑Sun Feb 20, 2022 10:29 pmThere are already two different pull requests regarding WIFI Power save:
https://github.com/micropython/micropython/pull/6774 (mine)
https://github.com/micropython/micropython/pull/5473
This latter PR has been split off from the ESPNow PR (#6515) and is the basis of the support in the images referred to by davef. I'm also unsure when any of these PRs will be merged, but a few other additions to the WLAN.config() method of the esp32 have been recently merged into master.