Closed wisekki closed 4 years ago
Looks like you put the port in the server name setting. The port is a different setting.
Okay well it does not work only with 192.168.1.1 or localhost (or firewall that is on my hosts). Does it require port number by default?
from the Zigbee2MqttAssistant docker I can ping 192.168.1.1 so it works.
Is your MQTT broker installed on the same docker? If yes, you should just put the name of the other container :-).
Nope.. mqtt is not on a docker.. it's running directly on 192.168.1.1 :)
Same problem ; Application started. Press Ctrl+C to shut down. warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0] Unable to connect to MQTT server mqtt://192.168.2.16. MQTTnet.Exceptions.MqttCommunicationException: Name does not resolve
You should read the doc... don't put the mqtt://
at the beginning of the broker address.
At the moment it does not matter what we (at least me) put on the broker address.. Everything says "Unable to connect" and i've tried every combination i can think of.. :( And mqtt broker works from other dockers.
Same here. Whatever I try as mqtt ip address, does not seem to work. I'm running hassio (now called home assistant) 0.105.1 and the officail mosquitto add-on. I just tried now 172.30.33.0 because I'm running out of options but it did not work either
~ $ nslookup core-mosquitto
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: core-mosquitto
Address: 172.30.33.0
Starting Zigbee2MqttAssistant v0.3.133+Branch.master.Sha.f490bd70a0401bc6d96a4d02d5f9022a43bb5e9e...
Hosting environment: Production
Content root path: /app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0]
Unable to connect to MQTT server 172.30.33.0.
any help would be most appreciated.
thanks
Same problem here, zigbee2mqttassistant running in docker and external (not in docker) mqtt server (mosquitto).
Application started. Press Ctrl+C to shut down.
warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0]
Unable to connect to MQTT server 192.168.1.105.
MQTTnet.Exceptions.MqttCommunicationException: Connection reset by peer
---> System.Net.Sockets.SocketException (104): Connection reset by peer
--- End of inner exception stack trace ---
at MQTTnet.Adapter.MqttChannelAdapter.WrapException(Exception exception)
at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(IMqttClientOptions options, CancellationToken cancellationToken)
And on 192.168.1.105 with tcpdump there is no attempt to connect
Ok I found the problem in my configuration: I needed to set Z2MA_SETTINGS__MQTTSECURE=false (to use mqtt on port 1883), after this change of configuration everything works
Ok I found the problem in my configuration: I needed to set Z2MA_SETTINGS__MQTTSECURE=false (to use mqtt on port 1883), after this change of configuration everything works
@mvivaldi you got me. What is that? I see in the documentation a reference to environmental variables. I have no idea what that is about. Could you explain?
I'm using this as hass.io addon and when I added "mqttsecure: false" to the config it didn't help. (Maybe it's some other param?) Still I get:
warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0] Unable to connect to MQTT server 192.168.1.1. MQTTnet.Exceptions.MqttCommunicationException: Cannot access a disposed object.
I set the port and the mqttsecure parameter in my docker compose file:
version: '3'
services:
zigbee2mqttAssistant:
image: carldebilly/zigbee2mqttassistant:dev
container_name: zigbee2mqttAssistant
environment:
- Z2MA_SETTINGS__MQTTSERVER=mymqttserver
- Z2MA_SETTINGS__MQTTUSERNAME=myusername
- Z2MA_SETTINGS__MQTTPASSWORD=mypassword
- Z2MA_SETTINGS__MQTTPORT=1883
- Z2MA_SETTINGS__MQTTSECURE=false
# Set to your TimeZone when using on Linux https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# Won't work if you're using the Windows version of the container
- TZ=Europe/Rome
ports:
- 8880:80
restart: unless-stopped
I set the port and the mqttsecure parameter in my docker compose file:
version: '3' services: zigbee2mqttAssistant: image: carldebilly/zigbee2mqttassistant:dev container_name: zigbee2mqttAssistant environment: - Z2MA_SETTINGS__MQTTSERVER=mymqttserver - Z2MA_SETTINGS__MQTTUSERNAME=myusername - Z2MA_SETTINGS__MQTTPASSWORD=mypassword - Z2MA_SETTINGS__MQTTPORT=1883 - Z2MA_SETTINGS__MQTTSECURE=false # Set to your TimeZone when using on Linux https://en.wikipedia.org/wiki/List_of_tz_database_time_zones # Won't work if you're using the Windows version of the container - TZ=Europe/Rome ports: - 8880:80 restart: unless-stopped
Mmm this does not sound much like hassio, does it?
sorry for the late reply, in my case is not hassio, but a simple docker container.
From previous issues I can concluded that all are up and running for now. Closing this and referring to #216 at the moment
This just causes an exception for me:
Unhandled exception. System.InvalidOperationException: Failed to convert configuration value at 'settings:MqttSecure' to type 'Zigbee2MqttAssistant.Models.TlsMode'.
Also Unhandled exception. System.InvalidOperationException: Failed to convert configuration value at 'settings:MqttPort' to type 'System.UInt16'.
My goodness, adding " around the parameters such as:
- Z2MA_SETTINGS__MQTTSERVER="192.168.1.4"
seems to cause this entire connection problem!
Just installed the Zigbee2MqttAssistant as hassio add-on and configured the credentials but the log says:
I'm running mqtt server at 192.168.1.1:1883 but for some reason the Zigbee2MqttAssistant docker is unable to access that address. I've tried the configuration with and without the port number. Also localhost or any other name pointed to that address does not work.