# MQTT not working

**URL:** <https://community.garadget.com/t/mqtt-not-working/8284>\
**Category:** Device Setup\
**Created:** [April 9, 2021, 4:40am UTC](https://community.garadget.com/t/mqtt-not-working/8284 "2021-04-09T04:40:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paqito](https://community.garadget.com/letter_avatar_proxy/v4/letter/p/41988e/32.png) [@paqito](https://community.garadget.com/u/paqito)\
**Post date:** [April 9, 2021, 4:40am UTC](https://community.garadget.com/t/mqtt-not-working/8284/1 "2021-04-09T04:40:47Z")

</div>

I have setup Garadget with Cloud + MQTT. The cloud portion works fine, but MQTT is not able to send messages to my MQTT broker.

I’m using home assistant and have MQTT (mosquitto) installed.  
My MQTT configuration is:

> [@](#):
>
> ```
> logins:
> - username: homeassistant
> password: xxxxxx
> anonymous: true (but i'd prefer false here, tried both)
> customize:
> active: false
> folder: mosquitto
> certfile: fullchain.pem
> keyfile: privkey.pem
> require_certificate: false (but i'd prefer true here, tried both) 
> 
> ```

In the web setup of garagdet:

> [@](#):
>
> ID: xxxxx  
> System: 2.0.1  
> Firmware: 1.24  
> Wifi: (mywify)  
> Password: xxxxx  
> MQTT Mode: “MQTT + Cloud”  
> Broker IP: (IP of my home assistant instance)  
> Broker Port: 1883  
> Device Topic Id: garage\_door  
> Login: homeassistant (I’ve also tried it blank)  
> Password: xxxxxx  
> Sensor setttings… etc.

In the logs for MQTT broker:

> [@](#):
>
> ```
> 1617942068: New connection from 192.168.1.141 on port 1883.
> 1617942068: Socket error on client <unknown>, disconnecting.
> 1617942074: New connection from 192.168.1.141 on port 1883.
> 1617942074: Socket error on client <unknown>, disconnecting.
> 1617942080: New connection from 192.168.1.141 on port 1883.
> 1617942080: Socket error on client <unknown>, disconnecting.
> 1617942086: New connection from 192.168.1.141 on port 1883.
> ....ad nauseum (141 is my garadget IP)
> No matter my configuration, these seem to pop up very quickly.
> 
> ```

I am able to send to my MQTT broker through other clients, though I dont have any MQTT devices other than garadget at this point.

I’ve seen several posts surrounding Mosquitto upgrading to TLS. Could this be my problem? Does that mean that MQTT doesnt work for anyone using Mosquitto? that doesnt quite seem possible.

I’ve been the rounds with this and have run out of things to try. Can you offer suggestions?

---

<div class="post-metadata">

**Author:** ![paqito](https://community.garadget.com/letter_avatar_proxy/v4/letter/p/41988e/32.png) [@paqito](https://community.garadget.com/u/paqito)\
**Post date:** [April 12, 2021, 2:08am UTC](https://community.garadget.com/t/mqtt-not-working/8284/2 "2021-04-12T02:08:59Z")

</div>

So, as has been suggested by other posts that have this “Socket error on client” error, my problem was authentication.

I could not get the logins section of MQTT to function at all. My garadget would not use the username and password I had added there. Or rather, when using that user and pass, MQTT would not authenticate them.  
I also couldnt get it to use users I’d added to HA. I did however get it working using the admin login of HA. Not ideal, but its working for now.
