Page 1 of 1

Using mqtt_as on ESP vs PicoW?

Posted: Sat Aug 13, 2022 5:59 pm
by Jibun no kage
Using mqtt_as on ESP vs PicoW? To test the mqtt_as implementation on PicoW, it was pretty straight-forward, just upload the mqtt_as.py and config.py files to PicoW file system (via Thonny). And use.

I tried the same with an ESP module with 1MB, and sure enough, memory error on module load of the MQTTClient. I recalled the mqtt_as module is to big to compile directly, so the question is how do I get it in a usable state on an ESP module? It is not core to MicroPython downloadable images, right? So I need to compile/freeze it?

Just to test I tried the same with Thonny download of micropython-mqtt-async, and it the same basic wall, memory error when I tried to load the micropython-mqtt-async module.

Re: Using mqtt_as on ESP vs PicoW?

Posted: Sun Aug 14, 2022 7:44 am
by pythoncoder
Please see the docs re use on ESP8266. I have not tested on ESP8266 versions with < 4MiB of Flash: it is possible that it is not usable on the 1MiB versions.

It is much easier to use platforms with more RAM such as a Pico W, ESP32 or Pyboard D.

Re: Using mqtt_as on ESP vs PicoW?

Posted: Sun Aug 14, 2022 2:07 pm
by Jibun no kage
I asked this above... how does one add it and mark it as frozen or otherwise compiled? I suspect I will need to create a custom firmware at some point, so how do I start down that path? Per your documentation "The module is too large to compile on the ESP8266 and should be precompiled or preferably frozen as bytecode." That makes sense, I just need some assistance on how to do that correctly.

Re: Using mqtt_as on ESP vs PicoW?

Posted: Mon Aug 15, 2022 7:24 am
by pythoncoder