diff --git a/platformio.ini b/platformio.ini index 252e4b700..50435559c 100755 --- a/platformio.ini +++ b/platformio.ini @@ -103,8 +103,6 @@ build_flags = ${esp82xx_defaults.build_flags} -DBEARSSL_SSL_BASIC ; nonos-sdk 22x -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x -; if you compile for AWS IoT, you should set MQTT keep alive to at least 30s instead of 10s, include is required here for PubSubClient lib - -DMQTT_KEEPALIVE=30 ; nonos-sdk-pre-v3 ; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 ; lwIP 1.4 diff --git a/sonoff/WiFiClientSecureLightBearSSL.cpp b/sonoff/WiFiClientSecureLightBearSSL.cpp index 34e0ad14e..ac881c599 100644 --- a/sonoff/WiFiClientSecureLightBearSSL.cpp +++ b/sonoff/WiFiClientSecureLightBearSSL.cpp @@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#ifdef ARDUINO_ESP8266_RELEASE_2_5_2 + #define LWIP_INTERNAL #include @@ -880,3 +883,5 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) { } }; + +#endif // ARDUINO_ESP8266_RELEASE_2_5_2 \ No newline at end of file diff --git a/sonoff/WiFiClientSecureLightBearSSL.h b/sonoff/WiFiClientSecureLightBearSSL.h index 719339310..c63392c04 100644 --- a/sonoff/WiFiClientSecureLightBearSSL.h +++ b/sonoff/WiFiClientSecureLightBearSSL.h @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#ifdef ARDUINO_ESP8266_RELEASE_2_5_2 #ifndef wificlientlightbearssl_h #define wificlientlightbearssl_h @@ -146,3 +148,5 @@ class WiFiClientSecure_light : public WiFiClient { }; #endif + +#endif // ARDUINO_ESP8266_RELEASE_2_5_2 \ No newline at end of file diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 47591b6e9..6229fdaa1 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,6 +1,7 @@ /* * 6.5.0.15 20190606 * Change pubsubclient MQTT_KEEPALIVE from 10 to 30 seconds in preparation of AWS IoT support + * Add support for AWS IoT with TLS 1.2 on core 2.5.2. Full doc here: https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT * * 6.5.0.14 20190602 * Change webserver HTML input, button, textarea, and select name based on id @@ -8,7 +9,6 @@ * Fix PZem startup issue (#5875) * Add command SetOption39 1..255 to control CSE7766 (Pow R2) or HLW8032 (Blitzwolf SHP5) handling of power loads below 6W. Default setting is 128 (#5756) * Add Toggle functionality to button double press when more devices are detected - * Add support for AWS IoT with TLS 1.2. Full doc here: https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT * * 6.5.0.13 20190527 * Add command SetOption38 6..255 to set IRReceive protocol detection sensitivity mimizing UNKNOWN protocols (#5853) diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index ff542b7a6..42cb07c54 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -267,7 +267,7 @@ //#define USE_MQTT_TLS // Use TLS for MQTT connection (+53k code, +15k mem) // #define USE_MQTT_TLS_CA_CERT // Use LetsEncrypt Certificate from sonoff_letsencrypt.h - Not supported with core 2.3.0 -// -- MQTT - Special version for AWS IoT +// -- MQTT - Special version for AWS IoT on core 2.5.2 only //#define USE_MQTT_AWS_IOT // Enable MQTT for AWS IoT - requires a private key (+56.7k code, +6.0k mem and +6.6k additional during connection handshake) // you need to generate a private key + certificate per device // and update 'sonoff/sonoff_aws_iot.cpp' @@ -487,10 +487,4 @@ #error "Select either USE_DISCOVERY or USE_MQTT_AWS_IOT, mDNS takes too much code space and is not needed for AWS IoT" #endif - -#if defined(USE_MQTT_TLS) || defined(USE_MQTT_AWS_IOT) - #undef WEB_LOG_SIZE - #define WEB_LOG_SIZE (2000) // reduce log buffer size when using TLS -#endif - #endif // _MY_USER_CONFIG_H_ diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 1eaedd5f1..0839b15ca 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -46,7 +46,7 @@ void KNX_CB_Action(message_t const &msg, void *arg); * Default global defines \*********************************************************************************************/ -#ifdef USE_MQTT_TLS +#if defined(USE_MQTT_TLS) || defined(USE_MQTT_AWS_IOT) const uint16_t WEB_LOG_SIZE = 2000; // Max number of characters in weblog #else const uint16_t WEB_LOG_SIZE = 4000; // Max number of characters in weblog