peterhinch / micropython-mqtt

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

Ok this is weird, can connect to broker, but subscription does not trigger callback and publish never happens? #87

Closed Jibun-no-Kage closed 1 year ago

Jibun-no-Kage commented 1 year ago

Ok this is weird, can connect to broker, but subscription does not trigger callback and publish does not seem to ever get to broker?

I know that the connection to the broker happens because I see the pico w device connect to the broker, via the broker log. But I never see my subscription received/accepted by the broker, nor do I see any publish received by the broker.

With mqtt simple I was able to publish.

This is odd because my Node Red instance is working fine with the same broker, and my other straight python scripts are working with the same broker. The broker accepts anonymous connections, so I believe there is no security issues.

Using the mosquito client CLI can subscribe and publish just fine.

Color me confused!

Jibun-no-Kage commented 1 year ago

Ok, now things are making a bit more sense. Some weird caching was happening. So I tested with a cut down version of the clean sample script, and it is working.