dkjonas / Wavin-AHC-9000-mqtt

Esp8266 mqtt interface for Wavin AHC-9000/Jablotron AC-116
MIT License
82 stars 35 forks source link

Best way to trace if it's not working #9

Closed projectraam closed 5 years ago

projectraam commented 5 years ago

I now have the board and everything seems to be connected as described. It's connecting to the wifi and I can ping the IP, but it does not connect to the broker..

I have also tried to flash the nocemcu again.

What is the best way to trace where the problem is?

Note. The logs was cleared on restart so cant provide the full log.

projectraam commented 5 years ago

I am using homeassistant and the plugin "MQTT Server & Web client", the config for that looks like this:

{
  "log_level": "info",
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "web": {
    "enabled": true,
    "ssl": false
  },
  "broker": {
    "enabled": true,
    "enable_ws": false,
    "enable_mqtt": true,
    "enable_ws_ssl": false,
    "enable_mqtt_ssl": false,
    "allow_anonymous": false
  },
  "mqttusers": [
    {
      "username": "username",
      "password": "password",
      "readonly": false,
      "topics": [
        "#"
      ]
    }
  ]
}
dkjonas commented 5 years ago

I don't know the "MQTT Server & Web client" component. I use mosquitto as my broker, so I do not know if the config above is correct. Can you connect to mqtt using another client - just to make sure the server is working?

projectraam commented 5 years ago

I am able to connect to the MQTT server via another client and it shows up in the logs

1553197105: New connection from 192.168.110.32 on port 1883. 1553197105: New client connected from 192.168.110.32

I have some Sonoff switches connected to my MQTT server and they connect to hassio.local:1883 In my PrivateConfig.h I have the following: const String MQTT_SERVER = "hassio.local:1883"; // mqtt server

dkjonas commented 5 years ago

Try without the port number in the address: const String MQTT_SERVER = "hassio.local"; // mqtt server

Port is defined in main.cpp: const uint16_t MQTT_PORT = 1883; // mqtt port

projectraam commented 5 years ago

That did the job, thanks a lot for quick help 👍