Using mqtt simple and robust (original, not simple2 or robust2) if I send MQTT messages too fast I can flood the ESP01 or any ESP8266. Typically I get a recursive (stack exhausted) error, but this is misleading, because I am not using uasyncio, I think something is getting crushed as the requests are not queued. If I keep the rate of messages about 1 per second, no issues. Also, I don't use multiple subscribes, I parse the MQTT topic to call the given function rather than 1 topic per function. You can do something like following.
Say theTopic='cmnd/test/1/2/3', So the function would be 'On123' when you split the topic, then join it. You then can call the function with:
theParse=''.join(theTopic.split('/')[2:])
theFunction='On{0}'.format(theParse)
globals[theFunction](theTopic, thePayLoad)
I usually just replace 'cmnd' with 'status' to publish results back, and create thePayLoad as applicable.
As for the ESP01 to/from Pico... I just use UART raw, nothing fancy, at most, passing the topic and payload as json formatted string to/from. Using json I can catch any obvious corrupted communication. But, there are more elegant and resilient ways, to make sure UART communication is stable, but I have not as yet had to do such. All depends on if I can use such with the 1MB limit. The 'bridge' project is one such elegant UART protocol. Reference
https://github.com/peterhinch/micropyth ... ter/bridge
I plan to use mqtt_as at some point for the MQTT client, but to get that on a 1MB ESP01 with uasyncio I will need a custom firmware image or frozen/bytecode MPY files on the ESP01. Reference
https://github.com/peterhinch/micropyth ... er/mqtt_as
So my next effort is learning how to create custom firmware image of MP. This is going slow, since there is some MUCH outdated information on how to generate MP ports. Got the Unix port generated in minutes, but ESP8266 port keeps failing for different reasons, given different examples.
I am really enjoying figuring out each step/stage of this project. Having written ESP C code via the Arduino IDE, was an initial test, where the ESP MQTT/UART is all a Arduino sketch. But I digress.