davidkreidler / OpenCO2_Sensor

Arduino Repository for an E-Ink CO2 Sensor using ESP32 and SCD4X
https://www.tindie.com/products/davidkreidler/open-co2-sensor/
MIT License
97 stars 5 forks source link

WIP: trying to fix MQTT #17

Open ThomasWaldmann opened 4 months ago

ThomasWaldmann commented 4 months ago

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.