# Working sample with Esp8266 and hivemq

**URL:** <https://community.hivemq.com/t/working-sample-with-esp8266-and-hivemq/1744>\
**Category:** HiveMQ Community Edition\
**Created:** [January 8, 2023, 9:03am UTC](https://community.hivemq.com/t/working-sample-with-esp8266-and-hivemq/1744 "2023-01-08T09:03:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/vlad/32/544_2.png) [@Vlad](https://community.hivemq.com/u/Vlad)\
**Post date:** [January 8, 2023, 9:03am UTC](https://community.hivemq.com/t/working-sample-with-esp8266-and-hivemq/1744/1 "2023-01-08T09:03:26Z")

</div>

Hi!  
I recently started working on a project in which to implement the control of a device using the mqtt protocol.  
I chose HiveMQ because I liked the clear and intuitive interface for configuring a mqtt broker.  
I tried using the adafruit mqtt library, inspired by [this topic](https://community.hivemq.com/t/arduino-example-with-server-signed-certificate/502), but no success.  
File adapted from example:  
[https://github.com/adafruit/Adafruit\_MQTT\_Library/blob/master/examples/adafruitio\_secure\_esp8266/adafruitio\_secure\_esp8266.ino](https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/examples/adafruitio_secure_esp8266/adafruitio_secure_esp8266.ino)  
I got error: Connecting to MQTT… Connection failed

I mention that I took the login data from the HiveMQ configuration console, and the fingerprint from the browser connected to the same console. What am I doing wrong?  
Does anyone have a basic example for using a mqtt broker with the esp8266? What library works? Is it possible for the esp8266 to use a certificate instead of the inconvenient fingerprint solution?

---

<div class="post-metadata">

**Author:** ![Vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/vlad/32/544_2.png) [@Vlad](https://community.hivemq.com/u/Vlad)\
**Post date:** [January 9, 2023, 8:16pm UTC](https://community.hivemq.com/t/working-sample-with-esp8266-and-hivemq/1744/2 "2023-01-09T20:16:38Z")

</div>

Does anyone have any suggestions?

---

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://community.hivemq.com/u/Mike)\
**Post date:** [January 16, 2023, 3:22pm UTC](https://community.hivemq.com/t/working-sample-with-esp8266-and-hivemq/1744/3 "2023-01-16T15:22:56Z")

</div>

have you tried with an ESP32?

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [January 23, 2023, 11:06am UTC](https://community.hivemq.com/t/working-sample-with-esp8266-and-hivemq/1744/4 "2023-01-23T11:06:44Z")

</div>

Hi @Vlad ,

Great to see your interest in MQTT and HiveMQ, welcome to the community!

Please refer to the HiveMQ Cloud’s [Getting started with Arduino ESP8266](https://console.hivemq.cloud/clients/arduino-esp8266) guide.

I hope this helps.  
Kind regards,  
Dasha from HiveMQ Team
