Publish to HiveMQ Cloud with Raspberry Pi Pico and CircuitPython

I’m following this approach

The connection seems to succeed as the “connected” method is called, but publishing doesn’t work. Any ideas?

Connecting to AP...
Connected to XXX RSSI: -67
Ping google.com: 20 ms
Connecting to MQTT Host...
Connected to MQTT Broker!
MQTT publish Failed, retrying
 Timed out
MQTT publish Failed, retrying
 Timed out

OK my mistake, the error is not in the mqtt code but the sensor readout…
Why does one always discover such an error after posting the question on a forum?! :wink:

1 Like