From bc211e8c78732ef913c73d352f393f3f656ff210 Mon Sep 17 00:00:00 2001 From: Jason2866 Date: Sat, 11 May 2019 13:58:23 +0200 Subject: [PATCH 1/3] Add Bugfix Arduino Core 2.5.1 and use as default Since bugfix release is still not availible via orig. Platformio Github it is donwloaded via forked source from https://github.com/Jason2866/platform-espressif8266.git#Tasmota --- platformio.ini | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 9ca59d3e8..ae59e2faa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -57,7 +57,7 @@ platform = espressif8266@1.8.0 build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m0.ld -lstdc++ -lsupc++ -; lwIP 1.4 (Default) +; lwIP 1.4 ; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH ; lwIP 2 - Low Memory ; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY @@ -72,7 +72,32 @@ build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m.ld ; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 -O2 -; lwIP 1.4 (Default) +; lwIP 1.4 +; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH +; lwIP 2 - Low Memory +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY +; lwIP 2 - Higher Bandwidth +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH +; lwIP 2 - Higher Bandwidth Low Memory no Features +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH +; lwIP 2 - Higher Bandwidth no Features (Tasmota default) + -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH + -DVTABLES_IN_FLASH + -fno-exceptions + -lstdc++ + +[core_2_5_1] +; *** Esp8266 core for Arduino version 2.5.1 (release is still not availible via Platformio) +platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota +build_flags = ${esp82xx_defaults.build_flags} + -Wl,-Teagle.flash.1m.ld +; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 + -O2 +; nonos-sdk 22x + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x +; nonos-sdk-pre-v3 +; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 +; lwIP 1.4 ; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH ; lwIP 2 - Low Memory ; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY @@ -97,7 +122,7 @@ build_flags = ${esp82xx_defaults.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x ; nonos-sdk-pre-v3 ; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 -; lwIP 1.4 (Default) +; lwIP 1.4 ; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH ; lwIP 2 - Low Memory ; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY @@ -125,10 +150,12 @@ build_flags = ${esp82xx_defaults.build_flags} ; Select one core set for platform and build_flags ;platform = ${core_2_3_0.platform} ;build_flags = ${core_2_3_0.build_flags} -platform = ${core_2_4_2.platform} -build_flags = ${core_2_4_2.build_flags} +;platform = ${core_2_4_2.platform} +;build_flags = ${core_2_4_2.build_flags} ;platform = ${core_2_5_0.platform} ;build_flags = ${core_2_5_0.build_flags} +platform = ${core_2_5_1.platform} +build_flags = ${core_2_5_1.build_flags} ;platform = ${core_stage.platform} ;build_flags = ${core_stage.build_flags} From 3d08514060fcac3b2c1666884d42a3acf4e8078c Mon Sep 17 00:00:00 2001 From: Jason2866 Date: Sat, 11 May 2019 14:19:54 +0200 Subject: [PATCH 2/3] add -DBEARSSL_SSL_BASIC When using TLS, this flag avoids loading all the Elliptic Curves algorithm, and saves ~45KB of flash. Anyways, Elliptic Curves are far too slow for ESP8266 and the handshake would take more the 5 seconds. With this flag we limit to RSA algorithms which are faster. Thx for the tipp @s-hadinger --- platformio.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index ae59e2faa..0b7f98c6c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -71,7 +71,8 @@ platform = espressif8266@~2.0.4 build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m.ld ; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 - -O2 + -O2 + -DBEARSSL_SSL_BASIC ; lwIP 1.4 ; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH ; lwIP 2 - Low Memory From faa2590e9240f859096cc655b1c8dd434e732eb0 Mon Sep 17 00:00:00 2001 From: Jason2866 Date: Sat, 11 May 2019 14:32:35 +0200 Subject: [PATCH 3/3] Fix --- platformio.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0b7f98c6c..fae70a5bd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -72,7 +72,6 @@ build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m.ld ; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 -O2 - -DBEARSSL_SSL_BASIC ; lwIP 1.4 ; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH ; lwIP 2 - Low Memory @@ -94,6 +93,7 @@ build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m.ld ; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 -O2 + -DBEARSSL_SSL_BASIC ; nonos-sdk 22x -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x ; nonos-sdk-pre-v3 @@ -118,7 +118,8 @@ platform = https://github.com/platformio/platform-espressif8266 build_flags = ${esp82xx_defaults.build_flags} -Wl,-Teagle.flash.1m.ld ; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473 - -O2 + -O2 + -DBEARSSL_SSL_BASIC ; nonos-sdk 22x -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x ; nonos-sdk-pre-v3