peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
550 stars 117 forks source link

need pure async mqtt based on native asyncio StreamReader/Writer #36

Closed VladVons closed 2 years ago

VladVons commented 4 years ago

hi Peter,

Thaks for very documented async samples. Very usefull ! Under ESP32 everethig is OK, but i work with ESP8266 and it has less RAM.

In my project i use native asyncio.start_server() with StreamReader / StreamWriter for stream handling. Do you have pure async mqtt code without WiFi connect, Lamp flashing etc? It would be good to reuse StreamReader/Writer from asyncio to decrease code in Ram

peterhinch commented 4 years ago

I don't have any other versions. The published code does not use asyncio.start_server() and the stream methods by design. In testing I found them not to be resilient.

The published code has been extensively tested in ESP8266 applications. If you use frozen bytecode the RAM use is manageable. You should have well over 20KiB free running the test programs. You can add another 4KiB by building for littlefs.