peterhinch / micropython-mqtt

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

Testing pico w and having issues. #84

Closed ebolisa closed 1 year ago

ebolisa commented 1 year ago

Hi, I've been running an older lib on ESP32 for sometime with no issues. But I cannot procede with a pico w board. I understand that the wifi characteristics for the two board are similar so the lib (latest) should work on the pico w as well. However, the code crashes with the following info and because it deals with the lib, I came to a halt. Any help is appreciated.

%Run -c $EDITOR_CONTENT Checking WiFi integrity. Got reliable connection Connecting to broker. Traceback (most recent call last): File "", line 1, in File "range.py", line 72, in ....[asyncio.run(main(client))] File "uasyncio/core.py", line 1, in run File "uasyncio/core.py", line 1, in run_until_complete File "uasyncio/core.py", line 1, in run_until_complete File "range.py", line 48, in main .....[await client.connect()] File "mqtt_as.py", line 541, in connect File "mqtt_as.py", line 236, in _connect AttributeError: 'MQTTClient' object has no attribute '_as_write'

It also happens with range_ex.py Also, the credentials for the broker are hardwired within the lib.

Hamsanger commented 1 year ago

This is related to issue #83 - the last commit commit 166771f removed the def _as_write() in error. If you have a version of the mqtt_as library prior to that you should be able to continue working until the _as_write() func definition is reinstated.

peterhinch commented 1 year ago

This should now be fixed, please grab the latest code.