Closed rdagger closed 4 days ago
It's a while since I've run the S2 so I re-tested in case a firmware release had caused a regression. I did the following on a UM FeatherS2. Testing was done using mpremote.
range_ex.py
demo and verified that publications were being received.The connection recovered correctly and publications resumed.
Your code looks fine. At the moment I'm stumped as to why it's not working for you.
Thanks for your response! I'll do some more debugging.
It was my fault. I was connecting to the Wi-Fi in my main.py before running mqtt_as which worked, but I had a typo in config['wifi_pw']
.
My code is running now and recovering from both Wi-Fi and broker interruptions.
Thanks for the great project!
I created a simple test using the example code to publish and subscribe. It works. However, I simulated a WIFI disconnection by power cycling my access point and the MQTT client just got stuck and never recovered. I also tried restarting my MQTT broker and again the client just got stuck and never recovered. Here's my sample code using a QT PY ESP32-S2 running ESP32_GENERIC_S2-20240602-v1.23.0.