HeimdallMidgard / ESP-32-BLE-Scanner

ESP 32 BLE Scanner for Home Assistant to report Room Presence
GNU General Public License v3.0
38 stars 7 forks source link

MQTT connection issue #2

Closed andriensis closed 3 years ago

andriensis commented 3 years ago

Hey there.

I'm having some trouble setting up my ESP. It looks like the MQTT connection to my MQTT server is not working. These are the logs I receive:

Name: Oneplus Id: e7138f4c-8029-4099-9742-aca178dd6469 Distance: 2.233418 TX Power: -59 RSSI: -92 Error publishing MQTT Message Name: Oneplus Id: e7138f4c-8029-4099-9742-aca178dd6469 Distance: 1.581139 TX Power: -59 RSSI: -89 Error publishing MQTT Message Name: Oneplus Id: e7138f4c-8029-4099-9742-aca178dd6469 Distance: 1.581139 TX Power: -59 RSSI: -89 Error publishing MQTT Message Starting... Connecting to MQTT... Disconnected from MQTT. Error publishing MQTT Message Starting to Scan... Connecting to MQTT... Starting... Connecting to MQTT... Disconnected from MQTT. Error publishing MQTT Message Starting to Scan... Name: Oneplus Id: e7138f4c-8029-4099-9742-aca178dd6469 Distance: 1.255943 TX Power: -59 RSSI: -87 Error publishing MQTT Message Connecting to MQTT...

And these are the logs I receive on my MQTT server:

1629037506: New connection from 192.168.1.202 on port 1883. 1629037506: Socket error on client , disconnecting.

The MQTT connection is working both on other integrations on my home assistant instance as well as an MQTT client. Here are the server logs for a "successful" authentication:

1629037484: New connection from 192.168.1.4 on port 1883. 1629037484: New client connected from 192.168.1.4 as mqtt-explorer-67af55e6 (p2, c1, k60, u'REDACTED').

HeimdallMidgard commented 3 years ago

Hey, first thanks for using my little program.

I am at the moment in holiday so I don't got my working env around. Which broker are you using and which MQTT settings in the ESP32 and the broker?

andriensis commented 3 years ago

Hi. Thanks!

Broker is mosquito MQTT settings as follows

Screenshot_20210815-191800

And mosquito settings

Screenshot 2021-08-15 at 20 04 02
andriensis commented 3 years ago

Hey there. It looks like it was a problem related to my router and its DHCP settings.

I have successfully fixed it!

HeimdallMidgard commented 3 years ago

Awesome :)