Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Cannot connect to mosquitto mqtt running as HA addon #18

Open
evlo opened this issue Nov 5, 2022 · 7 comments
Open

Cannot connect to mosquitto mqtt running as HA addon #18

evlo opened this issue Nov 5, 2022 · 7 comments
Labels
question Further information is requested

Comments

@evlo
Copy link

evlo commented Nov 5, 2022

I'm trying to have zigstar GW connect to mosquitto MQTT server running as HA addon (HA supervised) and getting these errors

2022-09-07 22:23:49: Client <unknown> disconnected, not authorised.
2022-09-07 22:24:34: New connection from on port 1883.

I tried these settings
(password is from home assistant integration where it says core-mosquitto etc.)
image

and also
image

while having config like this
image

zigbee2mqtt connects and communicates no problem whatsoever

mercenaruss/zigstar_gateways#20

Any ideas why it does not connect?

@evlo
Copy link
Author

evlo commented Nov 5, 2022

Update: I figured out that if I use 192.168.50.20 instead of homeassistant.local it does connect, but only if 192.168.50.20 os same subnet as zigstargw, if i have server on 192.168.51.20 it does not connect.

@xyzroe
Copy link
Owner

xyzroe commented Nov 5, 2022

I would recommend checking the connection to MQTT broker using some other software. For example MQTT Explorer.

When you understand what credentials and server address you should use for authorization, then we will try with Zigstar.

@xyzroe
Copy link
Owner

xyzroe commented Nov 5, 2022

Update: I figured out that if I use 192.168.50.20 instead of homeassistant.local it does connect, but only if 192.168.50.20 os same subnet as zigstargw, if i have server on 192.168.51.20 it does not connect.

Well, of course. You are probably using the /24 subnet

@evlo
Copy link
Author

evlo commented Nov 5, 2022

image
with mqtt explorer it does work even when using homeassistant.local as "Server IP", but it does say IP anyways.

regarding 192.168.51.20 - normal z2m running on 192.168.51.20 was able to connect to zigstarGW ok, but only the mqtt connection to 192.168.51.20 did not work - mosquitto broker was/is running on the same ip, but maybe that is some mqtt thing and it does not work over subnets?

@xyzroe
Copy link
Owner

xyzroe commented Nov 18, 2022

with mqtt explorer it does work even when using homeassistant.local as "Server IP", but it does say IP anyways.

This is because your PC support mDNS ("*.local) but ZigStar doesn't. You must specify exactly IP address of your mqtt broker.

regarding 192.168.51.20 - normal z2m running on 192.168.51.20 was able to connect to zigstarGW ok, but only the mqtt connection to 192.168.51.20 did not work - mosquitto broker was/is running on the same ip, but maybe that is some mqtt thing and it does not work over subnets?

This is because when z2m connecting to ZigStar connection going from z2m add-on to ZigStar. And docker doesn't block this connection. But when you trying to connect ZigStar with mqtt broker, connection goes from ZigStar to mqtt broker. So you need to specify you docker's physical network IP, not virtual one that used for communicating between add-ons.

@evlo By and large, your questions are more about the work of networks, home assistant, mqtt and so on than ZigStar.

@xyzroe xyzroe added the question Further information is requested label Nov 19, 2022
@alexbocman
Copy link

alexbocman commented Mar 8, 2023

Actually, I've got the same issue. It's not possible to establish connection to mosquitto mqtt running as HA addon.

I'm using SLS via Mosquitto Broker add-on and ZigStar GW via zigbee2mqtt.
Tried to connect ZigStarGW to HA via mqtt with the same settings as SLS (SLS had been switched off during trial) in order to get control for ZigStarGW, but there's no mqtt connection as you can see on the picture.
image
image

MQTT Mosquitto has the following settings:
image

Logs:
image

@alexbocman
Copy link

alexbocman commented Mar 8, 2023

The issue is solved by adding a new user to Mosquitto broker Add-On Configuration:

image
image

By the way the SLS is still working with an old credentials which had been set in Mosquitto integration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants