From cb1366284c0ce1da000b6b5819fa65aa9edd5db2 Mon Sep 17 00:00:00 2001
From: Eric Duminil <eric.duminil@gmail.com>
Date: Sat, 5 Jun 2021 23:55:32 +0200
Subject: [PATCH] Board firmware update broke ESP32 MQTT

---
 ampel-firmware/mqtt.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ampel-firmware/mqtt.cpp b/ampel-firmware/mqtt.cpp
index cb0c501..8c61696 100644
--- a/ampel-firmware/mqtt.cpp
+++ b/ampel-firmware/mqtt.cpp
@@ -30,10 +30,9 @@ namespace mqtt {
   void initialize(const char *sensorId) {
     json_sensor_format = PSTR("{\"time\":\"%s\", \"co2\":%d, \"temp\":%.1f, \"rh\":%.1f}");
     snprintf(publish_topic, sizeof(publish_topic), "CO2sensors/%s", sensorId);
-#if defined(ESP8266)
-    espClient.setInsecure(); // Sorry, we don't want to flash the sensors every 3 months.
-#endif
-    // mqttClient.setSocketTimeout(config::mqtt_timeout); //NOTE: somehow doesn't seem to have any effect on connect()
+    // The sensor doesn't check the fingerprint of the MQTT broker, because otherwise this fingerprint should be updated
+    // on the sensor every 3 months. The connection can still be encrypted, though:
+    espClient.setInsecure(); // If not available for ESP32, please update Arduino IDE / PlatformIO
     mqttClient.setServer(config::mqtt_server, config::mqtt_port);
 
     sensor_console::defineIntCommand("mqtt", setMQTTinterval, F("60 (Sets MQTT sending interval, in s)"));
-- 
GitLab