I tried to get MQTT working (I have a working homeassistant / mosquitto / zigbee2mqtt setup), but so far failed.
It always fails at mqttClient.connect(...) and the error code is -1 (TIMEOUT) - takes 30s.
I found one bug in the original code: it tried to convert "1883" to integer using (int)mqtt_port, that didn't work. After I fixed that, I at least saw a connection in mosquitto logs. But it somehow sits there for 30s in .connect() and then the client closes the connection, for yet unknown reasons.
I tried to get MQTT working (I have a working homeassistant / mosquitto / zigbee2mqtt setup), but so far failed.
It always fails at
mqttClient.connect(...)
and the error code is -1 (TIMEOUT) - takes 30s.I found one bug in the original code: it tried to convert "1883" to integer using
(int)mqtt_port
, that didn't work. After I fixed that, I at least saw a connection in mosquitto logs. But it somehow sits there for 30s in.connect()
and then the client closes the connection, for yet unknown reasons.