gcgarner / IOTstack

docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.5k stars 578 forks source link

zigbee2mqttassistant not connecting to mosquitto: Name or service not known #223

Open Daneild opened 3 years ago

Daneild commented 3 years ago

Hi, Raspberry 3, fresh install, i have found an issue and a solution, zigbee2mqttassistant is not able to connect to mosquitto due to fact thas is not in the same network,

Application started. Press Ctrl+C to shut down. warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0] Unable to connect to MQTT server mosquitto. MQTTnet.Exceptions.MqttCommunicationException: Name or service not known ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name or service not known

i have edited docker-compose.yal and add:

networks:
    - iotstack_nw

After that docker-compose up -d and all was ok.

I post here maybe will be and update on file IOTstack/.templates/zigbee2mqttassistant/service.yml

  zigbee2mqttassistant:
    container_name: zigbee2mqttassistant
    image: carldebilly/zigbee2mqttassistant
    restart: unless-stopped
    env_file:
      - ./services/zigbee2mqttassistant/zigbee2mqttassistant.env
    ports:
      - 8880:80
    environment:
      - VIRTUAL_HOST=~^zigbee2mqttassistant\..*\.xip\.io
      - VIRTUAL_PORT=8880
    **networks:
    - iotstack_nw**

Maybe i am right, maybe not, but at least if someone will have the same issue, will find here an answer :)

SensorsIot commented 2 years ago

This repo is dead. Maybe you go to https://github.com/SensorsIot/IOTstack