micropython-mqtt icon indicating copy to clipboard operation
micropython-mqtt copied to clipboard

On a ESP32, using mqtt_as with range, and if I send 1 subscribe slow handling, if I send say 3 subscribes, only the 1st is slow to be recongized, the following are processed fast?

Open Jibun-no-Kage opened this issue 1 year ago • 4 comments

Using mqtt_as with range, and if I send 1 subscribe slow handling, if I send say 1 subscribes, only the 1st is slow to be recognized/processed on board the ESP32, the following are processed much faster? This is the 19.x (latest ESP32 micropython image). This the same comparable behavior I saw on Pico W before you disabled the power management on the Pico W by default.

Jibun-no-Kage avatar Apr 14 '23 20:04 Jibun-no-Kage

I haven't noticed this, but it does sound like some kind of sleep behaviour. Aside from RP2 there is also special handling for ESP8266 here. Are you aware of a similar facility in ESP32?

peterhinch avatar Apr 15 '23 08:04 peterhinch

Found this... https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/

Jibun-no-Kage avatar Apr 16 '23 05:04 Jibun-no-Kage

Interesting. The ESP32 reference board takes about 55mA when connected to a network but otherwise idle. This is less than the 160-250mA quoted by your reference. Perhaps MicroPython changes modes dynamically?

I can see two difficulties. Firstly the growing number of ESP32 variants is likely to make this a significant research task. Secondly I'm rather busy with other things. However if you, or anyone else, can point me to a fix for one or more variants I'll happily implement it.

peterhinch avatar Apr 16 '23 07:04 peterhinch

Yup, no problem, I will keep digging. And like the Pico W scenario, if I can figure out a realistic change, will let you know. What I have is working, just not as fast as I expected, given my experience with ESP8266 and Pico. The ESP32s I have are older, but have been solid thus far. I am also going to implement the same logic via Arduino IDE (in C) just to compare.

Jibun-no-Kage avatar Apr 16 '23 09:04 Jibun-no-Kage