From 0a55298febb75d006b9bdb6b3f2e114fad2ffebd Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 28 Sep 2016 23:19:12 +0200 Subject: [PATCH] Add option to disable SSL it disable mqtts but save ~50ko --- WifiControlSensor/MQTT.ino | 2 ++ WifiControlSensor/config_device.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/WifiControlSensor/MQTT.ino b/WifiControlSensor/MQTT.ino index c3737e8..b0d591e 100644 --- a/WifiControlSensor/MQTT.ino +++ b/WifiControlSensor/MQTT.ino @@ -45,9 +45,11 @@ int MqttSetup(char *server, char *user, char *passwd, int port, char *hostname) if(!isMqttConfigured) return 0; +#ifndef CONFIG_DISABLE_SSL if(useMqtts) mqtt = new Adafruit_MQTT_Client(new WiFiClientSecure(), server, port, user, passwd); else +#endif mqtt = new Adafruit_MQTT_Client(new WiFiClient(), server, port, user, passwd); mqtt_dht_temp = MqttCreatePublisher(TEMPERATURE_DHT_FEED_FORMAT, user, mqttId); diff --git a/WifiControlSensor/config_device.h b/WifiControlSensor/config_device.h index 90a1162..8cf46d0 100644 --- a/WifiControlSensor/config_device.h +++ b/WifiControlSensor/config_device.h @@ -6,6 +6,9 @@ // Switch Serial console on gpio 13 and 15 (So you can use GPIO 1 and 3 for other things) //#define CONFIG_ENABLE_EXTRA_GPIO +// Disable SSL (so mqtts) to save some place (~52ko) +//#define CONFIG_DISABLE_SSL + // Enable the temperatue and pressure Sensor BMP180 // (CONFIG_BMP180_SDA and CONFIG_BMP180_SDA should be defined as well) #define CONFIG_ENABLE_BMP180