OpenZWave / qt-openzwave

QT5 Wrapper for OpenZWave
GNU Lesser General Public License v3.0
105 stars 30 forks source link

Unable to Connect to MQTT Server #163

Closed marleyjaffe closed 3 years ago

marleyjaffe commented 3 years ago

I am trying to run this container using docker-compose on a remote raspberry-pi. MQTT server on a different Docker server is working and connected to HomeAssistant. I am running my MQTT server with the default 1883 port. I am able to successfully telnet to port 1883 of the MQTT server from the host pi, but am unable to get the container to connect to the MQTT server. Below is my docker-compose and the repeating section of my logs. I have tried both the allinone as well as the standalone container, both are having the same issue.

The thing I don't understand (and likely where the issue is stemming from) is why the 1883 port isn't included in any documentation since it needs external communications to my MQTT server. I've tried adding and removing this port from my docker compose with no differing results.

version: '3'
services:
  # Standalone Image
  ozwd:
    image: openzwave/ozwdaemon:latest
    container_name: "ozwd"
    #     security_opt:
    #      - seccomp:unconfined
    devices:
      - "/dev/ttyUSB0"
    volumes:
      - "~/docker/openzwave/ozw:/opt/ozw/config"
    ports:
      - "1983:1983" #ozw-admin port
      - "1883:1883" #MQTT Comms Port
    environment:
      MQTT_SERVER: "CattHouse-Mini.local"
      #      MQTT_USERNAME: "my-username"
      #      MQTT_PASSWORD: "my-password"
      #      USB_PATH: "/dev/zwave"
      USB_PATH: "/dev/ttyUSB0"
      #      OZW_NETWORK_KEY: "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00"
    restart: unless-stopped

  #All-In-One Container
  ozwd-all:
    image: openzwave/ozwdaemon:allinone-latest
    container_name: "ozwd-all"
    #     security_opt:
    #      - seccomp:unconfined
    devices:
      - "/dev/ttyUSB0"
    volumes:
      - "~/docker/openzwave/ozw:/opt/ozw/config"
    ports:
      - "1983:1983" #ozw-admin port
      - "5901:5901" #VLC Port for remote client
      - "7800:7800" #Web Based VLC Port
      # - "1883:1883" #MQTT Comms Port
    environment:
      MQTT_SERVER: "CattHouse-Mini.local"
      #      MQTT_USERNAME: "my-username"
      #      MQTT_PASSWORD: "my-password"
      #      USB_PATH: "/dev/zwave"
      USB_PATH: "/dev/ttyUSB0"
      #      OZW_NETWORK_KEY: "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00"
    restart: unless-stopped

LOGS:

2020-09-18T01:26:27.742447350Z [fix-attrs.d] applying ownership & permissions fixes...
2020-09-18T01:26:27.745630933Z [fix-attrs.d] ozw-logs: applying...
2020-09-18T01:26:27.904898151Z [fix-attrs.d] ozw-logs: exited 0.
2020-09-18T01:26:27.906864687Z [fix-attrs.d] done.
2020-09-18T01:26:27.908787993Z [cont-init.d] executing container initialization scripts...
2020-09-18T01:26:27.911870273Z [cont-init.d] ozw-logs: executing...
2020-09-18T01:26:27.928079389Z [cont-init.d] ozw-logs: exited 0.
2020-09-18T01:26:27.930106394Z [cont-init.d] done.
2020-09-18T01:26:27.932008762Z [services.d] starting services
2020-09-18T01:26:27.950736869Z [services.d] done.
2020-09-18T01:26:27.957770138Z [ozwdaemon]: Setting Up.....
2020-09-18T01:26:27.965228411Z [ozwdaemon]:
2020-09-18T01:26:27.972180949Z [ozwdaemon]: ========================================================================
2020-09-18T01:26:27.979376980Z [ozwdaemon]: Detailed Logging is available in the logs directory of the mapped volume
2020-09-18T01:26:27.986538531Z [ozwdaemon]: ========================================================================
2020-09-18T01:26:27.993442422Z [ozwdaemon]:
2020-09-18T01:26:28.001700081Z [ozwdaemon]: Waiting until the MQTT broker at CattHouse-Mini.local:1883 is available...
2020-09-18T01:26:58.020244039Z [ozwdaemon]: Could not connect to the MQTT broker after 30 seconds
2020-09-18T01:26:58.025675565Z [ozwdaemon]: Exited with Status Code 253
2020-09-18T01:26:58.029407800Z [ozwdaemon]: Shutting Down Container
2020-09-18T01:26:58.054141339Z [cont-finish.d] executing container finish scripts...
2020-09-18T01:26:58.058385351Z [cont-finish.d] done.
2020-09-18T01:26:58.060001830Z [s6-finish] waiting for services.
2020-09-18T01:26:58.276758769Z [s6-finish] sending all processes the TERM signal.
2020-09-18T01:27:01.290477183Z [s6-finish] sending all processes the KILL signal and exiting.
marleyjaffe commented 3 years ago

I'm using a HUSBZB-1 ZWave dongle BTW

marleyjaffe commented 3 years ago

Looks like it was a DNS issue. Things are working now that I've switched to the IP address of my main docker server.