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.
Using mqtt_as on ESP vs PicoW?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Using mqtt_as on ESP vs PicoW?
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.
It is much easier to use platforms with more RAM such as a Pico W, ESP32 or Pyboard D.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 144
- Joined: Mon Jul 25, 2022 9:45 pm
Re: Using mqtt_as on ESP vs PicoW?
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Using mqtt_as on ESP vs PicoW?
See the official docs.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.