# Publish to HiveMQ Cloud with Raspberry Pi Pico and CircuitPython

**URL:** <https://community.hivemq.com/t/publish-to-hivemq-cloud-with-raspberry-pi-pico-and-circuitpython/841>\
**Category:** HiveMQ Cloud\
**Created:** [November 26, 2021, 12:08pm UTC](https://community.hivemq.com/t/publish-to-hivemq-cloud-with-raspberry-pi-pico-and-circuitpython/841 "2021-11-26T12:08:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@frank](https://community.hivemq.com/u/frank)\
**Post date:** [November 26, 2021, 12:08pm UTC](https://community.hivemq.com/t/publish-to-hivemq-cloud-with-raspberry-pi-pico-and-circuitpython/841/1 "2021-11-26T12:08:34Z")

</div>

I’m following this approach

> **[MQTT in CircuitPython](https://learn.adafruit.com/mqtt-in-circuitpython/connecting-to-a-mqtt-broker)**
>
> Do you have a CircuitPython project and want to connect it to the internet? Consider MQTT - an extremely popular and lightweight protocol which can connect your project to the internet and quickly process network events. In this guide, you will set...

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![frank](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@frank](https://community.hivemq.com/u/frank)\
**Post date:** [November 26, 2021, 12:24pm UTC](https://community.hivemq.com/t/publish-to-hivemq-cloud-with-raspberry-pi-pico-and-circuitpython/841/3 "2021-11-26T12:24:02Z")

</div>

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?! 😉
