diff --git a/.gitignore b/.gitignore index 364184a8a..a7bcd54c2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ tools/xtensa-lx106-elf/ tools/mkspiffs/ tools/mklittlefs/ tools/python/ +tools/python3/ package/versions/ exclude.txt tools/sdk/lib/liblwip_src.a diff --git a/.travis.yml b/.travis.yml index 36bab4ecf..e6a2b4012 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,6 +107,18 @@ jobs: script: $TRAVIS_BUILD_DIR/tests/buildm.sh env: CC=gcc-7 CXX=g++-7 + - name: "Mac OSX can build sketches" + os: osx + stage: build + script: $TRAVIS_BUILD_DIR/tests/build.sh + env: MACOSX=1 BUILD_PARITY=custom mod=500 rem=1 + + - name: "Windows can build sketches" + os: windows + stage: build + script: $TRAVIS_BUILD_DIR/tests/build.sh + env: WINDOWS=1 BUILD_PARITY=custom mod=500 rem=1 + - name: "Boards" stage: build script: $TRAVIS_BUILD_DIR/tests/ci/build_boards.sh diff --git a/boards.txt b/boards.txt index 31dc75f63..ff7f8e663 100644 --- a/boards.txt +++ b/boards.txt @@ -48,8 +48,11 @@ generic.menu.vt.heap=Heap generic.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM generic.menu.vt.iram=IRAM generic.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -generic.menu.exception.disabled=Disabled -generic.menu.exception.disabled.build.exception_flags=-fno-exceptions +generic.menu.exception.legacy=Legacy (new can return nullptr) +generic.menu.exception.legacy.build.exception_flags=-fno-exceptions +generic.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +generic.menu.exception.disabled=Disabled (new can abort) +generic.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT generic.menu.exception.disabled.build.stdcpp_lib=-lstdc++ generic.menu.exception.enabled=Enabled generic.menu.exception.enabled.build.exception_flags=-fexceptions @@ -454,10 +457,12 @@ generic.menu.lvl.OTA=OTA generic.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA generic.menu.lvl.OOM=OOM generic.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -generic.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -generic.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -generic.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -generic.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +generic.menu.lvl.MDNS=MDNS +generic.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +generic.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +generic.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +generic.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +generic.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS generic.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG generic.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG generic.menu.wipe.none=Only Sketch @@ -510,8 +515,11 @@ esp8285.menu.vt.heap=Heap esp8285.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM esp8285.menu.vt.iram=IRAM esp8285.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -esp8285.menu.exception.disabled=Disabled -esp8285.menu.exception.disabled.build.exception_flags=-fno-exceptions +esp8285.menu.exception.legacy=Legacy (new can return nullptr) +esp8285.menu.exception.legacy.build.exception_flags=-fno-exceptions +esp8285.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +esp8285.menu.exception.disabled=Disabled (new can abort) +esp8285.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT esp8285.menu.exception.disabled.build.stdcpp_lib=-lstdc++ esp8285.menu.exception.enabled=Enabled esp8285.menu.exception.enabled.build.exception_flags=-fexceptions @@ -726,10 +734,12 @@ esp8285.menu.lvl.OTA=OTA esp8285.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA esp8285.menu.lvl.OOM=OOM esp8285.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -esp8285.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -esp8285.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -esp8285.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -esp8285.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +esp8285.menu.lvl.MDNS=MDNS +esp8285.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +esp8285.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +esp8285.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +esp8285.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +esp8285.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS esp8285.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG esp8285.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG esp8285.menu.wipe.none=Only Sketch @@ -761,15 +771,15 @@ esp8285.menu.baud.3000000.upload.speed=3000000 espduino.name=ESPDuino (ESP-13 Module) espduino.build.board=ESP8266_ESP13 espduino.build.variant=ESPDuino -espduino.menu.ResetMethod.v2=ESPduino-V2 -espduino.menu.ResetMethod.v2.upload.resetmethod=nodemcu espduino.menu.ResetMethod.v1=ESPduino-V1 espduino.menu.ResetMethod.v1.upload.resetmethod=ck -espduino.menu.UploadTool.esptool=Serial -espduino.menu.UploadTool.esptool.upload.tool=esptool -espduino.menu.UploadTool.esptool.upload.verbose=-vv +espduino.menu.ResetMethod.v2=ESPduino-V2 +espduino.menu.ResetMethod.v2.upload.resetmethod=nodemcu espduino.menu.UploadTool.espota=OTA espduino.menu.UploadTool.espota.upload.tool=espota +espduino.menu.UploadTool.esptool=Serial +espduino.menu.UploadTool.esptool.upload.tool=esptool +espduino.menu.UploadTool.esptool.upload.verbose=--trace espduino.upload.tool=esptool espduino.upload.maximum_data_size=81920 espduino.upload.wait_for_upload_port=true @@ -791,8 +801,11 @@ espduino.menu.vt.heap=Heap espduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espduino.menu.vt.iram=IRAM espduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espduino.menu.exception.disabled=Disabled -espduino.menu.exception.disabled.build.exception_flags=-fno-exceptions +espduino.menu.exception.legacy=Legacy (new can return nullptr) +espduino.menu.exception.legacy.build.exception_flags=-fno-exceptions +espduino.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +espduino.menu.exception.disabled=Disabled (new can abort) +espduino.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espduino.menu.exception.enabled=Enabled espduino.menu.exception.enabled.build.exception_flags=-fexceptions @@ -922,10 +935,12 @@ espduino.menu.lvl.OTA=OTA espduino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA espduino.menu.lvl.OOM=OOM espduino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +espduino.menu.lvl.MDNS=MDNS +espduino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS espduino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG espduino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG espduino.menu.wipe.none=Only Sketch @@ -978,8 +993,11 @@ huzzah.menu.vt.heap=Heap huzzah.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM huzzah.menu.vt.iram=IRAM huzzah.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -huzzah.menu.exception.disabled=Disabled -huzzah.menu.exception.disabled.build.exception_flags=-fno-exceptions +huzzah.menu.exception.legacy=Legacy (new can return nullptr) +huzzah.menu.exception.legacy.build.exception_flags=-fno-exceptions +huzzah.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +huzzah.menu.exception.disabled=Disabled (new can abort) +huzzah.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT huzzah.menu.exception.disabled.build.stdcpp_lib=-lstdc++ huzzah.menu.exception.enabled=Enabled huzzah.menu.exception.enabled.build.exception_flags=-fexceptions @@ -1110,10 +1128,12 @@ huzzah.menu.lvl.OTA=OTA huzzah.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA huzzah.menu.lvl.OOM=OOM huzzah.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +huzzah.menu.lvl.MDNS=MDNS +huzzah.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS huzzah.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG huzzah.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG huzzah.menu.wipe.none=Only Sketch @@ -1166,8 +1186,11 @@ inventone.menu.vt.heap=Heap inventone.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM inventone.menu.vt.iram=IRAM inventone.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -inventone.menu.exception.disabled=Disabled -inventone.menu.exception.disabled.build.exception_flags=-fno-exceptions +inventone.menu.exception.legacy=Legacy (new can return nullptr) +inventone.menu.exception.legacy.build.exception_flags=-fno-exceptions +inventone.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +inventone.menu.exception.disabled=Disabled (new can abort) +inventone.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT inventone.menu.exception.disabled.build.stdcpp_lib=-lstdc++ inventone.menu.exception.enabled=Enabled inventone.menu.exception.enabled.build.exception_flags=-fexceptions @@ -1298,10 +1321,12 @@ inventone.menu.lvl.OTA=OTA inventone.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA inventone.menu.lvl.OOM=OOM inventone.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +inventone.menu.lvl.MDNS=MDNS +inventone.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS inventone.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG inventone.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG inventone.menu.wipe.none=Only Sketch @@ -1354,8 +1379,11 @@ cw01.menu.vt.heap=Heap cw01.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM cw01.menu.vt.iram=IRAM cw01.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -cw01.menu.exception.disabled=Disabled -cw01.menu.exception.disabled.build.exception_flags=-fno-exceptions +cw01.menu.exception.legacy=Legacy (new can return nullptr) +cw01.menu.exception.legacy.build.exception_flags=-fno-exceptions +cw01.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +cw01.menu.exception.disabled=Disabled (new can abort) +cw01.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT cw01.menu.exception.disabled.build.stdcpp_lib=-lstdc++ cw01.menu.exception.enabled=Enabled cw01.menu.exception.enabled.build.exception_flags=-fexceptions @@ -1489,10 +1517,12 @@ cw01.menu.lvl.OTA=OTA cw01.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA cw01.menu.lvl.OOM=OOM cw01.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +cw01.menu.lvl.MDNS=MDNS +cw01.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS cw01.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG cw01.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG cw01.menu.wipe.none=Only Sketch @@ -1545,8 +1575,11 @@ espresso_lite_v1.menu.vt.heap=Heap espresso_lite_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espresso_lite_v1.menu.vt.iram=IRAM espresso_lite_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espresso_lite_v1.menu.exception.disabled=Disabled -espresso_lite_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions +espresso_lite_v1.menu.exception.legacy=Legacy (new can return nullptr) +espresso_lite_v1.menu.exception.legacy.build.exception_flags=-fno-exceptions +espresso_lite_v1.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +espresso_lite_v1.menu.exception.disabled=Disabled (new can abort) +espresso_lite_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espresso_lite_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espresso_lite_v1.menu.exception.enabled=Enabled espresso_lite_v1.menu.exception.enabled.build.exception_flags=-fexceptions @@ -1680,10 +1713,12 @@ espresso_lite_v1.menu.lvl.OTA=OTA espresso_lite_v1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA espresso_lite_v1.menu.lvl.OOM=OOM espresso_lite_v1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +espresso_lite_v1.menu.lvl.MDNS=MDNS +espresso_lite_v1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS espresso_lite_v1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG espresso_lite_v1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG espresso_lite_v1.menu.wipe.none=Only Sketch @@ -1736,8 +1771,11 @@ espresso_lite_v2.menu.vt.heap=Heap espresso_lite_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espresso_lite_v2.menu.vt.iram=IRAM espresso_lite_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espresso_lite_v2.menu.exception.disabled=Disabled -espresso_lite_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions +espresso_lite_v2.menu.exception.legacy=Legacy (new can return nullptr) +espresso_lite_v2.menu.exception.legacy.build.exception_flags=-fno-exceptions +espresso_lite_v2.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +espresso_lite_v2.menu.exception.disabled=Disabled (new can abort) +espresso_lite_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espresso_lite_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espresso_lite_v2.menu.exception.enabled=Enabled espresso_lite_v2.menu.exception.enabled.build.exception_flags=-fexceptions @@ -1871,10 +1909,12 @@ espresso_lite_v2.menu.lvl.OTA=OTA espresso_lite_v2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA espresso_lite_v2.menu.lvl.OOM=OOM espresso_lite_v2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +espresso_lite_v2.menu.lvl.MDNS=MDNS +espresso_lite_v2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS espresso_lite_v2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG espresso_lite_v2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG espresso_lite_v2.menu.wipe.none=Only Sketch @@ -1927,8 +1967,11 @@ phoenix_v1.menu.vt.heap=Heap phoenix_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM phoenix_v1.menu.vt.iram=IRAM phoenix_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -phoenix_v1.menu.exception.disabled=Disabled -phoenix_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions +phoenix_v1.menu.exception.legacy=Legacy (new can return nullptr) +phoenix_v1.menu.exception.legacy.build.exception_flags=-fno-exceptions +phoenix_v1.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +phoenix_v1.menu.exception.disabled=Disabled (new can abort) +phoenix_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT phoenix_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ phoenix_v1.menu.exception.enabled=Enabled phoenix_v1.menu.exception.enabled.build.exception_flags=-fexceptions @@ -2062,10 +2105,12 @@ phoenix_v1.menu.lvl.OTA=OTA phoenix_v1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA phoenix_v1.menu.lvl.OOM=OOM phoenix_v1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +phoenix_v1.menu.lvl.MDNS=MDNS +phoenix_v1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS phoenix_v1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG phoenix_v1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG phoenix_v1.menu.wipe.none=Only Sketch @@ -2118,8 +2163,11 @@ phoenix_v2.menu.vt.heap=Heap phoenix_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM phoenix_v2.menu.vt.iram=IRAM phoenix_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -phoenix_v2.menu.exception.disabled=Disabled -phoenix_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions +phoenix_v2.menu.exception.legacy=Legacy (new can return nullptr) +phoenix_v2.menu.exception.legacy.build.exception_flags=-fno-exceptions +phoenix_v2.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +phoenix_v2.menu.exception.disabled=Disabled (new can abort) +phoenix_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT phoenix_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ phoenix_v2.menu.exception.enabled=Enabled phoenix_v2.menu.exception.enabled.build.exception_flags=-fexceptions @@ -2253,10 +2301,12 @@ phoenix_v2.menu.lvl.OTA=OTA phoenix_v2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA phoenix_v2.menu.lvl.OOM=OOM phoenix_v2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +phoenix_v2.menu.lvl.MDNS=MDNS +phoenix_v2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS phoenix_v2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG phoenix_v2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG phoenix_v2.menu.wipe.none=Only Sketch @@ -2309,8 +2359,11 @@ nodemcu.menu.vt.heap=Heap nodemcu.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM nodemcu.menu.vt.iram=IRAM nodemcu.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -nodemcu.menu.exception.disabled=Disabled -nodemcu.menu.exception.disabled.build.exception_flags=-fno-exceptions +nodemcu.menu.exception.legacy=Legacy (new can return nullptr) +nodemcu.menu.exception.legacy.build.exception_flags=-fno-exceptions +nodemcu.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +nodemcu.menu.exception.disabled=Disabled (new can abort) +nodemcu.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT nodemcu.menu.exception.disabled.build.stdcpp_lib=-lstdc++ nodemcu.menu.exception.enabled=Enabled nodemcu.menu.exception.enabled.build.exception_flags=-fexceptions @@ -2441,10 +2494,12 @@ nodemcu.menu.lvl.OTA=OTA nodemcu.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA nodemcu.menu.lvl.OOM=OOM nodemcu.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +nodemcu.menu.lvl.MDNS=MDNS +nodemcu.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS nodemcu.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG nodemcu.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG nodemcu.menu.wipe.none=Only Sketch @@ -2497,8 +2552,11 @@ nodemcuv2.menu.vt.heap=Heap nodemcuv2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM nodemcuv2.menu.vt.iram=IRAM nodemcuv2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -nodemcuv2.menu.exception.disabled=Disabled -nodemcuv2.menu.exception.disabled.build.exception_flags=-fno-exceptions +nodemcuv2.menu.exception.legacy=Legacy (new can return nullptr) +nodemcuv2.menu.exception.legacy.build.exception_flags=-fno-exceptions +nodemcuv2.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +nodemcuv2.menu.exception.disabled=Disabled (new can abort) +nodemcuv2.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT nodemcuv2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ nodemcuv2.menu.exception.enabled=Enabled nodemcuv2.menu.exception.enabled.build.exception_flags=-fexceptions @@ -2629,10 +2687,12 @@ nodemcuv2.menu.lvl.OTA=OTA nodemcuv2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA nodemcuv2.menu.lvl.OOM=OOM nodemcuv2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +nodemcuv2.menu.lvl.MDNS=MDNS +nodemcuv2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS nodemcuv2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG nodemcuv2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG nodemcuv2.menu.wipe.none=Only Sketch @@ -2685,8 +2745,11 @@ modwifi.menu.vt.heap=Heap modwifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM modwifi.menu.vt.iram=IRAM modwifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -modwifi.menu.exception.disabled=Disabled -modwifi.menu.exception.disabled.build.exception_flags=-fno-exceptions +modwifi.menu.exception.legacy=Legacy (new can return nullptr) +modwifi.menu.exception.legacy.build.exception_flags=-fno-exceptions +modwifi.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +modwifi.menu.exception.disabled=Disabled (new can abort) +modwifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT modwifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ modwifi.menu.exception.enabled=Enabled modwifi.menu.exception.enabled.build.exception_flags=-fexceptions @@ -2837,10 +2900,12 @@ modwifi.menu.lvl.OTA=OTA modwifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA modwifi.menu.lvl.OOM=OOM modwifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +modwifi.menu.lvl.MDNS=MDNS +modwifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS modwifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG modwifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG modwifi.menu.wipe.none=Only Sketch @@ -2893,8 +2958,11 @@ thing.menu.vt.heap=Heap thing.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM thing.menu.vt.iram=IRAM thing.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -thing.menu.exception.disabled=Disabled -thing.menu.exception.disabled.build.exception_flags=-fno-exceptions +thing.menu.exception.legacy=Legacy (new can return nullptr) +thing.menu.exception.legacy.build.exception_flags=-fno-exceptions +thing.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +thing.menu.exception.disabled=Disabled (new can abort) +thing.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT thing.menu.exception.disabled.build.stdcpp_lib=-lstdc++ thing.menu.exception.enabled=Enabled thing.menu.exception.enabled.build.exception_flags=-fexceptions @@ -3025,10 +3093,12 @@ thing.menu.lvl.OTA=OTA thing.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA thing.menu.lvl.OOM=OOM thing.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +thing.menu.lvl.MDNS=MDNS +thing.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS thing.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG thing.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG thing.menu.wipe.none=Only Sketch @@ -3081,8 +3151,11 @@ thingdev.menu.vt.heap=Heap thingdev.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM thingdev.menu.vt.iram=IRAM thingdev.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -thingdev.menu.exception.disabled=Disabled -thingdev.menu.exception.disabled.build.exception_flags=-fno-exceptions +thingdev.menu.exception.legacy=Legacy (new can return nullptr) +thingdev.menu.exception.legacy.build.exception_flags=-fno-exceptions +thingdev.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +thingdev.menu.exception.disabled=Disabled (new can abort) +thingdev.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT thingdev.menu.exception.disabled.build.stdcpp_lib=-lstdc++ thingdev.menu.exception.enabled=Enabled thingdev.menu.exception.enabled.build.exception_flags=-fexceptions @@ -3213,10 +3286,12 @@ thingdev.menu.lvl.OTA=OTA thingdev.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA thingdev.menu.lvl.OOM=OOM thingdev.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +thingdev.menu.lvl.MDNS=MDNS +thingdev.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS thingdev.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG thingdev.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG thingdev.menu.wipe.none=Only Sketch @@ -3269,8 +3344,11 @@ esp210.menu.vt.heap=Heap esp210.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM esp210.menu.vt.iram=IRAM esp210.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -esp210.menu.exception.disabled=Disabled -esp210.menu.exception.disabled.build.exception_flags=-fno-exceptions +esp210.menu.exception.legacy=Legacy (new can return nullptr) +esp210.menu.exception.legacy.build.exception_flags=-fno-exceptions +esp210.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +esp210.menu.exception.disabled=Disabled (new can abort) +esp210.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT esp210.menu.exception.disabled.build.stdcpp_lib=-lstdc++ esp210.menu.exception.enabled=Enabled esp210.menu.exception.enabled.build.exception_flags=-fexceptions @@ -3401,10 +3479,12 @@ esp210.menu.lvl.OTA=OTA esp210.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA esp210.menu.lvl.OOM=OOM esp210.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +esp210.menu.lvl.MDNS=MDNS +esp210.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS esp210.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG esp210.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG esp210.menu.wipe.none=Only Sketch @@ -3457,8 +3537,11 @@ d1_mini.menu.vt.heap=Heap d1_mini.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1_mini.menu.vt.iram=IRAM d1_mini.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini.menu.exception.disabled=Disabled -d1_mini.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1_mini.menu.exception.legacy=Legacy (new can return nullptr) +d1_mini.menu.exception.legacy.build.exception_flags=-fno-exceptions +d1_mini.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +d1_mini.menu.exception.disabled=Disabled (new can abort) +d1_mini.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1_mini.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1_mini.menu.exception.enabled=Enabled d1_mini.menu.exception.enabled.build.exception_flags=-fexceptions @@ -3589,10 +3672,12 @@ d1_mini.menu.lvl.OTA=OTA d1_mini.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA d1_mini.menu.lvl.OOM=OOM d1_mini.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +d1_mini.menu.lvl.MDNS=MDNS +d1_mini.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS d1_mini.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG d1_mini.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG d1_mini.menu.wipe.none=Only Sketch @@ -3645,8 +3730,11 @@ d1_mini_pro.menu.vt.heap=Heap d1_mini_pro.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1_mini_pro.menu.vt.iram=IRAM d1_mini_pro.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini_pro.menu.exception.disabled=Disabled -d1_mini_pro.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1_mini_pro.menu.exception.legacy=Legacy (new can return nullptr) +d1_mini_pro.menu.exception.legacy.build.exception_flags=-fno-exceptions +d1_mini_pro.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +d1_mini_pro.menu.exception.disabled=Disabled (new can abort) +d1_mini_pro.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1_mini_pro.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1_mini_pro.menu.exception.enabled=Enabled d1_mini_pro.menu.exception.enabled.build.exception_flags=-fexceptions @@ -3760,10 +3848,12 @@ d1_mini_pro.menu.lvl.OTA=OTA d1_mini_pro.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA d1_mini_pro.menu.lvl.OOM=OOM d1_mini_pro.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +d1_mini_pro.menu.lvl.MDNS=MDNS +d1_mini_pro.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS d1_mini_pro.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG d1_mini_pro.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG d1_mini_pro.menu.wipe.none=Only Sketch @@ -3816,8 +3906,11 @@ d1_mini_lite.menu.vt.heap=Heap d1_mini_lite.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1_mini_lite.menu.vt.iram=IRAM d1_mini_lite.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini_lite.menu.exception.disabled=Disabled -d1_mini_lite.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1_mini_lite.menu.exception.legacy=Legacy (new can return nullptr) +d1_mini_lite.menu.exception.legacy.build.exception_flags=-fno-exceptions +d1_mini_lite.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +d1_mini_lite.menu.exception.disabled=Disabled (new can abort) +d1_mini_lite.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1_mini_lite.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1_mini_lite.menu.exception.enabled=Enabled d1_mini_lite.menu.exception.enabled.build.exception_flags=-fexceptions @@ -3988,10 +4081,12 @@ d1_mini_lite.menu.lvl.OTA=OTA d1_mini_lite.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA d1_mini_lite.menu.lvl.OOM=OOM d1_mini_lite.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +d1_mini_lite.menu.lvl.MDNS=MDNS +d1_mini_lite.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS d1_mini_lite.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG d1_mini_lite.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG d1_mini_lite.menu.wipe.none=Only Sketch @@ -4044,8 +4139,11 @@ d1.menu.vt.heap=Heap d1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1.menu.vt.iram=IRAM d1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1.menu.exception.disabled=Disabled -d1.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1.menu.exception.legacy=Legacy (new can return nullptr) +d1.menu.exception.legacy.build.exception_flags=-fno-exceptions +d1.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +d1.menu.exception.disabled=Disabled (new can abort) +d1.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1.menu.exception.enabled=Enabled d1.menu.exception.enabled.build.exception_flags=-fexceptions @@ -4176,10 +4274,12 @@ d1.menu.lvl.OTA=OTA d1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA d1.menu.lvl.OOM=OOM d1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +d1.menu.lvl.MDNS=MDNS +d1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS d1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG d1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG d1.menu.wipe.none=Only Sketch @@ -4232,8 +4332,11 @@ espino.menu.vt.heap=Heap espino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espino.menu.vt.iram=IRAM espino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espino.menu.exception.disabled=Disabled -espino.menu.exception.disabled.build.exception_flags=-fno-exceptions +espino.menu.exception.legacy=Legacy (new can return nullptr) +espino.menu.exception.legacy.build.exception_flags=-fno-exceptions +espino.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +espino.menu.exception.disabled=Disabled (new can abort) +espino.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espino.menu.exception.enabled=Enabled espino.menu.exception.enabled.build.exception_flags=-fexceptions @@ -4367,10 +4470,12 @@ espino.menu.lvl.OTA=OTA espino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA espino.menu.lvl.OOM=OOM espino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +espino.menu.lvl.MDNS=MDNS +espino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS espino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG espino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG espino.menu.wipe.none=Only Sketch @@ -4423,8 +4528,11 @@ espinotee.menu.vt.heap=Heap espinotee.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espinotee.menu.vt.iram=IRAM espinotee.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espinotee.menu.exception.disabled=Disabled -espinotee.menu.exception.disabled.build.exception_flags=-fno-exceptions +espinotee.menu.exception.legacy=Legacy (new can return nullptr) +espinotee.menu.exception.legacy.build.exception_flags=-fno-exceptions +espinotee.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +espinotee.menu.exception.disabled=Disabled (new can abort) +espinotee.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espinotee.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espinotee.menu.exception.enabled=Enabled espinotee.menu.exception.enabled.build.exception_flags=-fexceptions @@ -4555,10 +4663,12 @@ espinotee.menu.lvl.OTA=OTA espinotee.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA espinotee.menu.lvl.OOM=OOM espinotee.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +espinotee.menu.lvl.MDNS=MDNS +espinotee.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS espinotee.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG espinotee.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG espinotee.menu.wipe.none=Only Sketch @@ -4592,20 +4702,20 @@ wifinfo.build.board=WIFINFO wifinfo.build.variant=wifinfo wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS) wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07 -wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld -wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000 -wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000 +wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096 +wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000 +wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000 wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376 wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS) wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12 -wifinfo.menu.ESPModule.ESP12.build.flash_size=4M wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld -wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000 -wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000 +wifinfo.menu.ESPModule.ESP12.build.flash_size=4M wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192 +wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000 wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256 +wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000 wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464 wifinfo.upload.tool=esptool wifinfo.upload.maximum_data_size=81920 @@ -4628,8 +4738,11 @@ wifinfo.menu.vt.heap=Heap wifinfo.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wifinfo.menu.vt.iram=IRAM wifinfo.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifinfo.menu.exception.disabled=Disabled -wifinfo.menu.exception.disabled.build.exception_flags=-fno-exceptions +wifinfo.menu.exception.legacy=Legacy (new can return nullptr) +wifinfo.menu.exception.legacy.build.exception_flags=-fno-exceptions +wifinfo.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +wifinfo.menu.exception.disabled=Disabled (new can abort) +wifinfo.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wifinfo.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wifinfo.menu.exception.enabled=Enabled wifinfo.menu.exception.enabled.build.exception_flags=-fexceptions @@ -4803,10 +4916,12 @@ wifinfo.menu.lvl.OTA=OTA wifinfo.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA wifinfo.menu.lvl.OOM=OOM wifinfo.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +wifinfo.menu.lvl.MDNS=MDNS +wifinfo.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS wifinfo.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG wifinfo.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG wifinfo.menu.wipe.none=Only Sketch @@ -4839,16 +4954,16 @@ arduino-esp8266.name=Arduino arduino-esp8266.build.board=ESP8266_ARDUINO arduino-esp8266.menu.BoardModel.primo=Primo arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO -arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 -arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi -arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI -arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart -arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 +arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO -arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO arduino-esp8266.menu.BoardModel.starottodeved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 +arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart +arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi +arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI +arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 +arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart arduino-esp8266.upload.tool=esptool arduino-esp8266.upload.maximum_data_size=81920 arduino-esp8266.upload.wait_for_upload_port=true @@ -4871,8 +4986,11 @@ arduino-esp8266.menu.vt.heap=Heap arduino-esp8266.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM arduino-esp8266.menu.vt.iram=IRAM arduino-esp8266.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -arduino-esp8266.menu.exception.disabled=Disabled -arduino-esp8266.menu.exception.disabled.build.exception_flags=-fno-exceptions +arduino-esp8266.menu.exception.legacy=Legacy (new can return nullptr) +arduino-esp8266.menu.exception.legacy.build.exception_flags=-fno-exceptions +arduino-esp8266.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +arduino-esp8266.menu.exception.disabled=Disabled (new can abort) +arduino-esp8266.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT arduino-esp8266.menu.exception.disabled.build.stdcpp_lib=-lstdc++ arduino-esp8266.menu.exception.enabled=Enabled arduino-esp8266.menu.exception.enabled.build.exception_flags=-fexceptions @@ -5003,10 +5121,12 @@ arduino-esp8266.menu.lvl.OTA=OTA arduino-esp8266.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA arduino-esp8266.menu.lvl.OOM=OOM arduino-esp8266.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +arduino-esp8266.menu.lvl.MDNS=MDNS +arduino-esp8266.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS arduino-esp8266.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG arduino-esp8266.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG arduino-esp8266.menu.wipe.none=Only Sketch @@ -5060,8 +5180,11 @@ gen4iod.menu.vt.heap=Heap gen4iod.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM gen4iod.menu.vt.iram=IRAM gen4iod.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -gen4iod.menu.exception.disabled=Disabled -gen4iod.menu.exception.disabled.build.exception_flags=-fno-exceptions +gen4iod.menu.exception.legacy=Legacy (new can return nullptr) +gen4iod.menu.exception.legacy.build.exception_flags=-fno-exceptions +gen4iod.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +gen4iod.menu.exception.disabled=Disabled (new can abort) +gen4iod.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT gen4iod.menu.exception.disabled.build.stdcpp_lib=-lstdc++ gen4iod.menu.exception.enabled=Enabled gen4iod.menu.exception.enabled.build.exception_flags=-fexceptions @@ -5192,10 +5315,12 @@ gen4iod.menu.lvl.OTA=OTA gen4iod.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA gen4iod.menu.lvl.OOM=OOM gen4iod.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -gen4iod.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -gen4iod.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -gen4iod.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -gen4iod.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +gen4iod.menu.lvl.MDNS=MDNS +gen4iod.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +gen4iod.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +gen4iod.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +gen4iod.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +gen4iod.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS gen4iod.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG gen4iod.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG gen4iod.menu.wipe.none=Only Sketch @@ -5249,8 +5374,11 @@ oak.menu.vt.heap=Heap oak.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM oak.menu.vt.iram=IRAM oak.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -oak.menu.exception.disabled=Disabled -oak.menu.exception.disabled.build.exception_flags=-fno-exceptions +oak.menu.exception.legacy=Legacy (new can return nullptr) +oak.menu.exception.legacy.build.exception_flags=-fno-exceptions +oak.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +oak.menu.exception.disabled=Disabled (new can abort) +oak.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT oak.menu.exception.disabled.build.stdcpp_lib=-lstdc++ oak.menu.exception.enabled=Enabled oak.menu.exception.enabled.build.exception_flags=-fexceptions @@ -5381,10 +5509,12 @@ oak.menu.lvl.OTA=OTA oak.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA oak.menu.lvl.OOM=OOM oak.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +oak.menu.lvl.MDNS=MDNS +oak.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS oak.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG oak.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG oak.menu.wipe.none=Only Sketch @@ -5437,8 +5567,11 @@ wifiduino.menu.vt.heap=Heap wifiduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wifiduino.menu.vt.iram=IRAM wifiduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifiduino.menu.exception.disabled=Disabled -wifiduino.menu.exception.disabled.build.exception_flags=-fno-exceptions +wifiduino.menu.exception.legacy=Legacy (new can return nullptr) +wifiduino.menu.exception.legacy.build.exception_flags=-fno-exceptions +wifiduino.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +wifiduino.menu.exception.disabled=Disabled (new can abort) +wifiduino.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wifiduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wifiduino.menu.exception.enabled=Enabled wifiduino.menu.exception.enabled.build.exception_flags=-fexceptions @@ -5569,10 +5702,12 @@ wifiduino.menu.lvl.OTA=OTA wifiduino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA wifiduino.menu.lvl.OOM=OOM wifiduino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +wifiduino.menu.lvl.MDNS=MDNS +wifiduino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS wifiduino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG wifiduino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG wifiduino.menu.wipe.none=Only Sketch @@ -5625,8 +5760,11 @@ wifi_slot.menu.vt.heap=Heap wifi_slot.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wifi_slot.menu.vt.iram=IRAM wifi_slot.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifi_slot.menu.exception.disabled=Disabled -wifi_slot.menu.exception.disabled.build.exception_flags=-fno-exceptions +wifi_slot.menu.exception.legacy=Legacy (new can return nullptr) +wifi_slot.menu.exception.legacy.build.exception_flags=-fno-exceptions +wifi_slot.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +wifi_slot.menu.exception.disabled=Disabled (new can abort) +wifi_slot.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wifi_slot.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wifi_slot.menu.exception.enabled=Enabled wifi_slot.menu.exception.enabled.build.exception_flags=-fexceptions @@ -5867,10 +6005,12 @@ wifi_slot.menu.lvl.OTA=OTA wifi_slot.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA wifi_slot.menu.lvl.OOM=OOM wifi_slot.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wifi_slot.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wifi_slot.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -wifi_slot.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wifi_slot.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +wifi_slot.menu.lvl.MDNS=MDNS +wifi_slot.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wifi_slot.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifi_slot.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wifi_slot.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifi_slot.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS wifi_slot.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG wifi_slot.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG wifi_slot.menu.wipe.none=Only Sketch @@ -5923,8 +6063,11 @@ wiolink.menu.vt.heap=Heap wiolink.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wiolink.menu.vt.iram=IRAM wiolink.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wiolink.menu.exception.disabled=Disabled -wiolink.menu.exception.disabled.build.exception_flags=-fno-exceptions +wiolink.menu.exception.legacy=Legacy (new can return nullptr) +wiolink.menu.exception.legacy.build.exception_flags=-fno-exceptions +wiolink.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +wiolink.menu.exception.disabled=Disabled (new can abort) +wiolink.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wiolink.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wiolink.menu.exception.enabled=Enabled wiolink.menu.exception.enabled.build.exception_flags=-fexceptions @@ -6055,10 +6198,12 @@ wiolink.menu.lvl.OTA=OTA wiolink.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA wiolink.menu.lvl.OOM=OOM wiolink.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +wiolink.menu.lvl.MDNS=MDNS +wiolink.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS wiolink.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG wiolink.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG wiolink.menu.wipe.none=Only Sketch @@ -6111,8 +6256,11 @@ espectro.menu.vt.heap=Heap espectro.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espectro.menu.vt.iram=IRAM espectro.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espectro.menu.exception.disabled=Disabled -espectro.menu.exception.disabled.build.exception_flags=-fno-exceptions +espectro.menu.exception.legacy=Legacy (new can return nullptr) +espectro.menu.exception.legacy.build.exception_flags=-fno-exceptions +espectro.menu.exception.legacy.build.stdcpp_lib=-lstdc++ +espectro.menu.exception.disabled=Disabled (new can abort) +espectro.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espectro.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espectro.menu.exception.enabled=Enabled espectro.menu.exception.enabled.build.exception_flags=-fexceptions @@ -6243,10 +6391,12 @@ espectro.menu.lvl.OTA=OTA espectro.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA espectro.menu.lvl.OOM=OOM espectro.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espectro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espectro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -espectro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM -espectro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM +espectro.menu.lvl.MDNS=MDNS +espectro.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espectro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espectro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espectro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espectro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS espectro.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG espectro.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG espectro.menu.wipe.none=Only Sketch diff --git a/cores/esp8266/AddrList.h b/cores/esp8266/AddrList.h index 23a105f25..f7adc3d70 100644 --- a/cores/esp8266/AddrList.h +++ b/cores/esp8266/AddrList.h @@ -128,6 +128,7 @@ struct netifWrapper const char* ifmac () const { return (const char*)_netif->hwaddr; } int ifnumber () const { return _netif->num; } bool ifUp () const { return !!(_netif->flags & NETIF_FLAG_UP); } + CONST netif* interface () const { return _netif; } const ip_addr_t* ipFromNetifNum () const { diff --git a/cores/esp8266/Arduino.h b/cores/esp8266/Arduino.h index 7711e8fa5..82a183412 100644 --- a/cores/esp8266/Arduino.h +++ b/cores/esp8266/Arduino.h @@ -142,30 +142,9 @@ void timer0_detachInterrupt(void); void ets_intr_lock(); void ets_intr_unlock(); -#ifndef __STRINGIFY -#define __STRINGIFY(a) #a -#endif - -// these low level routines provide a replacement for SREG interrupt save that AVR uses -// but are esp8266 specific. A normal use pattern is like -// -//{ -// uint32_t savedPS = xt_rsil(1); // this routine will allow level 2 and above -// // do work here -// xt_wsr_ps(savedPS); // restore the state -//} -// -// level (0-15), interrupts of the given level and above will be active -// level 15 will disable ALL interrupts, -// level 0 will enable ALL interrupts, -// -#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;})) -#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory") - #define interrupts() xt_rsil(0) #define noInterrupts() xt_rsil(15) - #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) @@ -272,8 +251,8 @@ using std::max; using std::isinf; using std::isnan; -#define _min(a,b) ((a)<(b)?(a):(b)) -#define _max(a,b) ((a)>(b)?(a):(b)) +#define _min(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a < _b? _a : _b; }) +#define _max(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a > _b? _a : _b; }) uint16_t makeWord(uint16_t w); uint16_t makeWord(byte h, byte l); diff --git a/cores/esp8266/Esp.h b/cores/esp8266/Esp.h index bc241eb39..33c7f10ad 100644 --- a/cores/esp8266/Esp.h +++ b/cores/esp8266/Esp.h @@ -201,17 +201,16 @@ class EspClass { bool eraseConfig(); #ifndef CORE_MOCK - inline -#endif + inline uint32_t getCycleCount() __attribute__((always_inline)); +#else uint32_t getCycleCount(); +#endif }; #ifndef CORE_MOCK uint32_t EspClass::getCycleCount() { - uint32_t ccount; - __asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount)); - return ccount; + return esp_get_cycle_count(); } #endif // !defined(CORE_MOCK) diff --git a/cores/esp8266/HardwareSerial.cpp b/cores/esp8266/HardwareSerial.cpp index 6ec94500d..1be050e8c 100644 --- a/cores/esp8266/HardwareSerial.cpp +++ b/cores/esp8266/HardwareSerial.cpp @@ -60,6 +60,15 @@ void HardwareSerial::end() _uart = NULL; } +void HardwareSerial::updateBaudRate(unsigned long baud) +{ + if(!_uart) { + return; + } + + uart_set_baudrate(_uart, baud); +} + size_t HardwareSerial::setRxBufferSize(size_t size){ if(_uart) { _rx_size = uart_resize_rx_buffer(_uart, size); @@ -121,9 +130,9 @@ unsigned long HardwareSerial::testBaudrate() unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis) { - time_t startMillis = millis(); + esp8266::polledTimeout::oneShotFastMs timeOut(timeoutMillis); unsigned long detectedBaudrate; - while ((time_t) millis() - startMillis < timeoutMillis) { + while (!timeOut) { if ((detectedBaudrate = testBaudrate())) { break; } @@ -133,8 +142,8 @@ unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis) return detectedBaudrate; } -size_t HardwareSerial::readBytes(char* buffer, size_t size) -{ +size_t HardwareSerial::readBytes(char* buffer, size_t size) +{ size_t got = 0; while (got < size) @@ -147,7 +156,7 @@ size_t HardwareSerial::readBytes(char* buffer, size_t size) got += read(buffer + got, std::min(size - got, avail)); } return got; -} +} #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) HardwareSerial Serial(UART0); diff --git a/cores/esp8266/HardwareSerial.h b/cores/esp8266/HardwareSerial.h index 88130ec7b..2d7f631db 100644 --- a/cores/esp8266/HardwareSerial.h +++ b/cores/esp8266/HardwareSerial.h @@ -88,6 +88,8 @@ public: void end(); + void updateBaudRate(unsigned long baud); + size_t setRxBufferSize(size_t size); size_t getRxBufferSize() { diff --git a/cores/esp8266/Print.cpp b/cores/esp8266/Print.cpp index 2870f3f87..ff640edae 100644 --- a/cores/esp8266/Print.cpp +++ b/cores/esp8266/Print.cpp @@ -45,7 +45,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) { size_t n = 0; while (size--) { - size_t ret = write(*buffer++); + size_t ret = write(pgm_read_byte(buffer++)); if (ret == 0) { // Write of last byte didn't complete, abort additional processing break; diff --git a/cores/esp8266/Print.h b/cores/esp8266/Print.h index fdd20fda3..e620f14ad 100644 --- a/cores/esp8266/Print.h +++ b/cores/esp8266/Print.h @@ -56,7 +56,7 @@ class Print { size_t write(const char *str) { if(str == NULL) return 0; - return write((const uint8_t *) str, strlen(str)); + return write((const uint8_t *) str, strlen_P(str)); } virtual size_t write(const uint8_t *buffer, size_t size); size_t write(const char *buffer, size_t size) { diff --git a/cores/esp8266/StreamString.cpp b/cores/esp8266/StreamString.cpp index f50b6825b..24cfe0dd1 100644 --- a/cores/esp8266/StreamString.cpp +++ b/cores/esp8266/StreamString.cpp @@ -32,6 +32,7 @@ size_t StreamString::write(const uint8_t *data, size_t size) { *(wbuffer() + newlen) = 0x00; // add null for string end return size; } + DEBUGV(":stream2string: OOM (%d->%d)\n", length(), newlen+1); } return 0; } diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index 2992d3c95..d6b6b621f 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -1,5 +1,4 @@ #include "Updater.h" -#include "Arduino.h" #include "eboot_command.h" #include @@ -11,10 +10,10 @@ #endif #if ARDUINO_SIGNING - #include "../../libraries/ESP8266WiFi/src/BearSSLHelpers.h" - static BearSSL::PublicKey signPubKey(signing_pubkey); - static BearSSL::HashSHA256 hash; - static BearSSL::SigningVerifier sign(&signPubKey); +namespace esp8266 { + extern UpdaterHashClass& updaterSigningHash; + extern UpdaterVerifyClass& updaterSigningVerifier; +} #endif extern "C" { @@ -39,7 +38,7 @@ UpdaterClass::UpdaterClass() , _progress_callback(nullptr) { #if ARDUINO_SIGNING - installSignature(&hash, &sign); + installSignature(&esp8266::updaterSigningHash, &esp8266::updaterSigningVerifier); #endif } diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index aee4b1c94..048704074 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -185,7 +185,7 @@ unsigned char String::changeBuffer(unsigned int maxStrLen) { size_t oldSize = capacity() + 1; // include NULL. if (isSSO()) { // Copy the SSO buffer into allocated space - memmove(newbuffer, sso.buff, sizeof(sso.buff)); + memmove_P(newbuffer, sso.buff, sizeof(sso.buff)); } if (newSize > oldSize) { @@ -210,7 +210,7 @@ String & String::copy(const char *cstr, unsigned int length) { return *this; } setLen(length); - memmove(wbuffer(), cstr, length + 1); + memmove_P(wbuffer(), cstr, length + 1); return *this; } @@ -228,7 +228,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length) { void String::move(String &rhs) { if(buffer()) { if(capacity() >= rhs.len()) { - memmove(wbuffer(), rhs.buffer(), rhs.length() + 1); + memmove_P(wbuffer(), rhs.buffer(), rhs.length() + 1); setLen(rhs.len()); rhs.invalidate(); return; @@ -241,7 +241,7 @@ void String::move(String &rhs) { } if (rhs.isSSO()) { setSSO(true); - memmove(sso.buff, rhs.sso.buff, sizeof(sso.buff)); + memmove_P(sso.buff, rhs.sso.buff, sizeof(sso.buff)); } else { setSSO(false); setBuffer(rhs.wbuffer()); @@ -313,7 +313,7 @@ unsigned char String::concat(const String &s) { return 1; if (!reserve(newlen)) return 0; - memmove(wbuffer() + len(), buffer(), len()); + memmove_P(wbuffer() + len(), buffer(), len()); setLen(newlen); wbuffer()[len()] = 0; return 1; @@ -330,12 +330,7 @@ unsigned char String::concat(const char *cstr, unsigned int length) { return 1; if(!reserve(newlen)) return 0; - if (cstr >= wbuffer() && cstr < wbuffer() + len()) - // compatible with SSO in ram #6155 (case "x += x.c_str()") - memmove(wbuffer() + len(), cstr, length + 1); - else - // compatible with source in flash #6367 - memcpy_P(wbuffer() + len(), cstr, length + 1); + memmove_P(wbuffer() + len(), cstr, length + 1); setLen(newlen); return 1; } @@ -739,21 +734,21 @@ void String::replace(const String& find, const String& replace) { char *foundAt; if(diff == 0) { while((foundAt = strstr(readFrom, find.buffer())) != NULL) { - memmove(foundAt, replace.buffer(), replace.len()); + memmove_P(foundAt, replace.buffer(), replace.len()); readFrom = foundAt + replace.len(); } } else if(diff < 0) { char *writeTo = wbuffer(); while((foundAt = strstr(readFrom, find.buffer())) != NULL) { unsigned int n = foundAt - readFrom; - memmove(writeTo, readFrom, n); + memmove_P(writeTo, readFrom, n); writeTo += n; - memmove(writeTo, replace.buffer(), replace.len()); + memmove_P(writeTo, replace.buffer(), replace.len()); writeTo += replace.len(); readFrom = foundAt + find.len(); setLen(len() + diff); } - memmove(writeTo, readFrom, strlen(readFrom)+1); + memmove_P(writeTo, readFrom, strlen(readFrom)+1); } else { unsigned int size = len(); // compute size needed for result while((foundAt = strstr(readFrom, find.buffer())) != NULL) { @@ -767,9 +762,9 @@ void String::replace(const String& find, const String& replace) { int index = len() - 1; while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) { readFrom = wbuffer() + index + find.len(); - memmove(readFrom + diff, readFrom, len() - (readFrom - buffer())); + memmove_P(readFrom + diff, readFrom, len() - (readFrom - buffer())); int newLen = len() + diff; - memmove(wbuffer() + index, replace.buffer(), replace.len()); + memmove_P(wbuffer() + index, replace.buffer(), replace.len()); setLen(newLen); wbuffer()[newLen] = 0; index--; @@ -797,7 +792,7 @@ void String::remove(unsigned int index, unsigned int count) { char *writeTo = wbuffer() + index; unsigned int newlen = len() - count; setLen(newlen); - memmove(writeTo, wbuffer() + index + count, newlen - index); + memmove_P(writeTo, wbuffer() + index + count, newlen - index); wbuffer()[newlen] = 0; } @@ -829,7 +824,7 @@ void String::trim(void) { unsigned int newlen = end + 1 - begin; setLen(newlen); if(begin > buffer()) - memmove(wbuffer(), begin, newlen); + memmove_P(wbuffer(), begin, newlen); wbuffer()[newlen] = 0; } diff --git a/cores/esp8266/abi.cpp b/cores/esp8266/abi.cpp index 6a2c0928c..fe6335410 100644 --- a/cores/esp8266/abi.cpp +++ b/cores/esp8266/abi.cpp @@ -32,7 +32,7 @@ extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); -#ifndef __cpp_exceptions +#if !defined(__cpp_exceptions) && !defined(NEW_OOM_ABORT) void *operator new(size_t size) { void *ret = malloc(size); @@ -52,7 +52,7 @@ void *operator new[](size_t size) } return ret; } -#endif +#endif // arduino's std::new legacy void __cxa_pure_virtual(void) { diff --git a/cores/esp8266/core_esp8266_eboot_command.cpp b/cores/esp8266/core_esp8266_eboot_command.cpp index 44d65a8c3..2ddc65933 100644 --- a/cores/esp8266/core_esp8266_eboot_command.cpp +++ b/cores/esp8266/core_esp8266_eboot_command.cpp @@ -21,36 +21,15 @@ #include #include +#include "coredecls.h" #include "eboot_command.h" + extern "C" { -static uint32_t crc_update(uint32_t crc, const uint8_t *data, size_t length) -{ - uint32_t i; - bool bit; - uint8_t c; - - while (length--) { - c = *data++; - for (i = 0x80; i > 0; i >>= 1) { - bit = crc & 0x80000000; - if (c & i) { - bit = !bit; - } - crc <<= 1; - if (bit) { - crc ^= 0x04c11db7; - } - } - } - return crc; -} - static uint32_t eboot_command_calculate_crc32(const struct eboot_command* cmd) { - return crc_update(0xffffffff, (const uint8_t*) cmd, - offsetof(struct eboot_command, crc32)); + return crc32((const uint8_t*) cmd, offsetof(struct eboot_command, crc32)); } int eboot_command_read(struct eboot_command* cmd) diff --git a/cores/esp8266/core_esp8266_features.h b/cores/esp8266/core_esp8266_features.h index aff8fa4de..6b8e22c9b 100644 --- a/cores/esp8266/core_esp8266_features.h +++ b/cores/esp8266/core_esp8266_features.h @@ -32,8 +32,65 @@ #define WIFI_HAS_EVENT_CALLBACK +#ifdef __cplusplus +#include // malloc() +#include // size_t +namespace arduino +{ + extern "C++" + template + T* new0 (size_t n, TConstructorArgs... TconstructorArgs) + { + // n==0: single allocation, otherwise it is an array + size_t offset = n? sizeof(size_t): 0; + size_t arraysize = n? n: 1; + T* ptr = (T*)malloc(offset + (arraysize * sizeof(T))); + if (ptr) + { + if (n) + *(size_t*)(ptr) = n; + for (size_t i = 0; i < arraysize; i++) + new (ptr + offset + i * sizeof(T)) T(TconstructorArgs...); + return ptr + offset; + } + return nullptr; + } +} +#define arduino_new(Type, ...) arduino::new0(0, ##__VA_ARGS__) +#define arduino_newarray(Type, n, ...) arduino::new0(n, ##__VA_ARGS__) + +#endif // __cplusplus + +#ifndef __STRINGIFY +#define __STRINGIFY(a) #a #endif +// these low level routines provide a replacement for SREG interrupt save that AVR uses +// but are esp8266 specific. A normal use pattern is like +// +//{ +// uint32_t savedPS = xt_rsil(1); // this routine will allow level 2 and above +// // do work here +// xt_wsr_ps(savedPS); // restore the state +//} +// +// level (0-15), interrupts of the given level and above will be active +// level 15 will disable ALL interrupts, +// level 0 will enable ALL interrupts, +// +#ifndef CORE_MOCK +#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;})) +#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory") + +inline uint32_t esp_get_cycle_count() __attribute__((always_inline)); +inline uint32_t esp_get_cycle_count() { + uint32_t ccount; + __asm__ __volatile__("rsr %0,ccount":"=a"(ccount)); + return ccount; +} +#endif // not CORE_MOCK + +#endif // CORE_ESP8266_FEATURES_H diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp index 588019f0d..61c07da90 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -60,6 +60,13 @@ static os_event_t s_loop_queue[LOOP_QUEUE_SIZE]; /* Used to implement optimistic_yield */ static uint32_t s_micros_at_task_start; +/* For ets_intr_lock_nest / ets_intr_unlock_nest + * Max nesting seen by SDK so far is 2. + */ +#define ETS_INTR_LOCK_NEST_MAX 7 +static uint16_t ets_intr_lock_stack[ETS_INTR_LOCK_NEST_MAX]; +static byte ets_intr_lock_stack_ptr=0; + extern "C" { extern const uint32_t __attribute__((section(".ver_number"))) core_version = ARDUINO_ESP8266_GIT_VER; @@ -121,6 +128,35 @@ extern "C" void optimistic_yield(uint32_t interval_us) { } } + +// Replace ets_intr_(un)lock with nestable versions +extern "C" void IRAM_ATTR ets_intr_lock() { + if (ets_intr_lock_stack_ptr < ETS_INTR_LOCK_NEST_MAX) + ets_intr_lock_stack[ets_intr_lock_stack_ptr++] = xt_rsil(3); + else + xt_rsil(3); +} + +extern "C" void IRAM_ATTR ets_intr_unlock() { + if (ets_intr_lock_stack_ptr > 0) + xt_wsr_ps(ets_intr_lock_stack[--ets_intr_lock_stack_ptr]); + else + xt_rsil(0); +} + + +// Save / Restore the PS state across the rom ets_post call as the rom code +// does not implement this correctly. +extern "C" bool ets_post_rom(uint8 prio, ETSSignal sig, ETSParam par); + +extern "C" bool IRAM_ATTR ets_post(uint8 prio, ETSSignal sig, ETSParam par) { + uint32_t saved; + asm volatile ("rsr %0,ps":"=a" (saved)); + bool rc=ets_post_rom(prio, sig, par); + xt_wsr_ps(saved); + return rc; +} + extern "C" void __loop_end (void) { run_scheduled_functions(); diff --git a/cores/esp8266/core_esp8266_timer.cpp b/cores/esp8266/core_esp8266_timer.cpp index a2bce5500..efd528b66 100644 --- a/cores/esp8266/core_esp8266_timer.cpp +++ b/cores/esp8266/core_esp8266_timer.cpp @@ -48,7 +48,7 @@ void ICACHE_RAM_ATTR timer1_isr_init(){ ETS_FRC_TIMER1_INTR_ATTACH(timer1_isr_handler, NULL); } -void timer1_attachInterrupt(timercallback userFunc) { +void ICACHE_RAM_ATTR timer1_attachInterrupt(timercallback userFunc) { timer1_user_cb = userFunc; ETS_FRC1_INTR_ENABLE(); } @@ -59,7 +59,7 @@ void ICACHE_RAM_ATTR timer1_detachInterrupt() { ETS_FRC1_INTR_DISABLE(); } -void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){ +void ICACHE_RAM_ATTR timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){ T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR); T1I = 0; } @@ -90,11 +90,11 @@ void ICACHE_RAM_ATTR timer0_isr_handler(void* para){ } } -void timer0_isr_init(){ +void ICACHE_RAM_ATTR timer0_isr_init(){ ETS_CCOMPARE0_INTR_ATTACH(timer0_isr_handler, NULL); } -void timer0_attachInterrupt(timercallback userFunc) { +void ICACHE_RAM_ATTR timer0_attachInterrupt(timercallback userFunc) { timer0_user_cb = userFunc; ETS_CCOMPARE0_ENABLE(); } diff --git a/cores/esp8266/coredecls.h b/cores/esp8266/coredecls.h index 3ac87eee9..4a70609bf 100644 --- a/cores/esp8266/coredecls.h +++ b/cores/esp8266/coredecls.h @@ -8,6 +8,7 @@ extern "C" { // TODO: put declarations here, get rid of -Wno-implicit-function-declaration +#include #include #include // g_pcont declaration @@ -20,6 +21,7 @@ void settimeofday_cb (void (*cb)(void)); void disable_extra4k_at_link_time (void) __attribute__((noinline)); uint32_t sqrt32 (uint32_t n); +uint32_t crc32 (const void* data, size_t length, uint32_t crc = 0xffffffff); #ifdef __cplusplus } diff --git a/cores/esp8266/crc32.cpp b/cores/esp8266/crc32.cpp new file mode 100644 index 000000000..cc2a2ee64 --- /dev/null +++ b/cores/esp8266/crc32.cpp @@ -0,0 +1,42 @@ +/* + crc32.cpp + + Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "coredecls.h" + +// moved from core_esp8266_eboot_command.cpp +uint32_t crc32 (const void* data, size_t length, uint32_t crc /*= 0xffffffff*/) +{ + const uint8_t* ldata = (const uint8_t*)data; + while (length--) + { + uint8_t c = *ldata++; + for (uint32_t i = 0x80; i > 0; i >>= 1) + { + bool bit = crc & 0x80000000; + if (c & i) + bit = !bit; + crc <<= 1; + if (bit) + crc ^= 0x04c11db7; + } + } + return crc; +} diff --git a/cores/esp8266/uart.cpp b/cores/esp8266/uart.cpp index 6794c3358..30b375cba 100644 --- a/cores/esp8266/uart.cpp +++ b/cores/esp8266/uart.cpp @@ -495,7 +495,7 @@ uart_write(uart_t* uart, const char* buf, size_t size) size_t ret = size; const int uart_nr = uart->uart_nr; while (size--) - uart_do_write_char(uart_nr, *buf++); + uart_do_write_char(uart_nr, pgm_read_byte(buf++)); return ret; } diff --git a/cores/esp8266/umm_malloc/umm_malloc.cpp b/cores/esp8266/umm_malloc/umm_malloc.cpp index 09cfbdda7..13930a828 100644 --- a/cores/esp8266/umm_malloc/umm_malloc.cpp +++ b/cores/esp8266/umm_malloc/umm_malloc.cpp @@ -501,6 +501,13 @@ extern "C" { +#undef memcpy +#undef memmove +#undef memset +#define memcpy ets_memcpy +#define memmove ets_memmove +#define memset ets_memset + // From UMM, the last caller of a malloc/realloc/calloc which failed: extern void *umm_last_fail_alloc_addr; extern int umm_last_fail_alloc_size; @@ -519,8 +526,50 @@ extern int umm_last_fail_alloc_size; # define DBG_LOG_LEVEL DBG_LOG_LEVEL #endif -// Macro to place constant strings into PROGMEM and print them properly -#define printf(fmt, ...) printf(PSTR(fmt), ## __VA_ARGS__ ) +/* +Changes for July 2019: + + Correct critical section with interrupt level preserving and nest support + alternative. Replace ets_intr_lock()/ets_intr_unlock() with uint32_t + oldValue=xt_rsil(3)/xt_wrs(oldValue). Added UMM_CRITICAL_DECL macro to define + storage for current state. Expanded UMM_CRITICAL_... to use unique + identifiers. This helpt facilitate gather function specific timing + information. + + Replace printf with something that is ROM or IRAM based so that a printf + that occurs during an ISR malloc/new does not cause a crash. To avoid any + reentry issue it should also avoid doing malloc lib calls. + + Refactor realloc to avoid memcpy/memmove while in critical section. This is + only effective when realloc is called with interrupts enabled. The copy + process alone can take over 10us (when copying more than ~498 bytes with a + 80MHz CPU clock). It would be good practice for an ISR to avoid realloc. + Note, while doing this might initially sound scary, this appears to be very + stable. It ran on my troublesome sketch for over 3 weeks until I got back from + vacation and flashed an update. Troublesome sketch - runs ESPAsyncTCP, with + modified fauxmo emulation for 10 devices. It receives lost of Network traffic + related to uPnP scans, which includes lots of TCP connects disconnects RSTs + related to uPnP discovery. + + Locking is no longer nested in realloc, due to refactoring for reduced IRQ + off time. + + I have clocked umm_info critical lock time taking as much as 180us. A common + use for the umm_info call is to get the free heap result. It is common + to try and closely monitor free heap as a method to detect memory leaks. + This may result in frequent calls to umm_info. There has not been a clear + test case that shows an issue yet; however, I and others think they are or + have had crashes related to this. + + I have added code that updates a current free heap value from _umm_malloc, + _umm_realloc, and _umm_free. Removing the need to do a long interrupts + disabled calculation via umm_info. + + Build optional, min/max time measurements for locks held while in info, + malloc, realloc, and free. Also, maintains a count of how many times each is + called with INTLEVEL set. + + */ /* -- dbglog {{{ */ @@ -562,42 +611,42 @@ extern int umm_last_fail_alloc_size; /* ------------------------------------------------------------------------- */ #if DBG_LOG_LEVEL >= 6 -# define DBG_LOG_TRACE( format, ... ) printf( format, ## __VA_ARGS__ ) +# define DBG_LOG_TRACE( format, ... ) DBGLOG_FUNCTION( format, ## __VA_ARGS__ ) #else # define DBG_LOG_TRACE( format, ... ) #endif #if DBG_LOG_LEVEL >= 5 -# define DBG_LOG_DEBUG( format, ... ) printf( format, ## __VA_ARGS__ ) +# define DBG_LOG_DEBUG( format, ... ) DBGLOG_FUNCTION( format, ## __VA_ARGS__ ) #else # define DBG_LOG_DEBUG( format, ... ) #endif #if DBG_LOG_LEVEL >= 4 -# define DBG_LOG_CRITICAL( format, ... ) printf( format, ## __VA_ARGS__ ) +# define DBG_LOG_CRITICAL( format, ... ) DBGLOG_FUNCTION( format, ## __VA_ARGS__ ) #else # define DBG_LOG_CRITICAL( format, ... ) #endif #if DBG_LOG_LEVEL >= 3 -# define DBG_LOG_ERROR( format, ... ) printf( format, ## __VA_ARGS__ ) +# define DBG_LOG_ERROR( format, ... ) DBGLOG_FUNCTION( format, ## __VA_ARGS__ ) #else # define DBG_LOG_ERROR( format, ... ) #endif #if DBG_LOG_LEVEL >= 2 -# define DBG_LOG_WARNING( format, ... ) printf( format, ## __VA_ARGS__ ) +# define DBG_LOG_WARNING( format, ... ) DBGLOG_FUNCTION( format, ## __VA_ARGS__ ) #else # define DBG_LOG_WARNING( format, ... ) #endif #if DBG_LOG_LEVEL >= 1 -# define DBG_LOG_INFO( format, ... ) printf( format, ## __VA_ARGS__ ) +# define DBG_LOG_INFO( format, ... ) DBGLOG_FUNCTION( format, ## __VA_ARGS__ ) #else # define DBG_LOG_INFO( format, ... ) #endif -#define DBG_LOG_FORCE( force, format, ... ) {if(force) {printf( format, ## __VA_ARGS__ );}} +#define DBG_LOG_FORCE( force, format, ... ) {if(force) {DBGLOG_FUNCTION( format, ## __VA_ARGS__ );}} /* }}} */ @@ -646,6 +695,10 @@ unsigned short int umm_numblocks = 0; #define UMM_PFREE(b) (UMM_BLOCK(b).body.free.prev) #define UMM_DATA(b) (UMM_BLOCK(b).body.data) +/* + * This does not look safe, no access locks. It currently is not being + * built, so not an immediate issue. - 06/10/19 + */ /* integrity check (UMM_INTEGRITY_CHECK) {{{ */ #if defined(UMM_INTEGRITY_CHECK) /* @@ -686,7 +739,7 @@ static int integrity_check(void) { /* Check that next free block number is valid */ if (cur >= UMM_NUMBLOCKS) { - printf("heap integrity broken: too large next free num: %d " + DBGLOG_FUNCTION("heap integrity broken: too large next free num: %d " "(in block %d, addr 0x%lx)\n", cur, prev, (unsigned long)&UMM_NBLOCK(prev)); ok = 0; @@ -699,7 +752,7 @@ static int integrity_check(void) { /* Check if prev free block number matches */ if (UMM_PFREE(cur) != prev) { - printf("heap integrity broken: free links don't match: " + DBGLOG_FUNCTION("heap integrity broken: free links don't match: " "%d -> %d, but %d -> %d\n", prev, cur, cur, UMM_PFREE(cur)); ok = 0; @@ -718,7 +771,7 @@ static int integrity_check(void) { /* Check that next block number is valid */ if (cur >= UMM_NUMBLOCKS) { - printf("heap integrity broken: too large next block num: %d " + DBGLOG_FUNCTION("heap integrity broken: too large next block num: %d " "(in block %d, addr 0x%lx)\n", cur, prev, (unsigned long)&UMM_NBLOCK(prev)); ok = 0; @@ -733,7 +786,7 @@ static int integrity_check(void) { if ((UMM_NBLOCK(cur) & UMM_FREELIST_MASK) != (UMM_PBLOCK(cur) & UMM_FREELIST_MASK)) { - printf("heap integrity broken: mask wrong at addr 0x%lx: n=0x%x, p=0x%x\n", + DBGLOG_FUNCTION("heap integrity broken: mask wrong at addr 0x%lx: n=0x%x, p=0x%x\n", (unsigned long)&UMM_NBLOCK(cur), (UMM_NBLOCK(cur) & UMM_FREELIST_MASK), (UMM_PBLOCK(cur) & UMM_FREELIST_MASK) @@ -747,7 +800,7 @@ static int integrity_check(void) { /* Check if prev block number matches */ if (UMM_PBLOCK(cur) != prev) { - printf("heap integrity broken: block links don't match: " + DBGLOG_FUNCTION("heap integrity broken: block links don't match: " "%d -> %d, but %d -> %d\n", prev, cur, cur, UMM_PBLOCK(cur)); ok = 0; @@ -793,7 +846,7 @@ clean: */ static void dump_mem ( const unsigned char *ptr, size_t len ) { while (len--) { - printf(" 0x%.2x", (unsigned int)(*ptr++)); + DBGLOG_FUNCTION(" 0x%.2x", (unsigned int)(*ptr++)); } } @@ -824,11 +877,11 @@ static int check_poison( const unsigned char *ptr, size_t poison_size, } if (!ok) { - printf("there is no poison %s the block. " + DBGLOG_FUNCTION("there is no poison %s the block. " "Expected poison address: 0x%lx, actual data:", where, (unsigned long)ptr); dump_mem(ptr, poison_size); - printf("\n"); + DBGLOG_FUNCTION("\n"); } return ok; @@ -842,7 +895,7 @@ static int check_poison_block( umm_block *pblock ) { int ok = 1; if (pblock->header.used.next & UMM_FREELIST_MASK) { - printf("check_poison_block is called for free block 0x%lx\n", + DBGLOG_FUNCTION("check_poison_block is called for free block 0x%lx\n", (unsigned long)pblock); } else { /* the block is used; let's check poison */ @@ -851,7 +904,7 @@ static int check_poison_block( umm_block *pblock ) { pc_cur = pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE); if (!check_poison(pc_cur, UMM_POISON_SIZE_BEFORE, "before")) { - printf("block start: %08x\n", pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE); + DBGLOG_FUNCTION("block start: %08x\n", pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE); UMM_HEAP_CORRUPTION_CB(); ok = 0; goto clean; @@ -859,7 +912,7 @@ static int check_poison_block( umm_block *pblock ) { pc_cur = pc + *((UMM_POISONED_BLOCK_LEN_TYPE *)pc) - UMM_POISON_SIZE_AFTER; if (!check_poison(pc_cur, UMM_POISON_SIZE_AFTER, "after")) { - printf("block start: %08x\n", pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE); + DBGLOG_FUNCTION("block start: %08x\n", pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE); UMM_HEAP_CORRUPTION_CB(); ok = 0; goto clean; @@ -982,6 +1035,7 @@ static void *get_unpoisoned( void *vptr ) { UMM_HEAP_INFO ummHeapInfo; void ICACHE_FLASH_ATTR *umm_info( void *ptr, int force ) { + UMM_CRITICAL_DECL(id_info); unsigned short int blockNo = 0; @@ -990,7 +1044,7 @@ void ICACHE_FLASH_ATTR *umm_info( void *ptr, int force ) { } /* Protect the critical section... */ - UMM_CRITICAL_ENTRY(); + UMM_CRITICAL_ENTRY(id_info); /* * Clear out all of the entries in the ummHeapInfo structure before doing @@ -1051,7 +1105,7 @@ void ICACHE_FLASH_ATTR *umm_info( void *ptr, int force ) { if( ptr == &UMM_BLOCK(blockNo) ) { /* Release the critical section... */ - UMM_CRITICAL_EXIT(); + UMM_CRITICAL_EXIT(id_info); return( ptr ); } @@ -1104,8 +1158,23 @@ void ICACHE_FLASH_ATTR *umm_info( void *ptr, int force ) { ummHeapInfo.usedBlocks, ummHeapInfo.freeBlocks ); + if (ummHeapInfo.freeBlocks == ummStats.free_blocks) { + DBG_LOG_FORCE( force, "\nheap info Free blocks and heap statistics Free blocks match.\n"); + } else { + DBG_LOG_FORCE( force, "\nheap info Free blocks %5d != heap statistics Free Blocks %5d\n\n", + ummHeapInfo.freeBlocks, + ummStats.free_blocks ); + } + + DBG_LOG_FORCE( force, "\numm heap statistics:\n"); + DBG_LOG_FORCE( force, " Free Space %5u\n", ummStats.free_blocks * sizeof(umm_block)); + DBG_LOG_FORCE( force, " Low Watermark %5u\n", ummStats.free_blocks_min * sizeof(umm_block)); + DBG_LOG_FORCE( force, " MAX Alloc Request %5u\n", ummStats.alloc_max_size); + DBG_LOG_FORCE( force, " OOM Count %5u\n", ummStats.oom_count); + DBG_LOG_FORCE( force, " Size of umm_block %5u\n", sizeof(umm_block)); + /* Release the critical section... */ - UMM_CRITICAL_EXIT(); + UMM_CRITICAL_EXIT(id_info); return( NULL ); } @@ -1223,6 +1292,9 @@ void ICACHE_FLASH_ATTR umm_init( void ) { /* index of the latest `umm_block` */ const unsigned short int block_last = UMM_NUMBLOCKS - 1; + /* init ummStats */ + ummStats.free_blocks = ummStats.free_blocks_min = block_last; + /* setup the 0th `umm_block`, which just points to the 1st */ UMM_NBLOCK(block_0th) = block_1th; UMM_NFREE(block_0th) = block_1th; @@ -1266,6 +1338,7 @@ void ICACHE_FLASH_ATTR umm_init( void ) { /* ------------------------------------------------------------------------ */ static void _umm_free( void *ptr ) { + UMM_CRITICAL_DECL(id_free); unsigned short int c; @@ -1286,15 +1359,18 @@ static void _umm_free( void *ptr ) { * on the free list! */ - /* Protect the critical section... */ - UMM_CRITICAL_ENTRY(); - /* Figure out which block we're in. Note the use of truncated division... */ c = (((char *)ptr)-(char *)(&(umm_heap[0])))/sizeof(umm_block); DBG_LOG_DEBUG( "Freeing block %6d\n", c ); + /* Protect the critical section... */ + UMM_CRITICAL_ENTRY(id_free); + + /* Update heap statistics */ + ummStats.free_blocks += (UMM_NBLOCK(c) - c); + /* Now let's assimilate this block with the next one if possible. */ umm_assimilate_up( c ); @@ -1346,12 +1422,14 @@ static void _umm_free( void *ptr ) { #endif /* Release the critical section... */ - UMM_CRITICAL_EXIT(); + UMM_CRITICAL_EXIT(id_free); } /* ------------------------------------------------------------------------ */ static void *_umm_malloc( size_t size ) { + UMM_CRITICAL_DECL(id_malloc); + unsigned short int blocks; unsigned short int blockSize = 0; @@ -1377,8 +1455,8 @@ static void *_umm_malloc( size_t size ) { return( (void *)NULL ); } - /* Protect the critical section... */ - UMM_CRITICAL_ENTRY(); + if ( size > ummStats.alloc_max_size ) + ummStats.alloc_max_size = size; blocks = umm_blocks( size ); @@ -1390,6 +1468,9 @@ static void *_umm_malloc( size_t size ) { * algorithm */ + /* Protect the critical section... */ + UMM_CRITICAL_ENTRY(id_malloc); + cf = UMM_NFREE(0); bestBlock = UMM_NFREE(0); @@ -1462,19 +1543,27 @@ static void *_umm_malloc( size_t size ) { UMM_PFREE( UMM_NFREE(cf) ) = cf + blocks; UMM_NFREE( cf + blocks ) = UMM_NFREE(cf); } + + /* Update heap statistics */ + ummStats.free_blocks -= blocks; + if (ummStats.free_blocks < ummStats.free_blocks_min) + ummStats.free_blocks_min = ummStats.free_blocks; + } else { + ummStats.oom_count += 1; + + /* Release the critical section... */ + UMM_CRITICAL_EXIT(id_malloc); + /* Out of memory */ DBG_LOG_DEBUG( "Can't allocate %5d blocks\n", blocks ); - /* Release the critical section... */ - UMM_CRITICAL_EXIT(); - return( (void *)NULL ); } /* Release the critical section... */ - UMM_CRITICAL_EXIT(); + UMM_CRITICAL_EXIT(id_malloc); return( (void *)&UMM_DATA(cf) ); } @@ -1482,10 +1571,10 @@ static void *_umm_malloc( size_t size ) { /* ------------------------------------------------------------------------ */ static void *_umm_realloc( void *ptr, size_t size ) { + UMM_CRITICAL_DECL(id_realloc); unsigned short int blocks; unsigned short int blockSize; - unsigned short int c; size_t curSize; @@ -1522,8 +1611,33 @@ static void *_umm_realloc( void *ptr, size_t size ) { return( (void *)NULL ); } - /* Protect the critical section... */ - UMM_CRITICAL_ENTRY(); + if ( size > ummStats.alloc_max_size ) + ummStats.alloc_max_size = size; + + /* + * Defer starting critical section. + * + * Initially we should be safe without a critical section as long as we are + * referencing values that are within our allocation as constants. + * And only reference values that will not change, while the redefintions of + * the allocations around us change. + * + * Example UMM_PBLOCK() could be change by a call to malloc from an ISR. + * On the other hand UMM_NBLOCK() is safe returns an address of the next + * block. The calculation is all based on information within our allocation + * that remains constant, until we change it. + * + * As long as we don't try to modify the next block or walk the chain of + * blocks we are okay. + * + * When called by an "interrupts enabled" type caller, it bears the + * responsibility to not call again, with the allocate we are currently + * working on. I think this is a normal expectation. I could be wrong. + * Such a situation would involve a function that is called from foreground + * and ISR context. Such code would already have to be re-entrant. This + * change may expand the corner cases for such a function. + * + */ /* * Otherwise we need to actually do a reallocation. A naiive approach @@ -1559,12 +1673,12 @@ static void *_umm_realloc( void *ptr, size_t size ) { DBG_LOG_DEBUG( "realloc the same size block - %d, do nothing\n", blocks ); - /* Release the critical section... */ - UMM_CRITICAL_EXIT(); - return( ptr ); } + /* Now we need a critical section... */ + UMM_CRITICAL_ENTRY(id_realloc); + /* * Now we have a block size that could be bigger or smaller. Either * way, try to assimilate up to the next block before doing anything... @@ -1573,7 +1687,13 @@ static void *_umm_realloc( void *ptr, size_t size ) { * assimilation step later in free :-) */ - umm_assimilate_up( c ); + if( UMM_NBLOCK(UMM_NBLOCK(c)) & UMM_FREELIST_MASK ) { + // This will often be most of the free heap. The excess is + // restored when umm_free() is called before returning. + ummStats.free_blocks -= + (UMM_NBLOCK(UMM_NBLOCK(c)) & UMM_BLOCKNO_MASK) - UMM_NBLOCK(c); + umm_assimilate_up( c ); + } /* * Now check if it might help to assimilate down, but don't actually @@ -1589,6 +1709,17 @@ static void *_umm_realloc( void *ptr, size_t size ) { DBG_LOG_DEBUG( "realloc() could assimilate down %d blocks - fits!\n\r", c-UMM_PBLOCK(c) ); + /* + * Calculate the number of blocks to keep while the information is + * still available. + */ + + unsigned short int prevBlockSize = c - UMM_PBLOCK(c); + ummStats.free_blocks -= prevBlockSize; + unsigned short int prelimBlockSize = blockSize + prevBlockSize; + if(prelimBlockSize < blocks) + prelimBlockSize = blocks; + /* Disconnect the previous block from the FREE list */ umm_disconnect_from_free_list( UMM_PBLOCK(c) ); @@ -1600,6 +1731,29 @@ static void *_umm_realloc( void *ptr, size_t size ) { c = umm_assimilate_down(c, 0); + /* + * Currently all or most of the heap has been grabbed. Do an early split of + * allocation down to the amount needed to do a successful move operation. + * This will allow an alloc/new from a ISR to succeed while a memmove is + * running. + */ + if( (UMM_NBLOCK(c) - c) > prelimBlockSize ) { + umm_make_new_block( c, prelimBlockSize, 0, 0 ); + _umm_free( (void *)&UMM_DATA(c+prelimBlockSize) ); + } + + // This is the lowest low that may be seen by an ISR doing an alloc/new + if( ummStats.free_blocks < ummStats.free_blocks_min ) + ummStats.free_blocks_min = ummStats.free_blocks; + + /* + * For the ESP8266 interrupts should not be off for more than 10us. + * An unprotect/protect around memmove should be safe to do here. + * All variables used are on the stack. + */ + + UMM_CRITICAL_EXIT(id_realloc); + /* * Move the bytes down to the new block we just created, but be sure to move * only the original bytes. @@ -1610,6 +1764,9 @@ static void *_umm_realloc( void *ptr, size_t size ) { /* And don't forget to adjust the pointer to the new block location! */ ptr = (void *)&UMM_DATA(c); + + /* Now resume critical section... */ + UMM_CRITICAL_ENTRY(id_realloc); } /* Now calculate the block size again...and we'll have three cases */ @@ -1634,6 +1791,9 @@ static void *_umm_realloc( void *ptr, size_t size ) { } else { /* New block is bigger than the old block... */ + /* Finish up without critical section */ + UMM_CRITICAL_EXIT(id_realloc); + void *oldptr = ptr; DBG_LOG_DEBUG( "realloc %d to a bigger block %d, make new, copy, and free the old\n", blockSize, blocks ); @@ -1646,12 +1806,18 @@ static void *_umm_realloc( void *ptr, size_t size ) { if( (ptr = _umm_malloc( size )) ) { memcpy( ptr, oldptr, curSize ); _umm_free( oldptr ); + } else { + ummStats.oom_count += 1; // Needs atomic } + return( ptr ); } + if (ummStats.free_blocks < ummStats.free_blocks_min) + ummStats.free_blocks_min = ummStats.free_blocks; + /* Release the critical section... */ - UMM_CRITICAL_EXIT(); + UMM_CRITICAL_EXIT(id_realloc); return( ptr ); } @@ -1766,8 +1932,16 @@ void umm_free( void *ptr ) { /* ------------------------------------------------------------------------ */ size_t ICACHE_FLASH_ATTR umm_free_heap_size( void ) { - umm_info(NULL, 0); - return (size_t)ummHeapInfo.freeBlocks * sizeof(umm_block); + return (size_t)ummStats.free_blocks * sizeof(umm_block); +} + +size_t ICACHE_FLASH_ATTR umm_free_heap_size_min( void ) { + return (size_t)ummStats.free_blocks_min * sizeof(umm_block); +} + +size_t ICACHE_FLASH_ATTR umm_free_heap_size_min_reset( void ) { + ummStats.free_blocks_min = ummStats.free_blocks; + return (size_t)ummStats.free_blocks_min * sizeof(umm_block); } size_t ICACHE_FLASH_ATTR umm_max_block_size( void ) { diff --git a/cores/esp8266/umm_malloc/umm_malloc_cfg.h b/cores/esp8266/umm_malloc/umm_malloc_cfg.h index 14fb4a8e4..39d5897cc 100644 --- a/cores/esp8266/umm_malloc/umm_malloc_cfg.h +++ b/cores/esp8266/umm_malloc/umm_malloc_cfg.h @@ -10,10 +10,25 @@ extern "C" { #endif +#include #include #include #include "c_types.h" +#include "umm_performance.h" +#include "umm_stats.h" + +#undef DBGLOG_FUNCTION +#if defined(DEBUG_ESP_PORT) || defined(DEBUG_ESP_ISR) +int _isr_safe_printf_P(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +// Note, _isr_safe_printf_P will not handle additional string arguments in +// PROGMEM. Only the 1st parameter, fmt, is supported in PROGMEM. +#define DBGLOG_FUNCTION(fmt, ...) _isr_safe_printf_P(PSTR(fmt), ##__VA_ARGS__) +#else +// Macro to place constant strings into PROGMEM and print them properly +#define DBGLOG_FUNCTION(fmt, ...) printf(PSTR(fmt), ## __VA_ARGS__ ) +#endif + /* * There are a number of defines you can set at compile time that affect how * the memory allocator will operate. @@ -110,8 +125,22 @@ extern char _heap_start[]; * called from within umm_malloc() */ -#define UMM_CRITICAL_ENTRY() ets_intr_lock() -#define UMM_CRITICAL_EXIT() ets_intr_unlock() + +#if defined(UMM_CRITICAL_PERIOD_ANALYZE) + +#define UMM_CRITICAL_DECL(tag) uint32_t _saved_ps_##tag +#define UMM_CRITICAL_ENTRY(tag) _critical_entry(&time_stats.tag, &_saved_ps_##tag) +#define UMM_CRITICAL_EXIT(tag) _critical_exit(&time_stats.tag, &_saved_ps_##tag) + +#else + +// This method preserves the intlevel on entry and restores the +// original intlevel at exit. +#define UMM_CRITICAL_DECL(tag) uint32_t _saved_ps_##tag +#define UMM_CRITICAL_ENTRY(tag) _saved_ps_##tag = xt_rsil(DEFAULT_CRITICAL_SECTION_INTLEVEL) +#define UMM_CRITICAL_EXIT(tag) xt_wsr_ps(_saved_ps_##tag) + +#endif /* * -D UMM_INTEGRITY_CHECK : diff --git a/cores/esp8266/umm_malloc/umm_performance.cpp b/cores/esp8266/umm_malloc/umm_performance.cpp new file mode 100644 index 000000000..4b9ec4e6b --- /dev/null +++ b/cores/esp8266/umm_malloc/umm_performance.cpp @@ -0,0 +1,81 @@ +/* + * umm_malloc performance measurments and ESP specifics + */ + +#include +#include +#include +#include +#include "umm_performance.h" +#include "umm_stats.h" + +extern "C" { + +UMM_STATS ummStats = {0, 0, 0, 0}; + +#ifdef UMM_CRITICAL_PERIOD_ANALYZE +struct _UMM_TIME_STATS time_stats = { + {0xFFFFFFFF, 0U, 0U, 0U}, + {0xFFFFFFFF, 0U, 0U, 0U}, + {0xFFFFFFFF, 0U, 0U, 0U}, + {0xFFFFFFFF, 0U, 0U, 0U} }; + +bool ICACHE_FLASH_ATTR get_umm_get_perf_data(struct _UMM_TIME_STATS *p, size_t size) { + if (p && sizeof(time_stats) == size) { + uint32_t save_ps = xt_rsil(DEFAULT_CRITICAL_SECTION_INTLEVEL); + memcpy(p, &time_stats, size); + xt_wsr_ps(save_ps); + return true; + } + return false; +} +#endif + +#if defined(DEBUG_ESP_PORT) || defined(DEBUG_ESP_ISR) +/* + Printing from the malloc routines is tricky. Since a lot of library calls + will want to do malloc. + + Objective: To be able to print "last gasp" diagnostic messages + when interrupts are disabled and w/o availability of heap resources. +*/ + +// ROM _putc1, ignores CRs and sends CR/LF for LF, newline. +// Always returns character sent. +int constexpr (*_rom_putc1)(int) = (int (*)(int))0x40001dcc; +void uart_buff_switch(uint8_t); + +int _isr_safe_printf_P(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +int ICACHE_RAM_ATTR _isr_safe_printf_P(const char *fmt, ...) { +#ifdef DEBUG_ESP_PORT +#define VALUE(x) __STRINGIFY(x) + // Preprocessor and compiler together will optimize away the if. + if (strcmp("Serial1", VALUE(DEBUG_ESP_PORT)) == 0) { + uart_buff_switch(1U); + } else { + uart_buff_switch(0U); + } +#else + uart_buff_switch(0U); // Side effect, clears RX FIFO +#endif + /* + To use ets_strlen() and ets_memcpy() safely with PROGMEM, flash storage, + the PROGMEM address must be word (4 bytes) aligned. The destination + address for ets_memcpy must also be word-aligned. We also round the + buf_len up to the nearest word boundary. So that all transfers will be + whole words. + */ + size_t str_len = ets_strlen(fmt); + size_t buf_len = (str_len + 1 + 3) & ~0x03U; + char ram_buf[buf_len] __attribute__ ((aligned(4))); + ets_memcpy(ram_buf, fmt, buf_len); + va_list argPtr; + va_start(argPtr, fmt); + int result = ets_vprintf(_rom_putc1, ram_buf, argPtr); + va_end(argPtr); + return result; +} + +#endif + +}; diff --git a/cores/esp8266/umm_malloc/umm_performance.h b/cores/esp8266/umm_malloc/umm_performance.h new file mode 100644 index 000000000..5d6ae24c6 --- /dev/null +++ b/cores/esp8266/umm_malloc/umm_performance.h @@ -0,0 +1,85 @@ +/* + * umm_malloc performance measurments and ESP specifics + */ + +#ifndef _UMM_PERFORMANCE_H +#define _UMM_PERFORMANCE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * -D UMM_CRITICAL_PERIOD_ANALYZE : + * + * Build option to collect timing usage data on critical section usage in + * functions: info, malloc, realloc. Collects MIN, MAX, and number of time + * IRQs were disabled at request time. Note, for realloc MAX disabled time + * will not include the time from calling malloc and/or free. + * Examine code for specifics on what info is available and how to access. +*/ +// #define UMM_CRITICAL_PERIOD_ANALYZE + + +/* + Per Devyte, the core currently doesn't support masking a specific interrupt + level. That doesn't mean it can't be implemented, only that at this time + locking is implemented as all or nothing. + https://github.com/esp8266/Arduino/issues/6246#issuecomment-508612609 + + So for now we default to all, 15. + */ +#ifndef DEFAULT_CRITICAL_SECTION_INTLEVEL +#define DEFAULT_CRITICAL_SECTION_INTLEVEL 15 +#endif + +#if defined(UMM_CRITICAL_PERIOD_ANALYZE) +// This option adds support for gathering time locked data +typedef struct _TIME_STAT { + uint32_t min; + uint32_t max; + uint32_t start; + uint32_t intlevel; +} time_stat_t; + +struct _UMM_TIME_STATS { + time_stat_t id_malloc; + time_stat_t id_realloc; + time_stat_t id_free; + time_stat_t id_info; +}; + +extern struct _UMM_TIME_STATS time_stats; + +bool get_umm_get_perf_data(struct _UMM_TIME_STATS *p, size_t size); + +static inline void _critical_entry(time_stat_t *p, uint32_t *saved_ps) { + *saved_ps = xt_rsil(DEFAULT_CRITICAL_SECTION_INTLEVEL); + if (0U != (*saved_ps & 0x0FU)) { + p->intlevel += 1U; + } + + p->start = esp_get_cycle_count(); +} + +static inline void _critical_exit(time_stat_t *p, uint32_t *saved_ps) { + uint32_t elapse = esp_get_cycle_count() - p->start; + if (elapse < p->min) + p->min = elapse; + + if (elapse > p->max) + p->max = elapse; + + xt_wsr_ps(*saved_ps); +} +#endif + +#if defined(DEBUG_ESP_PORT) || defined(DEBUG_ESP_ISR) +int _isr_safe_printf_P(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _UMM_PERFORMANCE_H */ diff --git a/cores/esp8266/umm_malloc/umm_stats.h b/cores/esp8266/umm_malloc/umm_stats.h new file mode 100644 index 000000000..f2aae9875 --- /dev/null +++ b/cores/esp8266/umm_malloc/umm_stats.h @@ -0,0 +1,36 @@ +/* + * umm_malloc heap statistics + */ + +#ifndef _UMM_STATS_H +#define _UMM_STATS_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct UMM_STATS_t { + unsigned short int free_blocks; + unsigned short int free_blocks_min; + size_t alloc_max_size; + size_t oom_count; +} UMM_STATS; +extern UMM_STATS ummStats; + +size_t ICACHE_FLASH_ATTR umm_free_heap_size_min( void ); +size_t ICACHE_FLASH_ATTR umm_free_heap_size_min_reset( void ); + +inline size_t umm_get_max_alloc_size( void ) { + return ummStats.alloc_max_size; +} + +inline size_t umm_get_oom_count( void ) { + return ummStats.oom_count; +} + + +#ifdef __cplusplus +} +#endif + +#endif /* _UMM_STATS_H */ diff --git a/doc/eclipse/makefile.init b/doc/eclipse/makefile.init index 76438d62c..852bb8aab 100644 --- a/doc/eclipse/makefile.init +++ b/doc/eclipse/makefile.init @@ -14,7 +14,7 @@ ESP8266_BASE = $(ARDUINO_BASE)/hardware/esp8266com/esp8266 ESP8266_TOOLS = $(ESP8266_BASE)/tools XTENSA_TOOLS_ROOT = $(ESP8266_TOOLS)/xtensa-lx106-elf/bin -PYTHON_BIN = python +PYTHON_BIN = python3 ESPTOOL_PY_BIN = $(ESP8266_TOOLS)/esptool.py ESPOTA_PY_BIN = $(ESP8266_TOOLS)/espota.py ESPTOOL_BIN = $(ESP8266_TOOLS)/esptool/esptool.exe diff --git a/doc/installing.rst b/doc/installing.rst index a2c2b00e2..1c6317d2b 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -43,7 +43,7 @@ Prerequisites - Arduino 1.6.8 (or newer, current working version is 1.8.5) - git -- Python 2.7 (https://python.org) +- Python 3.x (https://python.org) - terminal, console, or command prompt (depending on your OS) - Internet connection @@ -110,7 +110,7 @@ Instructions - Windows 10 .. code:: bash cd esp8266/tools - python get.py + python3 get.py - Restart Arduino @@ -184,7 +184,7 @@ Instructions - Other OS .. code:: bash cd esp8266/tools - python get.py + python3 get.py - Restart Arduino diff --git a/doc/libraries.rst b/doc/libraries.rst index d53d0e87d..a7c3ab0e6 100644 --- a/doc/libraries.rst +++ b/doc/libraries.rst @@ -11,7 +11,7 @@ ESP8266WiFi library has been developed basing on ESP8266 SDK, using naming conve Ticker ------ -Library for calling functions repeatedly with a certain period. `Two examples `__ included. +Library for calling functions repeatedly with a certain period. `Three examples `__ included. It is currently not recommended to do blocking IO operations (network, serial, file) from Ticker callback functions. Instead, set a flag inside the ticker callback and check for that flag inside the loop function. diff --git a/doc/ota_updates/readme.rst b/doc/ota_updates/readme.rst index bec4fba2e..67f4f9110 100644 --- a/doc/ota_updates/readme.rst +++ b/doc/ota_updates/readme.rst @@ -5,7 +5,7 @@ OTA Updates Introduction ------------ -OTA (Over the Air) update is the process of loading the firmware to ESP module using Wi-Fi connection rather than a serial port. Such functionality became extremely useful in case of limited or no physical access to the module. +OTA (Over the Air) update is the process of uploading firmware to an ESP module using a Wi-Fi connection rather than a serial port. Such functionality becomes extremely useful in case of limited or no physical access to the module. OTA may be done using: @@ -13,23 +13,23 @@ OTA may be done using: - `Web Browser <#web-browser>`__ - `HTTP Server <#http-server>`__ -Arduino IDE option is intended primarily for software development phase. The two other options would be more useful after deployment, to provide module with application updates manually with a web browser, or automatically using a http server. +The Arduino IDE option is intended primarily for the software development phase. The other two options would be more useful after deployment, to provide the module with application updates either manually with a web browser, or automatically using an HTTP server. -In any case, the first firmware upload has to be done over a serial port. If the OTA routines are correctly implemented in a sketch, then all subsequent uploads may be done over the air. +In any case, the first firmware upload has to be done over a serial port. If the OTA routines are correctly implemented in the sketch, then all subsequent uploads may be done over the air. -By default there is no imposed security on OTA process. It is up to developer to ensure that updates are allowed only from legitimate / trusted sources. Once the update is complete, the module restarts, and the new code is executed. The developer should ensure that the application running on the module is shut down and restarted in a safe manner. Chapters below provide additional information regarding security and safety of OTA process. +By default, there is no imposed security for the OTA process. It is up to the developer to ensure that updates are allowed only from legitimate / trusted sources. Once the update is complete, the module restarts, and the new code is executed. The developer should ensure that the application running on the module is shut down and restarted in a safe manner. Chapters below provide additional information regarding security and safety of OTA updates. Security Disclaimer ~~~~~~~~~~~~~~~~~~~ -No guarantees as to the level of security provided for your application by the following methods is implied. Please refer to the GNU LGPL license associated for this project for full disclaimers. If you do find security weaknesses, please don't hesitate to contact the maintainers or supply pull requests with fixes. The MD5 verification and password protection schemes are already known as supplying a very weak level of security. +No guarantees as to the level of security provided for your application by the following methods is implied. Please refer to the GNU LGPL license associated for this project for full disclaimers. If you do find security weaknesses, please don't hesitate to contact the maintainers or supply pull requests with fixes. The MD5 verification and password protection schemes are already known to supply a very weak level of security. Basic Security ~~~~~~~~~~~~~~ -The module has to be exposed wirelessly to get it updated with a new sketch. That poses chances of module being violently hacked and loaded with some other code. To reduce likelihood of being hacked consider protecting your uploads with a password, selecting certain OTA port, etc. +The module has to be exposed wirelessly to get it updated with a new sketch. That poses a risk of the module being violently hacked and programmed with some other code. To reduce the likelihood of being hacked, consider protecting your uploads with a password, selecting certain OTA port, etc. -Check functionality provided with `ArduinoOTA `__ library that may improve security: +Check functionality provided with the `ArduinoOTA `__ library that may improve security: .. code:: cpp @@ -37,38 +37,38 @@ Check functionality provided with `ArduinoOTA `__ and espota.py use `Digest-MD5 `__ to authenticate upload. Integrity of transferred data is verified on ESP side using `MD5 `__ checksum. +Certain basic protection is already built in and does not require any additional coding by the developer. `ArduinoOTA `__ and espota.py use `Digest-MD5 `__ to authenticate uploads. Integrity of transferred data is verified on the ESP side using `MD5 `__ checksum. -Make your own risk analysis and depending on application decide what library functions to implement. If required, consider implementation of other means of protection from being hacked, e.g. exposing module for uploads only according to specific schedule, trigger OTA only be user pressing dedicated “Update” button wired to ESP, etc. +Make your own risk analysis and, depending on the application, decide what library functions to implement. If required, consider implementation of other means of protection from being hacked, like exposing modules for uploads only according to a specific schedule, triggering OTA only when the user presses a dedicated “Update” button wired to the ESP, etc. Advanced Security - Signed Updates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -While the above password-based security will dissuade casual hacking attempts, it is not highly secure. For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. It uses SHA256 hashing in place of MD5 (which is known to be cryptographically broken) and RSA-2048 bit level encryption to guarantee only the holder of a cryptographic private key can generate code accepted by the OTA update mechanisms. +While the above password-based security will dissuade casual hacking attempts, it is not highly secure. For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. This uses SHA256 hashing in place of MD5 (which is known to be cryptographically broken) and RSA-2048 bit level encryption to guarantee that only the holder of a cryptographic private key can generate code accepted by the OTA update mechanisms. -These are updates whose compiled binary are signed with a private key (held by the developer) and verified with a public key (stored in the application and available for all to see). The signing process computes a hash of the binary code, encrypts the hash with the developer's private key, and appends this encrypted hash to the binary that is uploaded (via OTA, web, or HTTP server). If the code is modified or replaced in any way by anyone by the developer with the key, the hash will not match and the ESP8266 will reject the upload and not accept it. +Signed updates are updates whose compiled binaries are signed with a private key (held by the developer) and verified with a public key (stored in the application and available for all to see). The signing process computes a hash of the binary code, encrypts the hash with the developer's private key, and appends this encrypted hash to the binary that is uploaded (via OTA, web, or HTTP server). If the code is modified or replaced in any way by anyone except the holder of the developer's private key, the hash will not match and the ESP8266 will reject the upload. -Cryptographic signing only protects against tampering of binaries delivered OTA. If someone has physical access they will always be able to flash the device over the serial port. Signing also does not encrypt anything but the hash (so that it can't be modified), so this does not provide protection for code inside the device. Again, if a user has physical access they can read out your program. +Cryptographic signing only protects against tampering with binaries delivered via OTA. If someone has physical access, they will always be able to flash the device over the serial port. Signing also does not encrypt anything but the hash (so that it can't be modified), so this does not protect code inside the device: if a user has physical access they can read out your program. -**Securing your private key is paramount. The same private/public keypair needs to be used to sign binaries as the original upload. Loss of the private key associated with a binary means that you will not be able to OTA to update any of your devices in the field. Alternatively, if the private key is copied, then the copy can be used to sign binaries which will be accepted.** +**Securing your private key is paramount. The same private/public keypair that was used with the original upload must also be used to sign later binaries. Loss of the private key associated with a binary means that you will not be able to OTA-update any of your devices in the field. Alternatively, if someone else copies the private key, then they will be able to use it to sign binaries which will be accepted by the ESP.** Signed Binary Format ^^^^^^^^^^^^^^^^^^^^ The format of a signed binary is compatible with the standard binary format, and can be uploaded to a non-signed ESP8266 via serial or OTA without any conditions. Note, however, that once an unsigned OTA app is overwritten by this signed version, further updates will require signing. -As shown below, the signed hash is appended to the unsigned binary followed by the total length of the signed hash (i.e. if the signed hash was 64 bytes, then this uint32 will contain 64). This format allows for extensibility (such as adding in a CA-based validation scheme allowing multiple signing keys all based off of a trust anchor), and pull requests are always welcome. +As shown below, the signed hash is appended to the unsigned binary, followed by the total length of the signed hash (i.e., if the signed hash was 64 bytes, then this uint32 data segment will contain 64). This format allows for extensibility (such as adding a CA-based validation scheme allowing multiple signing keys all based on a trust anchor). Pull requests are always welcome. .. code:: bash NORMAL-BINARY -Signed Binary Prequisites -^^^^^^^^^^^^^^^^^^^^^^^^^ +Signed Binary Prerequisites +^^^^^^^^^^^^^^^^^^^^^^^^^^^ OpenSSL is required to run the standard signing steps, and should be available on any UNIX-like or Windows system. As usual, the latest stable version of OpenSSL is recommended. -Signing requires the generation of an RSA-2048 key (other bit lengths are supported as well, but 2048 is a good selection today) using any appropriate tool. The following lines will generate a new public/private keypair. Run them in the sketch directory: +Signing requires the generation of an RSA-2048 key (other bit lengths are supported as well, but 2048 is a good selection today) using any appropriate tool. The following shell commands will generate a new public/private keypair. Run them in the sketch directory: .. code:: bash @@ -78,9 +78,9 @@ Signing requires the generation of an RSA-2048 key (other bit lengths are suppor Automatic Signing -- Only available on Linux and Mac ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The simplest way of implementing signing is to use the automatic mode, which is only possible on Linux and Mac presently due to missing tools under Windows. This mode uses the IDE to configure the source code to enable sigining verification with a given public key, and signs binaries as part of the standard build process using a given public key. +The simplest way of implementing signing is to use the automatic mode, which presently is only possible on Linux and Mac due to some of the tools not being available for Windows. This mode uses the IDE to configure the source code to enable sigining verification with a given public key, and signs binaries as part of the standard build process using a given public key. -To enable this mode, just include `private.key` and `public.key` in the sketch `.ino` directory. The IDE will call a helper script (`tools/signing.py`) before the build begins to create a header to enable key validation using the given public key, and after the build process to actually do the signing, generating a `sketch.bin.signed` file. When OTA is enabled (ArduinoOTA, Web, or HTTP) the binary will only accept signed updates automatically. +To enable this mode, just include `private.key` and `public.key` in the sketch `.ino` directory. The IDE will call a helper script (`tools/signing.py`) before the build begins to create a header to enable key validation using the given public key, and to actually do the signing after the build process, generating a `sketch.bin.signed` file. When OTA is enabled (ArduinoOTA, Web, or HTTP), the binary will automatically only accept signed updates. When the signing process starts, the message: @@ -88,7 +88,7 @@ When the signing process starts, the message: Enabling binary signing -Will appear in the IDE window before a compile is launched, and at the completion of the build the signed binary file well be displayed in the IDE build window as: +will appear in the IDE window before a compile is launched. At the completion of the build, the signed binary file well be displayed in the IDE build window as: .. code:: bash @@ -102,10 +102,10 @@ If you receive either of the following messages in the IDE window, the signing w ... or ... Not signing the generated binary -Manual Signing Binaries -^^^^^^^^^^^^^^^^^^^^^^^ +Manual Signing of Binaries +^^^^^^^^^^^^^^^^^^^^^^^^^^ -Users may also manually sign executables and require the OTA process to verify their signature. In the main code, before enabling any update methods, add the call: +Users may also manually sign executables and require the OTA process to verify their signature. In the main code, before enabling any update methods, add the following declarations and function call: .. code:: cpp @@ -117,7 +117,7 @@ Users may also manually sign executables and require the OTA process to verify t Update.installSignature( &hash, &sign ); -The above snipped creates a BearSSL public key, a SHA256 hash verifier, and tells the Update object to use them to validate any updates it receives from any method. +The above snippet creates a BearSSL public key and a SHA256 hash verifier, and tells the Update object to use them to validate any updates it receives from any method. Compile the sketch normally and, once a `.bin` file is available, sign it using the signer script: @@ -140,11 +140,11 @@ To create a legacy signature, call the signing script with --legacy: Safety ~~~~~~ -OTA process takes ESP’s resources and bandwidth during upload. Then module is restarted and a new sketch executed. Analyse and test how it affects functionality of existing and new sketch. +The OTA process consumes some of the ESP’s resources and bandwidth during upload. Then, the module is restarted and a new sketch executed. Analyse and test how this affects the functionality of the existing and new sketches. -If ESP is placed in remote location and controlling some equipment, you should put additional attention what happens if operation of this equipment is suddenly interrupted by update process. Therefore, decide how to put this equipment into safe state before starting the update. For instance, your module may be controlling a garden watering system in a sequence. If this sequence is not properly shut down and a water valve left open, your garden may be flooded. +If the ESP is in a remote location and controlling some equipment, you should devote additional attention to what happens if operation of this equipment is suddenly interrupted by the update process. Therefore, decide how to put this equipment into a safe state before starting the update. For instance, your module may be controlling a garden watering system in a sequence. If this sequence is not properly shut down and a water valve is left open, the garden may be flooded. -The following functions are provided with `ArduinoOTA `__ library and intended to handle functionality of your application during specific stages of OTA, or on an OTA error: +The following functions are provided with the `ArduinoOTA `__ library and intended to handle functionality of your application during specific stages of OTA, or on an OTA error: .. code:: cpp @@ -156,24 +156,30 @@ The following functions are provided with `ArduinoOTA `__. +Keep in mind that the file system and EEPROM, for example, need space too; see `Flash layout <../filesystem.rst#flash-layout>`__. .. code:: cpp ESP.getFreeSketchSpace(); -can be used for checking the free space for the new sketch. +can be used for checking the free space available for the new sketch. -For overview of memory layout, where new sketch is stored and how it is copied during OTA process, see `Update process - memory view <#update-process-memory-view>`__. +For an overview of memory layout, where the new sketch is stored and how it is copied during the OTA process, see `Update process - memory view <#update-process-memory-view>`__. -The following chapters provide more details and specific methods of doing OTA. +The following chapters provide more details and specific methods for OTA updates. Arduino IDE ----------- -Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios: - during firmware development as a quicker alternative to loading over a serial, - for updating small quantity of modules, - only if modules are available on the same network as the computer with Arduino IDE. +Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios: + +- during firmware development as a quicker alternative to loading over a serial port, + +- for updating a small number of modules, + +- only if modules are accessible on the same network as the computer with the Arduino IDE. Requirements ~~~~~~~~~~~~ @@ -183,9 +189,9 @@ Requirements Application Example ~~~~~~~~~~~~~~~~~~~ -Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) board. You can use any other board assuming that it meets `requirements <#basic-requirements>`__ described above. This instruction is valid for all operating systems supported by Arduino IDE. Screen captures have been made on Windows 7 and you may see small differences (like name of serial port), if you are using Linux and MacOS. +Instructions below show configuration of OTA on a NodeMCU 1.0 (ESP-12E Module) board. You can use any other board that meets the `requirements <#basic-requirements>`__ described above. This instruction is valid for all operating systems supported by the Arduino IDE. Screen captures have been made on Windows 7 and you may see small differences (like name of the serial port), if you are using Linux or MacOS. -1. Before you begin, please make sure that you have the following s/w +1. Before you begin, please make sure that you have the following software installed: - Arduino IDE 1.6.7 or newer - @@ -193,7 +199,7 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa - esp8266/Arduino platform package 2.0.0 or newer - for instructions follow https://github.com/esp8266/Arduino#installing-with-boards-manager - - Python 2.7 - https://www.python.org/ + - Python 3.x - https://www.python.org/ **Note:** Windows users should select “Add python.exe to Path” (see below – this option is not selected by default). @@ -201,13 +207,12 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa .. figure:: a-ota-python-configuration.png :alt: Python installation set up -2. Now prepare the sketch and configuration for the upload over a serial - port. +2. Now prepare the sketch and configuration for upload via a serial port. - - Start Arduino IDE and load sketch BasicOTA.ino available under + - Start Arduino IDE and upload the sketch BasicOTA.ino, available under File > Examples > ArduinoOTA |ota sketch selection| - - Update SSID and password in the sketch, so the module can join + - Update the SSID and password in the sketch, so that the module can join your Wi-Fi network |ota ssid pass entry| - Configure upload parameters as below (you may need to adjust @@ -225,20 +230,20 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa .. figure:: a-ota-upload-complete-and-joined-wifi.png :alt: Check if module joined network -**Note:** ESP module should be reset after serial upload. Otherwise subsequent steps will not work. Reset may be done automatically for you after opening serial monitor as visible on the screenshot above. It depends on how you have DTR and RTS wired from USB-Serial converter to the ESP. If reset is not done automatically, then do it by pressing reset button or manually cycling the power. For more details why this should be done please refer to `FAQ <../faq#i-have-observed-a-case-when-esprestart-doesnt-work-what-is-the-reason-for-that>`__ regarding ``ESP.restart()``. +**Note:** The ESP module should be reset after serial upload. Otherwise, subsequent steps will not work. Reset may be done for you automatically after opening serial monitor, as visible on the screenshot above. It depends on how you have DTR and RTS wired from the USB-Serial converter to the ESP. If reset is not done automatically, then trigger it by pressing reset button or manually cycling the power. For more details why this should be done please refer to `FAQ <../faq#i-have-observed-a-case-when-esprestart-doesnt-work-what-is-the-reason-for-that>`__ regarding ``ESP.restart()``. -4. Only if module is connected to network, after a couple of seconds, +4. Only if the module is connected to network, after a couple of seconds, the esp8266-ota port will show up in Arduino IDE. Select port with IP address shown in the Serial Monitor window in previous step: .. figure:: a-ota-ota-port-selection.png :alt: Selection of OTA port - **Note:** If OTA port does not show up, exit Arduino IDE, open it - again and check if port is there. If it does not help, check your - firewall and router settings. OTA port is advertised using mDNS - service. To check if port is visible by your PC, you can use - application like Bonjour Browser. + **Note:** If the OTA port does not show up, exit Arduino IDE, open it + again and check if the port is there. If it is not, check your + firewall and router settings. The OTA port is advertised using mDNS + service. To check if the port is visible by your PC, you can use + an application like Bonjour Browser. 5. Now get ready for your first OTA upload by selecting the OTA port: @@ -498,9 +503,9 @@ Simple updater downloads the file every time the function is called. Advanced updater ^^^^^^^^^^^^^^^^ -Its possible to point update function to a script at the server. If version string argument is given, it will be sent to the server. Server side script can use this to check if update should be performed. +Its possible to point the update function to a script on the server. If a version string argument is given, it will be sent to the server. The server side script can use this string to check whether an update should be performed. -Server side script can respond as follows: - response code 200, and send the firmware image, - or response code 304 to notify ESP that no update is required. +The server-side script can respond as follows: - response code 200, and send the firmware image, - or response code 304 to notify ESP that no update is required. .. code:: cpp @@ -513,7 +518,7 @@ Server side script can respond as follows: - response code 200, and send the fir Serial.println("[update] Update no Update."); break; case HTTP_UPDATE_OK: - Serial.println("[update] Update ok."); // may not called we reboot the ESP + Serial.println("[update] Update ok."); // may not be called since we reboot the ESP break; } @@ -528,7 +533,7 @@ For the simple updater the server only needs to deliver the binary file for upda Advanced updater ^^^^^^^^^^^^^^^^ -For advanced update management a script needs to run at the server side, for example a PHP script. At every update request the ESP sends some information in HTTP headers to the server. +For advanced update management a script (such as a PHP script) needs to run on the server side. On every update request, the ESP sends some information in HTTP headers to the server. Example header data: @@ -544,9 +549,7 @@ Example header data: [HTTP_X_ESP8266_SDK_VERSION] => 1.3.0 [HTTP_X_ESP8266_VERSION] => DOOR-7-g14f53a19 -With this information the script now can check if an update is needed. It is also possible to deliver different binaries based on the MAC address for example. - -Script example: +With this information the script now can check if an update is needed. It is also possible to deliver different binaries based on the MAC address, as in the following example: .. code:: php @@ -619,9 +622,13 @@ Script example: Stream Interface ---------------- -TODO describe Stream Interface +The Stream Interface is the base for all other update modes like OTA, HTTP Server / client. Given a Stream-class variable `streamVar` providing `byteCount` bytes of firmware, it can store the firmware as follows: -The Stream Interface is the base for all other update modes like OTA, http Server / client. +.. code:: cpp + + Update.begin(firmwareLengthInBytes); + Update.writeStream(streamVar); + Update.end(); Updater class ------------- @@ -635,7 +642,7 @@ Update process - memory view - The new sketch will be stored in the space between the old sketch and the spiff. -- on the next reboot the "eboot" bootloader check for commands. +- on the next reboot, the "eboot" bootloader checks for commands. - the new sketch is now copied "over" the old one. - the new sketch is started. diff --git a/doc/reference.rst b/doc/reference.rst index 2744a7164..29ae74e37 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -215,3 +215,75 @@ using FPSTR would become... String response2; response2 += FPSTR(HTTP); } + +C++ +---- + +- About C++ exceptions, ``operator new``, and Exceptions menu option + + The C++ standard says the following about the ``new`` operator behavior when encountering heap shortage (memory full): + + - has to throw a ``std::bad_alloc`` C++ exception when they are enabled + + - will ``abort()`` otherwise + + There are several reasons for the first point above, among which are: + + - guarantee that the return of new is never a ``nullptr`` + + - guarantee full construction of the top level object plus all member subobjects + + - guarantee that any subobjects partially constructed get destroyed, and in the correct order, if oom is encountered midway through construction + + When C++ exceptions are disabled, or when using ``new(nothrow)``, the above guarantees can't be upheld, so the second point (``abort()``) above is the only ``std::c++`` viable solution. + + Historically in Arduino environments, ``new`` is overloaded to simply return the equivalent ``malloc()`` which in turn can return ``nullptr``. + + This behavior is not C++ standard, and there is good reason for that: there are hidden and very bad side effects. The *class and member constructors are always called, even when memory is full* (``this == nullptr``). + In addition, the memory allocation for the top object could succeed, but allocation required for some member object could fail, leaving construction in an undefined state. + So the historical behavior of Ardudino's ``new``, when faced with insufficient memory, will lead to bad crashes sooner or later, sometimes unexplainable, generally due to memory corruption even when the returned value is checked and managed. + Luckily on esp8266, trying to update RAM near address 0 will immediately raise an hardware exception, unlike on other uC like avr on which that memory can be accessible. + + As of core 2.6.0, there are 3 options: legacy (default) and two clear cases when ``new`` encounters oom: + + - ``new`` returns ``nullptr``, with possible bad effects or immediate crash when constructors (called anyway) initialize members (exceptions are disabled in this case) + + - C++ exceptions are disabled: ``new`` calls ``abort()`` and will "cleanly" crash, because there is no way to honor memory allocation or to recover gracefully. + + - C++ exceptions are enabled: ``new`` throws a ``std::bad_alloc`` C++ exception, which can be caught and handled gracefully. + This assures correct behavior, including handling of all subobjects, which guarantees stability. + + History: `#6269 `__ `#6309 `__ `#6312 `__ + +- New optional allocator ``arduino_new`` + + A new optional global allocator is introduced with a different semantic: + + - never throws exceptions on oom + + - never calls constructors on oom + + - returns nullptr on oom + + It is similar to arduino ``new`` semantic without side effects + (except when parent constructors, or member constructors use ``new``). + + Syntax is slightly different, the following shows the different usages: + + .. code:: cpp + + // with new: + + SomeClass* sc = new SomeClass(arg1, arg2, ...); + delete sc; + + SomeClass* scs = new SomeClass[42]; + delete [] scs; + + // with arduino_new: + + SomeClass* sc = arduino_new(SomeClass, arg1, arg2, ...); + delete sc; + + SomeClass* scs = arduino_newarray(SomeClass, 42); + delete [] scs; diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino index 5e767ccd5..2d6f49592 100644 --- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino +++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino @@ -13,8 +13,8 @@ #include #include -// Fingerprint for demo URL, expires on June 2, 2019, needs to be updated well before this date -const uint8_t fingerprint[20] = {0x5A, 0xCF, 0xFE, 0xF0, 0xF1, 0xA6, 0xF4, 0x5F, 0xD2, 0x11, 0x11, 0xC6, 0x1D, 0x2F, 0x0E, 0xBC, 0x39, 0x8D, 0x50, 0xE0}; +// Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date +const uint8_t fingerprint[20] = {0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3}; ESP8266WiFiMulti WiFiMulti; diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 9bfac6cc2..6503ea839 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -225,6 +225,11 @@ bool HTTPClient::begin(String url, String httpsFingerprint) return false; } _transportTraits = TransportTraitsPtr(new TLSTraits(httpsFingerprint)); + if(!_transportTraits) { + DEBUG_HTTPCLIENT("[HTTP-Client][begin] could not create transport traits\n"); + return false; + } + DEBUG_HTTPCLIENT("[HTTP-Client][begin] httpsFingerprint: %s\n", httpsFingerprint.c_str()); return true; } @@ -242,6 +247,11 @@ bool HTTPClient::begin(String url, const uint8_t httpsFingerprint[20]) return false; } _transportTraits = TransportTraitsPtr(new BearSSLTraits(httpsFingerprint)); + if(!_transportTraits) { + DEBUG_HTTPCLIENT("[HTTP-Client][begin] could not create transport traits\n"); + return false; + } + DEBUG_HTTPCLIENT("[HTTP-Client][begin] BearSSL-httpsFingerprint:"); for (size_t i=0; i < 20; i++) { DEBUG_HTTPCLIENT(" %02x", httpsFingerprint[i]); @@ -409,7 +419,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, const uint8_t htt */ void HTTPClient::end(void) { - disconnect(); + disconnect(false); clear(); _redirectCount = 0; } @@ -563,6 +573,7 @@ void HTTPClient::setRedirectLimit(uint16_t limit) void HTTPClient::useHTTP10(bool useHTTP10) { _useHTTP10 = useHTTP10; + _reuse = !useHTTP10; } /** @@ -980,7 +991,7 @@ int HTTPClient::writeToStream(Stream * stream) return returnError(HTTPC_ERROR_ENCODING); } - disconnect(); + disconnect(true); return ret; } @@ -996,7 +1007,7 @@ const String& HTTPClient::getString(void) _payload.reset(new StreamString()); - if(_size) { + if(_size > 0) { // try to reserve needed memmory if(!_payload->reserve((_size + 1))) { DEBUG_HTTPCLIENT("[HTTP-Client][getString] not enough memory to reserve a string! need: %d\n", (_size + 1)); @@ -1139,7 +1150,11 @@ bool HTTPClient::hasHeader(const char* name) bool HTTPClient::connect(void) { if(connected()) { - DEBUG_HTTPCLIENT("[HTTP-Client] connect. already connected, try reuse!\n"); + if(_reuse) { + DEBUG_HTTPCLIENT("[HTTP-Client] connect: already connected, reusing connection\n"); + } else { + DEBUG_HTTPCLIENT("[HTTP-Client] connect: already connected, try reuse!\n"); + } while(_client->available() > 0) { _client->read(); } @@ -1149,6 +1164,10 @@ bool HTTPClient::connect(void) #if HTTPCLIENT_1_1_COMPATIBLE if(!_client && _transportTraits) { _tcpDeprecated = _transportTraits->create(); + if(!_tcpDeprecated) { + DEBUG_HTTPCLIENT("[HTTP-Client] connect: could not create tcp\n"); + return false; + } _client = _tcpDeprecated.get(); } #endif @@ -1246,9 +1265,12 @@ int HTTPClient::handleHeaderResponse() return HTTPC_ERROR_NOT_CONNECTED; } + clear(); + + _canReuse = _reuse; + String transferEncoding; - _returnCode = -1; - _size = -1; + _transferEncoding = HTTPC_TE_IDENTITY; unsigned long lastDataTime = millis(); @@ -1263,6 +1285,9 @@ int HTTPClient::handleHeaderResponse() DEBUG_HTTPCLIENT("[HTTP-Client][handleHeaderResponse] RX: '%s'\n", headerLine.c_str()); if(headerLine.startsWith("HTTP/1.")) { + if(_canReuse) { + _canReuse = (headerLine[sizeof "HTTP/1." - 1] != '0'); + } _returnCode = headerLine.substring(9, headerLine.indexOf(' ', 9)).toInt(); } else if(headerLine.indexOf(':')) { String headerName = headerLine.substring(0, headerLine.indexOf(':')); @@ -1273,8 +1298,10 @@ int HTTPClient::handleHeaderResponse() _size = headerValue.toInt(); } - if(headerName.equalsIgnoreCase("Connection")) { - _canReuse = headerValue.equalsIgnoreCase("keep-alive"); + if(_canReuse && headerName.equalsIgnoreCase("Connection")) { + if(headerValue.indexOf("close") >= 0 && headerValue.indexOf("keep-alive") < 0) { + _canReuse = false; + } } if(headerName.equalsIgnoreCase("Transfer-Encoding")) { @@ -1429,10 +1456,10 @@ int HTTPClient::writeToStreamDataBlock(Stream * stream, int size) free(buff); - DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] connection closed or file end (written: %d).\n", bytesWritten); + DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] end of chunk or data (transferred: %d).\n", bytesWritten); if((size > 0) && (size != bytesWritten)) { - DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] bytesWritten %d and size %d mismatch!.\n", bytesWritten, size); + DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] transferred size %d and request size %d mismatch!.\n", bytesWritten, size); return HTTPC_ERROR_STREAM_WRITE; } diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h index 44335c505..189070a98 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h @@ -235,7 +235,7 @@ protected: /// request handling String _host; uint16_t _port = 0; - bool _reuse = false; + bool _reuse = true; uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT; bool _useHTTP10 = false; diff --git a/libraries/ESP8266WebServer/keywords.txt b/libraries/ESP8266WebServer/keywords.txt index e68547eb2..73cba339c 100644 --- a/libraries/ESP8266WebServer/keywords.txt +++ b/libraries/ESP8266WebServer/keywords.txt @@ -42,6 +42,7 @@ hostHeader KEYWORD2 ####################################### HTTP_GET LITERAL1 +HTTP_HEAD LITERAL1 HTTP_POST LITERAL1 HTTP_ANY LITERAL1 CONTENT_LENGTH_UNKNOWN LITERAL1 diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h index c5bcb59f7..3af7ca394 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h @@ -480,6 +480,7 @@ void ESP8266WebServerTemplate::send(int code, const String& content_ template void ESP8266WebServerTemplate::sendContent(const String& content) { + if (_currentMethod == HTTP_HEAD) return; const char * footer = "\r\n"; size_t len = content.length(); if(_chunked) { @@ -728,6 +729,7 @@ const String ESP8266WebServerTemplate::responseCodeToString(const in case 415: return F("Unsupported Media Type"); case 416: return F("Requested range not satisfiable"); case 417: return F("Expectation Failed"); + case 418: return F("I'm a teapot"); case 500: return F("Internal Server Error"); case 501: return F("Not Implemented"); case 502: return F("Bad Gateway"); diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.h b/libraries/ESP8266WebServer/src/ESP8266WebServer.h index 6eec446d9..9b7c2bbb3 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.h @@ -30,7 +30,7 @@ #include #include "detail/mimetable.h" -enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS }; +enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS }; enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END, UPLOAD_FILE_ABORTED }; enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE }; @@ -194,10 +194,10 @@ protected: std::unique_ptr _currentUpload; int _postArgsLen; RequestArgument* _postArgs; - + int _headerKeysCount; RequestArgument* _currentHeaders; - + size_t _contentLength; String _responseHeaders; diff --git a/libraries/ESP8266WebServer/src/Parsing-impl.h b/libraries/ESP8266WebServer/src/Parsing-impl.h index 65ad38d62..c6b8ea16e 100644 --- a/libraries/ESP8266WebServer/src/Parsing-impl.h +++ b/libraries/ESP8266WebServer/src/Parsing-impl.h @@ -99,7 +99,9 @@ bool ESP8266WebServerTemplate::_parseRequest(ClientType& client) { _chunked = false; HTTPMethod method = HTTP_GET; - if (methodStr == F("POST")) { + if (methodStr == F("HEAD")) { + method = HTTP_HEAD; + } else if (methodStr == F("POST")) { method = HTTP_POST; } else if (methodStr == F("DELETE")) { method = HTTP_DELETE; diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/certs-from-mozilla.py b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/certs-from-mozilla.py index 13c77ccf5..e423bc25b 100755 --- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/certs-from-mozilla.py +++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/certs-from-mozilla.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # This script pulls the list of Mozilla trusted certificate authorities # from the web at the "mozurl" below, parses the file to grab the PEM @@ -7,16 +7,18 @@ # and use them for your outgoing SSL connections. # # Script by Earle F. Philhower, III. Released to the public domain. - +from __future__ import print_function import csv import os +import sys from subprocess import Popen, PIPE, call -import urllib2 try: - # for Python 2.x + from urllib.request import urlopen +except: + from urllib2 import urlopen +try: from StringIO import StringIO -except ImportError: - # for Python 3.x +except: from io import StringIO # Mozilla's URL for the CSV file with included PEM certs @@ -25,9 +27,12 @@ mozurl = "https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateRep # Load the manes[] and pems[] array from the URL names = [] pems = [] -response = urllib2.urlopen(mozurl) +response = urlopen(mozurl) csvData = response.read() -csvReader = csv.reader(StringIO(csvData)) +if sys.version_info[0] > 2: + csvData = csvData.decode('utf-8') +csvFile = StringIO(csvData) +csvReader = csv.reader(csvFile) for row in csvReader: names.append(row[0]+":"+row[1]+":"+row[2]) pems.append(row[30]) @@ -46,10 +51,10 @@ idx = 0 for i in range(0, len(pems)): certName = "data/ca_%03d.der" % (idx); thisPem = pems[i].replace("'", "") - print names[i] + " -> " + certName + print(names[i] + " -> " + certName) ssl = Popen(['openssl','x509','-inform','PEM','-outform','DER','-out', certName], shell = False, stdin = PIPE) pipe = ssl.stdin - pipe.write(thisPem) + pipe.write(thisPem.encode('utf-8')) pipe.close() ssl.wait() if os.path.exists(certName): diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino new file mode 100644 index 000000000..9676857b1 --- /dev/null +++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino @@ -0,0 +1,97 @@ + +// NAPT example released to public domain + +#if LWIP_FEATURES && !LWIP_IPV6 + +#define HAVE_NETDUMP 0 + +#ifndef STASSID +#define STASSID "mynetwork" +#define STAPSK "mynetworkpassword" +#endif + +#include +#include +#include +#include + +#define NAPT 1000 +#define NAPT_PORT 10 + +#if HAVE_NETDUMP + +#include + +void dump(int netif_idx, const char* data, size_t len, int out, int success) { + (void)success; + Serial.print(out ? F("out ") : F(" in ")); + Serial.printf("%d ", netif_idx); + + // optional filter example: if (netDump_is_ARP(data)) + { + netDump(Serial, data, len); + //netDumpHex(Serial, data, len); + } +} +#endif + +void setup() { + Serial.begin(115200); + Serial.printf("\n\nNAPT Range extender\n"); + Serial.printf("Heap on start: %d\n", ESP.getFreeHeap()); + +#if HAVE_NETDUMP + phy_capture = dump; +#endif + + // first, connect to STA so we can get a proper local DNS server + WiFi.mode(WIFI_STA); + WiFi.begin(STASSID, STAPSK); + while (WiFi.status() != WL_CONNECTED) { + Serial.print('.'); + delay(500); + } + Serial.printf("\nSTA: %s (dns: %s / %s)\n", + WiFi.localIP().toString().c_str(), + WiFi.dnsIP(0).toString().c_str(), + WiFi.dnsIP(1).toString().c_str()); + + // give DNS servers to AP side + dhcps_set_dns(0, WiFi.dnsIP(0)); + dhcps_set_dns(1, WiFi.dnsIP(1)); + + WiFi.softAPConfig( // enable AP, with android-compatible google domain + IPAddress(172, 217, 28, 254), + IPAddress(172, 217, 28, 254), + IPAddress(255, 255, 255, 0)); + WiFi.softAP(STASSID "extender", STAPSK); + Serial.printf("AP: %s\n", WiFi.softAPIP().toString().c_str()); + + Serial.printf("Heap before: %d\n", ESP.getFreeHeap()); + err_t ret = ip_napt_init(NAPT, NAPT_PORT); + Serial.printf("ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK); + if (ret == ERR_OK) { + ret = ip_napt_enable_no(SOFTAP_IF, 1); + Serial.printf("ip_napt_enable_no(SOFTAP_IF): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK); + if (ret == ERR_OK) { + Serial.printf("WiFi Network '%s' with same password is now NATed behind '%s'\n", STASSID "extender", STASSID); + } + } + Serial.printf("Heap after napt init: %d\n", ESP.getFreeHeap()); + if (ret != ERR_OK) { + Serial.printf("NAPT initialization failed\n"); + } +} + +#else + +void setup() { + Serial.begin(115200); + Serial.printf("\n\nNAPT not supported in this configuration\n"); +} + +#endif + +void loop() { +} + diff --git a/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp b/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp index 6dcf0b384..ffce2b00e 100644 --- a/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp +++ b/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "BearSSLHelpers.h" #include #include #include @@ -28,7 +29,10 @@ #include #include #include -#include "BearSSLHelpers.h" +#include +#ifndef ARDUINO_SIGNING + #define ARDUINO_SIGNING 0 +#endif namespace brssl { // Code here is pulled from brssl sources, with the copyright and license @@ -901,3 +905,17 @@ make_stack_thunk(br_ssl_engine_sendrec_buf); #endif }; + +#if ARDUINO_SIGNING +namespace { + static BearSSL::PublicKey signingPubKey(signing_pubkey); + static BearSSL::HashSHA256 __signingHash; + static BearSSL::SigningVerifier __signingVerifier(&signingPubKey); +}; + +namespace esp8266 { + UpdaterHashClass& updaterSigningHash = __signingHash; + UpdaterVerifyClass& updaterSigningVerifier = __signingVerifier; +}; +#endif + diff --git a/libraries/ESP8266WiFi/src/BearSSLHelpers.h b/libraries/ESP8266WiFi/src/BearSSLHelpers.h index 2f6eb8e84..282bab9cf 100644 --- a/libraries/ESP8266WiFi/src/BearSSLHelpers.h +++ b/libraries/ESP8266WiFi/src/BearSSLHelpers.h @@ -26,7 +26,6 @@ #include #include - // Internal opaque structures, not needed by user applications namespace brssl { class public_key; diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp index 31daf370a..ed49ca9d6 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp @@ -24,6 +24,7 @@ #include #include +#include #include "ESP8266WiFi.h" #include "ESP8266WiFiGeneric.h" @@ -38,12 +39,19 @@ extern "C" { #include "lwip/opt.h" #include "lwip/err.h" #include "lwip/dns.h" +#include "lwip/dhcp.h" #include "lwip/init.h" // LWIP_VERSION_ +#if LWIP_VERSION_MAJOR == 1 +#include "lwip/sntp.h" +#else +#include "lwip/apps/sntp.h" +#endif } #include "WiFiClient.h" #include "WiFiUdp.h" #include "debug.h" +#include "include/WiFiState.h" extern "C" void esp_schedule(); extern "C" void esp_yield(); @@ -200,15 +208,15 @@ WiFiEventHandler ESP8266WiFiGenericClass::onSoftAPModeProbeRequestReceived(std:: return handler; } -// WiFiEventHandler ESP8266WiFiGenericClass::onWiFiModeChange(std::function f) -// { -// WiFiEventHandler handler = std::make_shared(WIFI_EVENT_MODE_CHANGE, [f](System_Event_t* e){ -// WiFiEventModeChange& dst = *reinterpret_cast(&e->event_info); -// f(dst); -// }); -// sCbEventList.push_back(handler); -// return handler; -// } +WiFiEventHandler ESP8266WiFiGenericClass::onWiFiModeChange(std::function f) +{ + WiFiEventHandler handler = std::make_shared(WIFI_EVENT_MODE_CHANGE, [f](System_Event_t* e){ + WiFiEventModeChange& dst = *reinterpret_cast(&e->event_info); + f(dst); + }); + sCbEventList.push_back(handler); + return handler; +} /** * callback for WiFi events @@ -386,7 +394,29 @@ bool ESP8266WiFiGenericClass::getPersistent(){ * set new mode * @param m WiFiMode_t */ -bool ESP8266WiFiGenericClass::mode(WiFiMode_t m) { +bool ESP8266WiFiGenericClass::mode(WiFiMode_t m, WiFiState* state) { + if (m == WIFI_SHUTDOWN) { + return shutdown(0, state); + } + else if (m == WIFI_RESUME) { + return resumeFromShutdown(state); + } + else if (m & ~(WIFI_STA | WIFI_AP)) + // any other bits than legacy disallowed + return false; + + // m is now WIFI_STA, WIFI_AP or WIFI_AP_STA + if (state) + { + DEBUG_WIFI("core: state is useless without SHUTDOWN or RESUME\n"); + } + + if (wifi_fpm_get_sleep_type() != NONE_SLEEP_T) { + // wifi may have been put asleep by ESP8266WiFiGenericClass::preinitWiFiOff + wifi_fpm_do_wakeup(); + wifi_fpm_close(); + } + if(_persistent){ if(wifi_get_opmode() == (uint8) m && wifi_get_opmode_default() == (uint8) m){ return true; @@ -396,12 +426,6 @@ bool ESP8266WiFiGenericClass::mode(WiFiMode_t m) { } bool ret = false; - - if (m != WIFI_STA && m != WIFI_AP_STA) - // calls lwIP's dhcp_stop(), - // safe to call even if not started - wifi_station_dhcpc_stop(); - ETS_UART_INTR_DISABLE(); if(_persistent) { ret = wifi_set_opmode(m); @@ -431,15 +455,13 @@ bool ESP8266WiFiGenericClass::enableSTA(bool enable) { WiFiMode_t currentMode = getMode(); bool isEnabled = ((currentMode & WIFI_STA) != 0); - if(isEnabled != enable) { - if(enable) { - return mode((WiFiMode_t)(currentMode | WIFI_STA)); - } else { - return mode((WiFiMode_t)(currentMode & (~WIFI_STA))); - } - } else { + if (isEnabled == enable) return true; - } + + if (enable) + return mode((WiFiMode_t)(currentMode | WIFI_STA)); + + return mode((WiFiMode_t)(currentMode & (~WIFI_STA))); } /** @@ -472,16 +494,29 @@ bool ESP8266WiFiGenericClass::enableAP(bool enable){ bool ESP8266WiFiGenericClass::forceSleepBegin(uint32 sleepUs) { _forceSleepLastMode = getMode(); if(!mode(WIFI_OFF)) { + DEBUG_WIFI("core: error with mode(WIFI_OFF)\n"); return false; } - if(sleepUs == 0) { + if(sleepUs == 0 || sleepUs > 0xFFFFFFF) { sleepUs = 0xFFFFFFF; } wifi_fpm_set_sleep_type(MODEM_SLEEP_T); + delay(0); wifi_fpm_open(); - return (wifi_fpm_do_sleep(sleepUs) == 0); + delay(0); + auto ret = wifi_fpm_do_sleep(sleepUs); + if (ret != 0) + { + DEBUG_WIFI("core: error %d with wifi_fpm_do_sleep: (-1=sleep status error, -2=force sleep not enabled)\n", ret); + return false; + } + // fpm_is_open() is always 1 here, with or without delay + // wifi_fpm_set_wakeup_cb(cb): callback is never called + // no power reduction without this delay + delay(10); + return true; } /** @@ -489,8 +524,10 @@ bool ESP8266WiFiGenericClass::forceSleepBegin(uint32 sleepUs) { * @return ok */ bool ESP8266WiFiGenericClass::forceSleepWake() { - wifi_fpm_do_wakeup(); - wifi_fpm_close(); + if (wifi_fpm_get_sleep_type() != NONE_SLEEP_T) { + wifi_fpm_do_wakeup(); + wifi_fpm_close(); + } // restore last mode if(mode(_forceSleepLastMode)) { @@ -600,7 +637,142 @@ void wifi_dns_found_callback(const char *name, CONST ip_addr_t *ipaddr, void *ca esp_schedule(); // resume the hostByName function } -//meant to be called from user-defined preinit() +uint32_t ESP8266WiFiGenericClass::shutdownCRC (const WiFiState* state) +{ + return state? crc32(&state->state, sizeof(state->state)): 0; +} + +bool ESP8266WiFiGenericClass::shutdownValidCRC (const WiFiState* state) +{ + return state && (crc32(&state->state, sizeof(state->state)) == state->crc); +} + +bool ESP8266WiFiGenericClass::shutdown (uint32 sleepUs, WiFiState* state) +{ + bool persistent = _persistent; + WiFiMode_t before_off_mode = getMode(); + + if ((before_off_mode & WIFI_STA) && state) + { + bool ret = wifi_get_ip_info(STATION_IF, &state->state.ip); + if (!ret) + { + DEBUG_WIFI("core: error with wifi_get_ip_info(STATION_IF)\n"); + return false; + } + memset(state->state.fwconfig.bssid, 0xff, 6); + ret = wifi_station_get_config(&state->state.fwconfig); + if (!ret) + { + DEBUG_WIFI("core: error with wifi_station_get_config\n"); + return false; + } + state->state.channel = wifi_get_channel(); + } + + // disable persistence in FW so in case of power failure + // it doesn't wake up in off mode. + // persistence state will be restored on WiFi resume. + WiFi.persistent(false); + if (!WiFi.forceSleepBegin(sleepUs)) + { + // WIFI_OFF mode set by forceSleepBegin() + DEBUG_WIFI("core: error with forceSleepBegin()\n"); + WiFi.mode(before_off_mode); + WiFi.persistent(persistent); + return false; + } + + // WiFi is now in force-sleep mode + + if (state) + { + // finish filling state and process crc + + state->state.persistent = persistent; + state->state.mode = before_off_mode; + uint8_t i = 0; + for (auto& ntp: state->state.ntp) + { +#if LWIP_VERSION_MAJOR == 1 + ntp = sntp_getserver(i++); +#else + ntp = *sntp_getserver(i++); +#endif + } + i = 0; + for (auto& dns: state->state.dns) + dns = WiFi.dnsIP(i++); + state->crc = shutdownCRC(state); + DEBUG_WIFI("core: state is saved\n"); + } + return true; +} + +bool ESP8266WiFiGenericClass::resumeFromShutdown (WiFiState* state) +{ + if (wifi_fpm_get_sleep_type() != NONE_SLEEP_T) { + wifi_fpm_do_wakeup(); + wifi_fpm_close(); + } + + if (!state || shutdownCRC(state) != state->crc) + { + DEBUG_WIFI("core: resume: no state or bad crc\n"); + return false; + } + + persistent(state->state.persistent); + + if (!mode(state->state.mode)) + { + DEBUG_WIFI("core: resume: can't set wifi mode to %d\n", state->state.mode); + return false; + } + + if (state->state.mode & WIFI_STA) + { + IPAddress local(state->state.ip.ip); + if (local) + { + DEBUG_WIFI("core: resume: static address '%s'\n", local.toString().c_str()); + WiFi.config(state->state.ip.ip, state->state.ip.gw, state->state.ip.netmask, state->state.dns[0], state->state.dns[1]); + uint8_t i = 0; + for (CONST auto& ntp: state->state.ntp) + { + IPAddress ip(ntp); + if (ip.isSet()) + { + DEBUG_WIFI("core: resume: start SNTP, server='%s'\n", ip.toString().c_str()); + sntp_setserver(i++, &ntp); + } + } + } + // state->state.fwconfig.bssid is not real bssid (it's what user may have provided when bssid_set==1) + if (WiFi.begin((const char*)state->state.fwconfig.ssid, + (const char*)state->state.fwconfig.password, + state->state.channel, + nullptr/*(const uint8_t*)state->state.fwconfig.bssid*/, // <- try with gw's mac address? + true) == WL_CONNECT_FAILED) + { + DEBUG_WIFI("core: resume: WiFi.begin failed\n"); + return false; + } + } + + if (state->state.mode & WIFI_AP) + { + DEBUG_WIFI("core: resume AP mode TODO\n"); + return false; + } + + // success, invalidate saved state + state->crc++; + + return true; +} + +//meant to be called from user-defined ::preinit() void ESP8266WiFiGenericClass::preinitWiFiOff () { // https://github.com/esp8266/Arduino/issues/2111#issuecomment-224251391 // WiFi.persistent(false); diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h index 60fdad578..1f5ec5c99 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h @@ -42,6 +42,8 @@ typedef std::shared_ptr WiFiEventHandler; typedef void (*WiFiEventCb)(WiFiEvent_t); +struct WiFiState; + class ESP8266WiFiGenericClass { // ---------------------------------------------------------------------------------------------- // -------------------------------------- Generic WiFi function --------------------------------- @@ -62,7 +64,7 @@ class ESP8266WiFiGenericClass { WiFiEventHandler onSoftAPModeStationConnected(std::function); WiFiEventHandler onSoftAPModeStationDisconnected(std::function); WiFiEventHandler onSoftAPModeProbeRequestReceived(std::function); - // WiFiEventHandler onWiFiModeChange(std::function); + WiFiEventHandler onWiFiModeChange(std::function); int32_t channel(void); @@ -79,7 +81,7 @@ class ESP8266WiFiGenericClass { void persistent(bool persistent); - bool mode(WiFiMode_t); + bool mode(WiFiMode_t, WiFiState* state = nullptr); WiFiMode_t getMode(); bool enableSTA(bool enable); @@ -88,6 +90,8 @@ class ESP8266WiFiGenericClass { bool forceSleepBegin(uint32 sleepUs = 0); bool forceSleepWake(); + static uint32_t shutdownCRC (const WiFiState* state); + static bool shutdownValidCRC (const WiFiState* state); static void preinitWiFiOff (); //meant to be called in user-defined preinit() protected: @@ -96,17 +100,22 @@ class ESP8266WiFiGenericClass { static void _eventCallback(void *event); + // called by WiFi.mode(SHUTDOWN/RESTORE, state) + // - sleepUs is WiFi.forceSleepBegin() parameter, 0 = forever + // - saveState is the user's state to hold configuration on restore + bool shutdown (uint32 sleepUs = 0, WiFiState* stateSave = nullptr); + bool resumeFromShutdown (WiFiState* savedState = nullptr); + // ---------------------------------------------------------------------------------------------- // ------------------------------------ Generic Network function -------------------------------- // ---------------------------------------------------------------------------------------------- public: - int hostByName(const char* aHostname, IPAddress& aResult); int hostByName(const char* aHostname, IPAddress& aResult, uint32_t timeout_ms); bool getPersistent(); - protected: + protected: friend class ESP8266WiFiSTAClass; friend class ESP8266WiFiScanClass; friend class ESP8266WiFiAPClass; diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp index aaca892cd..8f52942b7 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp @@ -369,18 +369,24 @@ bool ESP8266WiFiSTAClass::reconnect() { * @return one value of wl_status_t enum */ bool ESP8266WiFiSTAClass::disconnect(bool wifioff) { - bool ret; + bool ret = false; struct station_config conf; *conf.ssid = 0; *conf.password = 0; + // API Reference: wifi_station_disconnect() need to be called after system initializes and the ESP8266 Station mode is enabled. + if (WiFi.getMode() & WIFI_STA) + ret = wifi_station_disconnect(); + else + ret = true; + ETS_UART_INTR_DISABLE(); if(WiFi._persistent) { wifi_station_set_config(&conf); } else { wifi_station_set_config_current(&conf); } - ret = wifi_station_disconnect(); + ETS_UART_INTR_ENABLE(); if(wifioff) { diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiType.h b/libraries/ESP8266WiFi/src/ESP8266WiFiType.h index c1fb2985b..86803edce 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiType.h +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiType.h @@ -34,7 +34,8 @@ typedef enum WiFiMode { - WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 + WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3, + /* these two pseudo modes are experimental: */ WIFI_SHUTDOWN = 4, WIFI_RESUME = 8 } WiFiMode_t; typedef enum WiFiPhyMode @@ -58,9 +59,10 @@ typedef enum WiFiEvent WIFI_EVENT_SOFTAPMODE_STACONNECTED, WIFI_EVENT_SOFTAPMODE_STADISCONNECTED, WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED, + WIFI_EVENT_MODE_CHANGE, + WIFI_EVENT_SOFTAPMODE_DISTRIBUTE_STA_IP, WIFI_EVENT_MAX, WIFI_EVENT_ANY = WIFI_EVENT_MAX, - WIFI_EVENT_MODE_CHANGE } WiFiEvent_t; enum WiFiDisconnectReason diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index c5a09cedb..773f68cfd 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -32,6 +32,7 @@ extern "C" { } #include "debug.h" #include "ESP8266WiFi.h" +#include "PolledTimeout.h" #include "WiFiClient.h" #include "WiFiClientSecureBearSSL.h" #include "StackThunk.h" @@ -437,12 +438,17 @@ int WiFiClientSecure::_run_until(unsigned target, bool blocking) { DEBUG_BSSL("_run_until: Not connected\n"); return -1; } - for (int no_work = 0; blocking || no_work < 2;) { - if (blocking) { - // Only for blocking operations can we afford to yield() - optimistic_yield(100); + + esp8266::polledTimeout::oneShotMs loopTimeout(_timeout); + + for (int no_work = 0; blocking || no_work < 2;) { + optimistic_yield(100); + + if (loopTimeout) { + DEBUG_BSSL("_run_until: Timeout\n"); + return -1; } - + int state; state = br_ssl_engine_current_state(_eng); if (state & BR_SSL_CLOSED) { @@ -461,8 +467,19 @@ int WiFiClientSecure::_run_until(unsigned target, bool blocking) { unsigned char *buf; size_t len; int wlen; + size_t availForWrite; buf = br_ssl_engine_sendrec_buf(_eng, &len); + availForWrite = WiFiClient::availableForWrite(); + + if (!blocking && len > availForWrite) { + /* + writes on WiFiClient will block if len > availableForWrite() + this is needed to prevent available() calls from blocking + on dropped connections + */ + len = availForWrite; + } wlen = WiFiClient::write(buf, len); if (wlen <= 0) { /* diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h index c3622aec0..6d1880dd5 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h @@ -193,6 +193,9 @@ class WiFiClientSecure : public WiFiClient { // AxTLS API deprecated section end ///////////////////////////////////// + protected: + bool _connectSSL(const char *hostName); // Do initial SSL handshake + private: void _clear(); void _clearAuthenticationSettings(); @@ -243,7 +246,6 @@ class WiFiClientSecure : public WiFiClient { size_t _recvapp_len; bool _clientConnected(); // Is the underlying socket alive? - bool _connectSSL(const char *hostName); // Do initial SSL handshake void _freeSSL(); int _run_until(unsigned target, bool blocking = true); size_t _write(const uint8_t *buf, size_t size, bool pmem); diff --git a/libraries/ESP8266WiFi/src/include/ClientContext.h b/libraries/ESP8266WiFi/src/include/ClientContext.h index 2023d30b1..abbb20e81 100644 --- a/libraries/ESP8266WiFi/src/include/ClientContext.h +++ b/libraries/ESP8266WiFi/src/include/ClientContext.h @@ -128,14 +128,14 @@ public: if (err != ERR_OK) { return 0; } - _connect_pending = 1; + _connect_pending = true; _op_start_time = millis(); // Following delay will be interrupted by connect callback for (decltype(_timeout_ms) i = 0; _connect_pending && i < _timeout_ms; i++) { // Give scheduled functions a chance to run (e.g. Ethernet uses recurrent) delay(1); - } - _connect_pending = 0; + } + _connect_pending = false; if (!_pcb) { DEBUGV(":cabrt\r\n"); return 0; @@ -433,7 +433,9 @@ protected: void _notify_error() { if (_connect_pending || _send_waiting) { - esp_schedule(); + _send_waiting = false; + _connect_pending = false; + esp_schedule(); // break current delay() } } @@ -464,8 +466,8 @@ protected: // Give scheduled functions a chance to run (e.g. Ethernet uses recurrent) delay(1); } + _send_waiting = false; } while(true); - _send_waiting = false; if (_sync) wait_until_sent(); @@ -534,7 +536,7 @@ protected: { if (_send_waiting) { _send_waiting = false; - esp_schedule(); + esp_schedule(); // break current delay() } } @@ -608,9 +610,10 @@ protected: (void) err; (void) pcb; assert(pcb == _pcb); - assert(_connect_pending); - _connect_pending = 0; - esp_schedule(); + if (_connect_pending) { + _connect_pending = false; + esp_schedule(); // break current delay() + } return ERR_OK; } @@ -659,7 +662,7 @@ private: uint32_t _timeout_ms = 5000; uint32_t _op_start_time = 0; bool _send_waiting = false; - uint8_t _connect_pending = 0; + bool _connect_pending = false; int8_t _refcnt; ClientContext* _next; diff --git a/libraries/ESP8266WiFi/src/include/WiFiState.h b/libraries/ESP8266WiFi/src/include/WiFiState.h new file mode 100644 index 000000000..caceb6f0b --- /dev/null +++ b/libraries/ESP8266WiFi/src/include/WiFiState.h @@ -0,0 +1,23 @@ + +#ifndef WIFISTATE_H_ +#define WIFISTATE_H_ + +#include +#include + +struct WiFiState +{ + uint32_t crc; + struct + { + station_config fwconfig; + ip_info ip; + ip_addr_t dns[2]; + ip_addr_t ntp[2]; + WiFiMode_t mode; + uint8_t channel; + bool persistent; + } state; +}; + +#endif // WIFISTATE_H_ diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp index 07e385a53..1b468fb26 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp @@ -23,6 +23,7 @@ */ #include +#include #include "LEAmDNS_Priv.h" @@ -59,11 +60,11 @@ MDNSResponder::MDNSResponder(void) m_pServiceQueries(0), m_fnServiceTxtCallback(0), #ifdef ENABLE_ESP_MDNS_RESPONDER_PASSIV_MODE - m_bPassivModeEnabled(true) { + m_bPassivModeEnabled(true), #else - m_bPassivModeEnabled(false) { + m_bPassivModeEnabled(false), #endif - + m_netif(nullptr) { } /* @@ -95,20 +96,74 @@ bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& p_IPAddress if (0 == m_pUDPContext) { if (_setHostname(p_pcHostname)) { - m_IPAddress = p_IPAddress; + //// select interface - m_GotIPHandler = WiFi.onStationModeGotIP([this](const WiFiEventStationModeGotIP& pEvent) { - (void) pEvent; - // Ensure that _restart() runs in USER context - schedule_function([this]() { MDNSResponder::_restart(); }); - }); + m_netif = nullptr; + IPAddress ipAddress = p_IPAddress; - m_DisconnectedHandler = WiFi.onStationModeDisconnected([this](const WiFiEventStationModeDisconnected& pEvent) { - (void) pEvent; - // Ensure that _restart() runs in USER context - schedule_function([this]() { MDNSResponder::_restart(); }); + if (!ipAddress.isSet()) { + + IPAddress sta = WiFi.localIP(); + IPAddress ap = WiFi.softAPIP(); + + if (!sta.isSet() && !ap.isSet()) { + + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] internal interfaces (STA, AP) are not set (none was specified)\n"))); + return false; + } + + if (ap.isSet()) { + + if (sta.isSet()) + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected over STA (none was specified)\n"))); + else + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected\n"))); + ipAddress = ap; + + } else { + + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface STA selected (none was specified)\n"))); + ipAddress = sta; + + } + + // continue to ensure interface is UP + } + + // check existence of this IP address in the interface list + bool found = false; + m_netif = nullptr; + for (auto a: addrList) + if (ipAddress == a.addr()) { + if (a.ifUp()) { + found = true; + m_netif = a.interface(); + break; + } + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] found interface for IP '%s' but it is not UP\n"), ipAddress.toString().c_str());); + } + if (!found) { + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] interface defined by IP '%s' not found\n"), ipAddress.toString().c_str());); + return false; + } + + //// done selecting the interface + + if (m_netif->num == STATION_IF) { + + m_GotIPHandler = WiFi.onStationModeGotIP([this](const WiFiEventStationModeGotIP& pEvent) { + (void) pEvent; + // Ensure that _restart() runs in USER context + schedule_function([this]() { MDNSResponder::_restart(); }); }); + m_DisconnectedHandler = WiFi.onStationModeDisconnected([this](const WiFiEventStationModeDisconnected& pEvent) { + (void) pEvent; + // Ensure that _restart() runs in USER context + schedule_function([this]() { MDNSResponder::_restart(); }); + }); + } + bResult = _restart(); } DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-")); } ); @@ -642,7 +697,7 @@ uint32_t MDNSResponder::queryService(const char* p_pcService, } } else { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n"), p_pcService, p_pcProtocol);); + DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n"));); } return u32Result; } diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h index 3bf16eb10..ed05a66a2 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.h +++ b/libraries/ESP8266mDNS/src/LEAmDNS.h @@ -1148,7 +1148,7 @@ protected: MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback; bool m_bPassivModeEnabled; stcProbeInformation m_HostProbeInformation; - IPAddress m_IPAddress; + CONST netif* m_netif; // network interface to run on /** CONTROL **/ /* MAINTENANCE */ @@ -1203,7 +1203,7 @@ protected: uint16_t p_u16QueryType, stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0); - const IPAddress& _getResponseMulticastInterface() const { return m_IPAddress; } + const IPAddress _getResponseMulticastInterface() const { return IPAddress(m_netif->ip_addr); } uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader, bool* p_pbFullNameMatch = 0) const; diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp index b00a84f73..08d9760ec 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp @@ -22,7 +22,6 @@ * */ -#include #include #include #include @@ -79,10 +78,10 @@ bool MDNSResponder::_process(bool p_bUserContext) { } } else { - bResult = ((WiFi.isConnected() || // Either station is connected - WiFi.softAPgetStationNum()>0) && // Or AP has stations connected - (_updateProbeStatus()) && // Probing - (_checkServiceQueryCache())); // Service query cache check + bResult = (m_netif != nullptr) && + (m_netif->flags & NETIF_FLAG_UP) && // network interface is up and running + _updateProbeStatus() && // Probing + _checkServiceQueryCache(); // Service query cache check } return bResult; } @@ -92,53 +91,10 @@ bool MDNSResponder::_process(bool p_bUserContext) { */ bool MDNSResponder::_restart(void) { - // check m_IPAddress - if (!m_IPAddress.isSet()) { - - IPAddress sta = WiFi.localIP(); - IPAddress ap = WiFi.softAPIP(); - - if (!sta.isSet() && !ap.isSet()) { - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] internal interfaces (STA, AP) are not set (none was specified)\n"))); - return false; - } - - if (sta.isSet()) { - - if (ap.isSet()) - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface STA selected over AP (none was specified)\n"))); - else - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface STA selected\n"))); - m_IPAddress = sta; - - } else { - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected (none was specified)\n"))); - m_IPAddress = ap; - - } - - // continue to ensure interface is UP - } - - // check existence of this IP address in the interface list - bool found = false; - for (auto a: addrList) - if (m_IPAddress == a.addr()) { - if (a.ifUp()) { - found = true; - break; - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] found interface for IP '%s' but it is not UP\n"), m_IPAddress.toString().c_str());); - } - if (!found) { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] interface defined by IP '%s' not found\n"), m_IPAddress.toString().c_str());); - return false; - } - - return ((_resetProbeStatus(true)) && // Stop and restart probing - (_allocUDPContext())); // Restart UDP + return ((m_netif != nullptr) && + (m_netif->flags & NETIF_FLAG_UP) && // network interface is up and running + (_resetProbeStatus(true)) && // Stop and restart probing + (_allocUDPContext())); // Restart UDP } @@ -798,7 +754,7 @@ bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* if (p_pPTRAnswer->m_u32TTL) { // Received update message pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL); // Update TTL tag DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%lu) for "), p_pPTRAnswer->m_u32TTL); + DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL); _printRRDomain(pSQAnswer->m_ServiceDomain); DEBUG_OUTPUT.printf_P(PSTR("\n")); ); @@ -852,7 +808,7 @@ bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* if (p_pSRVAnswer->m_u32TTL) { // First or update message (TTL != 0) pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL); // Update TTL tag DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%lu) for "), p_pSRVAnswer->m_u32TTL); + DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL); _printRRDomain(pSQAnswer->m_ServiceDomain); DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")); ); @@ -905,7 +861,7 @@ bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* if (p_pTXTAnswer->m_u32TTL) { // First or update message pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL); // Update TTL tag DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%lu) for "), p_pTXTAnswer->m_u32TTL); + DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL); _printRRDomain(pSQAnswer->m_ServiceDomain); DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")); ); @@ -957,7 +913,7 @@ bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* if (p_pAAnswer->m_u32TTL) { // Valid TTL -> Update answers TTL pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL); DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAnswer->m_u32TTL); + DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL); _printRRDomain(pSQAnswer->m_ServiceDomain); DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()); ); @@ -1124,7 +1080,7 @@ bool MDNSResponder::_updateProbeStatus(void) { if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount) { m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%lu).\n\n"), m_HostProbeInformation.m_u8SentCount);); + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount);); } else { m_HostProbeInformation.m_Timeout.resetToNeverExpires(); @@ -1172,7 +1128,7 @@ bool MDNSResponder::_updateProbeStatus(void) { if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount) { pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%lu)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount);); + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount);); } else { pService->m_ProbeInformation.m_Timeout.resetToNeverExpires(); diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp index d99a57f24..cf5cab07b 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp @@ -170,7 +170,7 @@ namespace MDNSImplementation { */ bool MDNSResponder::_callProcess(void) { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), m_pUDPContext->getRemoteAddress().toString().c_str());); + DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());); return _process(false); } @@ -199,7 +199,7 @@ bool MDNSResponder::_allocUDPContext(void) { //TODO: set multicast address (lwip_joingroup() is IPv4 only at the time of writing) multicast_addr.addr = DNS_MQUERY_IPV6_GROUP_INIT; #endif - if (ERR_OK == igmp_joingroup(IP4_ADDR_ANY4, ip_2_ip4(&multicast_addr))) { + if (ERR_OK == igmp_joingroup(ip_2_ip4(&m_netif->ip_addr), ip_2_ip4(&multicast_addr))) { m_pUDPContext = new UdpContext; m_pUDPContext->ref(); diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h index bcd135959..6371478a9 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h @@ -37,6 +37,9 @@ namespace MDNSImplementation { #define ESP_8266_MDNS_INCLUDE //#define DEBUG_ESP_MDNS_RESPONDER +#if !defined(DEBUG_ESP_MDNS_RESPONDER) && defined(DEBUG_ESP_MDNS) +#define DEBUG_ESP_MDNS_RESPONDER +#endif #ifndef LWIP_OPEN_SRC #define LWIP_OPEN_SRC diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index 09336266c..0e8d7f188 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -212,7 +212,7 @@ void SPIClass::setFrequency(uint32_t freq) { return; } - const spiClk_t minFreqReg = { 0x7FFFF000 }; + const spiClk_t minFreqReg = { 0x7FFFF020 }; uint32_t minFreq = ClkRegToFreq((spiClk_t*) &minFreqReg); if(freq < minFreq) { // use minimum possible clock diff --git a/libraries/SoftwareSerial b/libraries/SoftwareSerial index 4abc14f42..776d49b2f 160000 --- a/libraries/SoftwareSerial +++ b/libraries/SoftwareSerial @@ -1 +1 @@ -Subproject commit 4abc14f4295f3d2dd296f535c48740339edc6d4d +Subproject commit 776d49b2f570b93fe88ad7a082519b4fb56be817 diff --git a/libraries/esp8266/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/esp8266/examples/WiFiShutdown/WiFiShutdown.ino new file mode 100644 index 000000000..1c0624fd6 --- /dev/null +++ b/libraries/esp8266/examples/WiFiShutdown/WiFiShutdown.ino @@ -0,0 +1,258 @@ + +// demonstrate the use of WiFi.mode(SHUTDOWN/RESUME) +// released to public domain + +// current on wemos d1 mini (including: ldo, usbserial chip): +// ~85mA during normal operations +// ~30mA during wifi shutdown +// ~5mA during deepsleep + +#ifndef STASSID +#define STASSID "mynetwork" +#define STAPSK "mynetworkpasswd" +#endif + +#define WAIT_NTP 0 // define this to 1 for NTP check too + +#include +#include // crc32() +#include // WiFiState structure details + +enum state_e { + e_initial, + e_start_resume, + e_start_normal, + e_off_restart, + e_wait_connected, + e_wait_ntp, + e_shutdown, + e_wait_shutdown, + e_wait_off +}; + +static state_e step = e_initial; // step +static int wifi_timeout = 0; // wifi timeout counter +static bool time_is_set = false; // WAIT_NTP=1: wait for network - dhcp packet must have ntp server + +// non volatile data +struct nv_s { + WiFiState wss; // core's wifi save state + + uint32_t crc; + struct { + int rstcounter[7]; + } data; +}; +static nv_s* nv = (nv_s*)RTC_USER_MEM; // user non volatile area + +#define SEP "###### " +#define EV "!!!!!! " +#define NFO "------ " + +void resetUserCrc() { + nv->crc = crc32(&nv->data, sizeof(nv->data)); +} + +void printNv() { + Serial.printf(NFO "nfo1/2 wifi-nv-state: valid=%d, " + "persistent=%d, " + "mode=%d, " + "channel=%d, " + "ip=%s, " + "dns=%s, " + "ntp=%s\n", + WiFi.shutdownValidCRC(&nv->wss), + nv->wss.state.persistent, + nv->wss.state.mode, + nv->wss.state.channel, + IPAddress(&nv->wss.state.ip.ip).toString().c_str(), + IPAddress(&nv->wss.state.dns[0]).toString().c_str(), + IPAddress(&nv->wss.state.ntp[0]).toString().c_str()); + + Serial.printf(NFO "nfo2/2 rst reason counters: default:%d wdt:%d exception:%d softwdt:%d reset:%d deepsleep:%d extsys:%d\n", + nv->data.rstcounter[0], + nv->data.rstcounter[1], + nv->data.rstcounter[2], + nv->data.rstcounter[3], + nv->data.rstcounter[4], + nv->data.rstcounter[5], + nv->data.rstcounter[6]); +} + +void timeset_cb() { + time_is_set = true; + + static bool first = true; + if (first) { + first = false; + } +} + +decltype(millis()) startup; + + +WiFiEventHandler evOff = WiFi.onWiFiModeChange([](const WiFiEventModeChange& event) { + Serial.printf(EV "mode changed event: ev:%d->%d getMode=%d\n", event.oldMode, event.newMode, wifi_get_opmode()); +}); + +void preinit() { + ESP8266WiFiClass::preinitWiFiOff(); +} + +void setup() { + WiFi.persistent(false); + startup = millis(); + Serial.begin(115200); + settimeofday_cb(timeset_cb); + + // prepare non volatile user structure + if (crc32(&nv->data, sizeof(nv->data)) != nv->crc) { + memset(&nv->data, 0, sizeof(nv->data)); + Serial.printf(SEP "reset NV user data\n"); + } + // update reset reason + nv->data.rstcounter[system_get_rst_info()->reason]++; + // recalculate crc + resetUserCrc(); + // nfo + printNv(); + + Serial.println("setup()"); +} + +#define TEST(x...) ({ auto v = x; Serial.printf(SEP "'%s': result = %d\n", #x, v); v; }) + +void loop() { + + static int prev = 255; + if (step != prev) { + prev = step; + Serial.printf(NFO "step %d - wifi getMode=%d=%d heap=%d freeheap=%d\n", + prev, + WiFi.getMode(), + wifi_get_opmode(), + ESP.getFreeHeap(), + ESP.getFreeHeap()); + printNv(); + } + + switch (step) { + + case e_initial: { + if (WiFi.shutdownValidCRC(&nv->wss)) { + step = e_start_resume; + } else { + step = e_start_normal; + } + break; + } + + + case e_start_resume: + Serial.println(SEP "CRC valid => WIFI_RESUME"); + startup = millis(); + + if (!TEST(WiFi.mode(WIFI_RESUME, &nv->wss))) { + Serial.printf(SEP "issue resuming WiFi\n"); + step = e_off_restart; + } else { + Serial.printf(SEP "waiting for connected\\n"); + step = e_wait_connected; + } + break; + + + case e_start_normal: + Serial.printf(SEP "CRC NOT valid, begin/WIFI_STA (current mode = %d)\n", wifi_get_opmode()); + startup = millis(); + if (!TEST(WiFi.mode(WIFI_STA)) || !TEST(WiFi.begin(STASSID, STAPSK))) { + Serial.printf(SEP "issue setting up STA\n"); + step = e_off_restart; + } else { + Serial.printf(SEP "waiting for connected\n"); + step = e_wait_connected; + } + break; + + + case e_wait_connected: + if (WiFi.status() == WL_CONNECTED) { + Serial.printf(SEP "connected! ---- startup time: %ld ms ----\n\n\n", millis() - startup); + wifi_timeout = 0; + if (WAIT_NTP) { + step = e_wait_ntp; + Serial.printf(SEP "wait for NTP\n"); + } else { + step = e_shutdown; + } + } else if ((millis() - startup > 10000)) { + Serial.printf(SEP "connected TIMEOUT! status=%d\n", WiFi.status()); + wifi_timeout++; + step = e_off_restart; + } + break; + + + case e_off_restart: + Serial.printf(SEP "OFF -> wait 2s\n"); + (void)TEST(WiFi.mode(WIFI_OFF)); + delay(2000); // test - mad wifi loop until :oom if delay not there - to verify + step = e_initial; + break; + + + case e_wait_ntp: + // check when NTP has set time + if (time_is_set) { + Serial.printf(SEP "NTP is set\n"); + time_is_set = false; + step = e_shutdown; + } + break; + + + case e_shutdown: { + static int deepsleep = 0; + switch (++deepsleep) { + case 1: { + Serial.println(SEP "WIFI_OFF for 5s"); + TEST(WiFi.mode(WIFI_OFF)); + step = e_wait_off; + break; + } + case 2: // several loop on shutdown + case 3: // to check if it affects + case 4: { // reconnection duration + Serial.println(SEP "WIFI_SHUTDOWN for 5s"); + TEST(WiFi.mode(WIFI_SHUTDOWN, &nv->wss)); + step = e_wait_shutdown; + break; + } + default: { + Serial.println(SEP "DEEPSLEEP for 5s (bind GPIO16 <=> RST)"); + TEST(WiFi.mode(WIFI_SHUTDOWN, &nv->wss)); + Serial.flush(); + ESP.deepSleep(5000000); + // will reboot, GPIO16 must be connected to reset + } + } + + startup = millis(); + break; + } + + + case e_wait_shutdown: + if (millis() - startup > 5000) { + step = e_start_resume; + } + break; + + + case e_wait_off: + if (millis() - startup > 5000) { + step = e_start_normal; + } + break; + } +} diff --git a/libraries/esp8266/examples/arduino_new/arduino_new.ino b/libraries/esp8266/examples/arduino_new/arduino_new.ino new file mode 100644 index 000000000..e31c56378 --- /dev/null +++ b/libraries/esp8266/examples/arduino_new/arduino_new.ino @@ -0,0 +1,159 @@ + +// show arduino_new benefits +// released to public domain +// result is below + +class SomeClass { + public: + SomeClass(const String& s1 = emptyString, const String& s2 = emptyString) { + Serial.printf("SomeClass@%p(%s)(%s)\n", this, s1.c_str(), s2.c_str()); + } + + ~SomeClass() { + Serial.printf("~ SomeClass @%p\n", this); + } +}; + +class oom { + private: + char large [65000]; + public: + oom() { + Serial.printf("this constructor should not be called\n"); + } +}; + +void setup() { + + Serial.begin(115200); + Serial.printf("\n\narduino_new benefits\n\n"); + delay(5000); // avoid too frequent bootloop + + // arduino_new / arduino_newarray api + + Serial.printf("\n----- arduino_new:\n"); + auto an = arduino_new(SomeClass); + delete an; + + Serial.printf("\n----- arduino_new with oom:\n"); + auto anoom = arduino_new(oom); + Serial.printf("nullptr: %p\n", anoom); + delete anoom; + + Serial.printf("\n----- arduino_new with constructor parameters:\n"); + auto ancp = arduino_new(SomeClass, "param1", "param2"); + delete ancp; + + Serial.printf("\n----- arduino_newarray[2]\n"); + auto ana2 = arduino_newarray(SomeClass, 2); + Serial.printf("@:%p s=%zd s(2)=%zd\n", ana2, sizeof(SomeClass), sizeof(SomeClass[2])); + Serial.printf("0: %p\n", &ana2[0]); + Serial.printf("1: %p\n", &ana2[1]); + delete [] ana2; + + Serial.printf("\n----- arduino_newarray[2] (with constructor parameters)\n"); + auto ana2cp = arduino_newarray(SomeClass, 2, "param1"); + Serial.printf("@:%p s=%zd s(2)=%zd\n", ana2cp, sizeof(SomeClass), sizeof(SomeClass[2])); + Serial.printf("0: %p\n", &ana2cp[0]); + Serial.printf("1: %p\n", &ana2cp[1]); + delete [] ana2cp; + + Serial.printf("\n----- arduino_newarray[100000]\n"); + auto anaX = arduino_newarray(SomeClass, 100000); + Serial.printf("@:%p\n", anaX); + + // standard c++ api for new and new[] + + Serial.printf("\n----- new\n"); + auto sn = new SomeClass; + delete sn; + + Serial.printf("\n----- new with oom: (abort() with option 'Exceptions: Disabled (new can abort)'\n"); + auto snoom = new oom; + Serial.printf("nullptr: %p\n", snoom); + delete snoom; + + Serial.printf("\n----- new[2]\n"); + auto sna2 = new SomeClass[2]; + Serial.printf("@:%p s=%zd s(2)=%zd\n", sna2, sizeof(SomeClass), sizeof(SomeClass[2])); + Serial.printf("0: %p\n", &sna2[0]); + Serial.printf("1: %p\n", &sna2[1]); + delete [] sna2; + + Serial.printf("\n----- new[10000] (badly fails with 'Exceptions: Legacy' or '...Disabled'\n"); + auto snaX = new SomeClass[100000]; + Serial.printf("@:%p\n", snaX); +} + +void loop() { +} + +////////////////////////////// +/* + + Result with: + Exceptions: Legacy(new can return nullptr) + + ////////////////////////////// + + arduino_new benefits + + ----- arduino_new: + SomeClass@0x3fff1864()() + ~ SomeClass @0x3fff1864 + + ----- arduino_new with oom: + nullptr: 0 + + ----- arduino_new with constructor parameters: + SomeClass@0x3fff1864(param1)(param2) + ~ SomeClass @0x3fff1864 + + ----- arduino_newarray[2] + SomeClass@0x3fff1868()() + SomeClass@0x3fff1869()() + @: 0x3fff1868 s = 1 s(2) = 2 + 0: 0x3fff1868 + 1: 0x3fff1869 + ~ SomeClass @0x3fff1869 + ~ SomeClass @0x3fff1868 + + ----- arduino_newarray[2](with constructor parameters) + SomeClass@0x3fff1868(param1)() + SomeClass@0x3fff1869(param1)() + @: 0x3fff1868 s = 1 s(2) = 2 + 0: 0x3fff1868 + 1: 0x3fff1869 + ~ SomeClass @0x3fff1869 + ~ SomeClass @0x3fff1868 + + ----- arduino_newarray[100000] + @: 0 + + ----- new + SomeClass@0x3fff1864()() + ~ SomeClass @0x3fff1864 + + ----- new with oom: (abort() with option 'Exceptions: Disabled (new can abort)' + this constructor should not be called + nullptr: 0 + + ----- new[2] + SomeClass@0x3fff1868()() + SomeClass@0x3fff1869()() + @:0x3fff1868 s = 1 s(2) = 2 + 0: 0x3fff1868 + 1: 0x3fff1869 + ~ SomeClass @0x3fff1869 + ~ SomeClass @0x3fff1868 + + ----- new[10000](badly fails with 'Exceptions: Legacy' or '...Disabled' + + Exception(29): + epc1 = 0x402013de epc2 = 0x00000000 epc3 = 0x00000000 excvaddr = 0x00000000 depc = 0x00000000 + + >>> stack >>> + ... + +*/ +///////////////////////////// diff --git a/package/build_boards_manager_package.sh b/package/build_boards_manager_package.sh index e18ededfc..8220ad236 100755 --- a/package/build_boards_manager_package.sh +++ b/package/build_boards_manager_package.sh @@ -74,7 +74,7 @@ fi # handles tool paths differently when package is installed in hardware folder cat $srcdir/platform.txt | \ $SED 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \ -$SED 's/runtime.tools.python.path=.*//g' | \ +$SED 's/runtime.tools.python3.path=.*//g' | \ $SED 's/runtime.tools.esptool.path={runtime.platform.path}\/tools\/esptool//g' | \ $SED 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' | \ $SED 's/^tools.esptool.cmd=.*//g' | \ @@ -156,7 +156,7 @@ new_json=package_esp8266com_index.json set +e # Merge the old and new, then drop any obsolete package versions -python ../../merge_packages.py $new_json $old_json | python ../../drop_versions.py - tools 1.20.0-26-gb404fb9 >tmp && mv tmp $new_json && rm $old_json +python3 ../../merge_packages.py $new_json $old_json | python3 ../../drop_versions.py - tools 1.20.0-26-gb404fb9 >tmp && mv tmp $new_json && rm $old_json # Verify the JSON file can be read, fail if it's not OK set -e diff --git a/package/drop_versions.py b/package/drop_versions.py index a3aa9b288..6acd5a945 100755 --- a/package/drop_versions.py +++ b/package/drop_versions.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This script drops one or multiple versions of a release # from __future__ import print_function diff --git a/package/merge_packages.py b/package/merge_packages.py index dba8bb9d6..1e0b1fb27 100755 --- a/package/merge_packages.py +++ b/package/merge_packages.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This script merges two Arduino Board Manager package json files. # Usage: # python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index 74204a123..cc4e3f866 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -127,7 +127,7 @@ { "packager": "esp8266", "version": "3.7.2-post1", - "name": "python" + "name": "python3" } ], "help": { @@ -138,56 +138,56 @@ "tools": [ { "version": "3.7.2-post1", - "name": "python", + "name": "python3", "systems": [ { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-3.7.2.post1-embed-win32v2.zip", - "archiveFileName": "python-3.7.2.post1-embed-win32v2.zip", - "checksum": "SHA-256:26665d2925ee75118bb7d8620e9ee988adc2ca3e660a9f4c06a09a06c94c0c29", - "size": "6431781" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-3.7.2.post1-embed-win32v2a.zip", + "archiveFileName": "python3-3.7.2.post1-embed-win32v2a.zip", + "checksum": "SHA-256:f57cb2daf86176d2929e7c58990c2ac32554e3219d454dcac10e464ddda35bf2", + "size": "6428926" }, { "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-3.7.2.post1-embed-win32v2.zip", - "archiveFileName": "python-3.7.2.post1-embed-win32v2.zip", - "checksum": "SHA-256:26665d2925ee75118bb7d8620e9ee988adc2ca3e660a9f4c06a09a06c94c0c29", - "size": "6431781" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-3.7.2.post1-embed-win32v2a.zip", + "archiveFileName": "python3-3.7.2.post1-embed-win32va2.zip", + "checksum": "SHA-256:f57cb2daf86176d2929e7c58990c2ac32554e3219d454dcac10e464ddda35bf2", + "size": "6428926" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", - "archiveFileName": "python-placeholder.tar.gz", - "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", - "size": "193" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", + "archiveFileName": "python3-placeholder.tar.gz", + "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", + "size": "191" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", - "archiveFileName": "python-placeholder.tar.gz", - "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", - "size": "193" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", + "archiveFileName": "python3-placeholder.tar.gz", + "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", + "size": "191" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", - "archiveFileName": "python-placeholder.tar.gz", - "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", - "size": "193" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", + "archiveFileName": "python3-placeholder.tar.gz", + "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", + "size": "191" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", - "archiveFileName": "python-placeholder.tar.gz", - "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", - "size": "193" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-macosx-placeholder.tar.gz", + "archiveFileName": "python3-macosx-placeholder.tar.gz", + "checksum": "SHA-256:5bfa0d4c2dc3edeeaa913f4eac42ef3ff0bf8c8fe9f11be112a8ca7911de2dae", + "size": "198" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", - "archiveFileName": "python-placeholder.tar.gz", - "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", - "size": "193" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", + "archiveFileName": "python3-placeholder.tar.gz", + "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", + "size": "191" } ] }, @@ -359,4 +359,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/platform.txt b/platform.txt index 9ddfe6dab..8bccbe2af 100644 --- a/platform.txt +++ b/platform.txt @@ -10,11 +10,12 @@ version=2.6.0-dev # These will be removed by the packager script when doing a JSON release runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf -runtime.tools.python.path={runtime.platform.path}/tools/python +runtime.tools.python3.path={runtime.platform.path}/tools/python3 runtime.tools.esptool.path={runtime.platform.path}/tools/esptool runtime.tools.signing={runtime.platform.path}/tools/signing.py runtime.tools.elf2bin={runtime.platform.path}/tools/elf2bin.py +runtime.tools.sizes={runtime.platform.path}/tools/sizes.py runtime.tools.makecorever={runtime.platform.path}/tools/makecorever.py runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf @@ -83,9 +84,10 @@ compiler.objcopy.eep.extra_flags= compiler.elf2hex.extra_flags= ## generate file with git version number -## needs bash, git, and echo -recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" -recipe.hooks.core.prebuild.pattern="{runtime.tools.python.path}/python" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" +## needs git +recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" +# This is quite a working hack. This form of prebuild hook, while intuitive, is not explicitly documented. +recipe.hooks.prebuild.10.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" @@ -109,8 +111,9 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_ recipe.objcopy.eep.pattern= ## Create hex -recipe.objcopy.hex.1.pattern="{runtime.tools.python.path}/python" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin" -recipe.objcopy.hex.2.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" --legacy "{build.path}/{build.project_name}.bin.legacy_sig" +recipe.objcopy.hex.1.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin" +recipe.objcopy.hex.2.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" --legacy "{build.path}/{build.project_name}.bin.legacy_sig" +recipe.objcopy.hex.3.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.sizes}" --elf "{build.path}/{build.project_name}.elf" --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" ## Save hex recipe.output.tmp_file={build.project_name}.bin @@ -126,12 +129,12 @@ recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).* tools.esptool.path= # Because the variable expansion doesn't allow one tool to find another, the following lines -# will point to "{runtime.platform.path}/tools/python/python" in GIT and -# "{runtime.tools.python.path}/python" for JSON board manager releases. -#tools.esptool.cmd={runtime.tools.python.path}/python -#tools.esptool.network_cmd={runtime.tools.python.path}/python -tools.esptool.cmd={runtime.platform.path}/tools/python/python -tools.esptool.network_cmd={runtime.platform.path}/tools/python/python +# will point to "{runtime.platform.path}/tools/python3/python3" in GIT and +# "{runtime.tools.python3.path}/python3" for JSON board manager releases. +#tools.esptool.cmd={runtime.tools.python3.path}/python3 +#tools.esptool.network_cmd={runtime.tools.python3.path}/python3 +tools.esptool.cmd={runtime.platform.path}/tools/python3/python3 +tools.esptool.network_cmd={runtime.platform.path}/tools/python3/python3 tools.esptool.upload.protocol=esp tools.esptool.upload.params.verbose=--trace diff --git a/tests/common.sh b/tests/common.sh index ca2c53523..b93bd57ba 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -44,8 +44,7 @@ function print_size_info() segments[$seg]=$size fi - - done < <(xtensa-lx106-elf-size --format=sysv $elf_file) + done < <(xtensa-lx106-elf-size --format=sysv $elf_file | sed 's/\r//g' ) total_ram=$((${segments[data]} + ${segments[rodata]} + ${segments[bss]})) total_flash=$((${segments[data]} + ${segments[rodata]} + ${segments[text]} + ${segments[irom0text]})) @@ -65,7 +64,11 @@ function build_sketches() local build_rem=$5 local lwip=$6 mkdir -p $build_dir - local build_cmd="python tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p $PWD/$build_dir -n $lwip $build_arg " + local build_cmd="python3 tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p $PWD/$build_dir -n $lwip $build_arg " + if [ "$WINDOWS" = "1" ]; then + # Paths to the arduino builder need to be / referenced, not our native ones + build_cmd=$(echo $build_cmd --ide_path $arduino | sed 's/ \/c\// \//g' ) # replace '/c/' with '/' + fi local sketches=$(find $srcpath -name *.ino | sort) print_size_info >size.log export ARDUINO_IDE_PATH=$arduino @@ -107,6 +110,14 @@ function build_sketches() fi echo -e "\n ------------ Building $sketch ------------ \n"; # $arduino --verify $sketch; + if [ "$WINDOWS" == "1" ]; then + sketch=$(echo $sketch | sed 's/^\/c//') + # MINGW will try to be helpful and silently convert args that look like paths to point to a spot inside the MinGW dir. This breaks everything. + # http://www.mingw.org/wiki/Posix_path_conversion + # https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471 + export MSYS2_ARG_CONV_EXC="*" + export MSYS_NO_PATHCONV=1 + fi echo "$build_cmd $sketch" time ($build_cmd $sketch >build.log) local result=$? @@ -135,7 +146,7 @@ function install_libraries() pushd $HOME/Arduino/libraries # install ArduinoJson library - { test -r ArduinoJson-v6.11.0.zip || wget https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip ArduinoJson-v6.11.0.zip + { test -r ArduinoJson-v6.11.0.zip || wget -nv https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip -q ArduinoJson-v6.11.0.zip popd } @@ -145,13 +156,40 @@ function install_ide() local ide_path=$1 local core_path=$2 local debug=$3 - test -r arduino.tar.xz || wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz - tar xf arduino.tar.xz + if [ "$WINDOWS" = "1" ]; then + # Acquire needed packages from Windows package manager + choco install --no-progress python3 + export PATH="/c/Python37:$PATH" # Ensure it's live from now on... + cp /c/Python37/python.exe /c/Python37/python3.exe + choco install --no-progress unzip + choco install --no-progress sed + #choco install --no-progress golang + test -r arduino-nightly-windows.zip || wget -nv -O arduino-nightly-windows.zip https://www.arduino.cc/download.php?f=/arduino-nightly-windows.zip + unzip -q arduino-nightly-windows.zip + elif [ "$MACOSX" = "1" ]; then + # MACOS only has next-to-obsolete Python2 installed. Install Python 3 from python.org + wget https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg + sudo installer -pkg python-3.7.4-macosx10.9.pkg -target / + # Install the Python3 certificates, because SSL connections fail w/o them and of course they aren't installed by default. + ( cd "/Applications/Python 3.7/" && sudo "./Install Certificates.command" ) + # Hack to place arduino-builder in the same spot as sane OSes + test -r arduino.zip || wget -O arduino.zip https://downloads.arduino.cc/arduino-nightly-macosx.zip + unzip -q arduino.zip + mv Arduino.app arduino-nightly + mv arduino-nightly/Contents/Java/* arduino-nightly/. + else + test -r arduino.tar.xz || wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz + tar xf arduino.tar.xz + fi mv arduino-nightly $ide_path cd $ide_path/hardware mkdir esp8266com cd esp8266com - ln -s $core_path esp8266 + if [ "$WINDOWS" = "1" ]; then + cp -a $core_path esp8266 + else + ln -s $core_path esp8266 + fi local debug_flags="" if [ "$debug" = "debug" ]; then debug_flags="-DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM" @@ -163,8 +201,14 @@ function install_ide() cat esp8266/platform.local.txt echo -e "\n----\n" cd esp8266/tools - python get.py - export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH" + python3 get.py -q + if [ "$WINDOWS" = "1" ]; then + # Because the symlinks don't work well under Win32, we need to add the path to this copy, not the original... + relbin=$(realpath $PWD/xtensa-lx106-elf/bin) + export PATH="$ide_path:$relbin:$PATH" + else + export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH" + fi } function install_arduino() @@ -174,7 +218,6 @@ function install_arduino() echo -e "travis_fold:start:sketch_test_env_prepare" cd $TRAVIS_BUILD_DIR install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug - which arduino cd $TRAVIS_BUILD_DIR install_libraries echo -e "travis_fold:end:sketch_test_env_prepare" diff --git a/tests/device/Makefile b/tests/device/Makefile index 3412bc96d..b34cb0dbb 100644 --- a/tests/device/Makefile +++ b/tests/device/Makefile @@ -4,8 +4,7 @@ TEST_LIST ?= $(wildcard test_*/*.ino) ESP8266_CORE_PATH ?= $(realpath ../..) BUILD_DIR ?= $(PWD)/.build HARDWARE_DIR ?= $(PWD)/.hardware -#PYTHON ?= python3 -PYTHON ?= python +PYTHON ?= python3 ESPTOOL ?= $(PYTHON) $(ESP8266_CORE_PATH)/tools/esptool/esptool.py MKSPIFFS ?= $(ESP8266_CORE_PATH)/tools/mkspiffs/mkspiffs UPLOAD_PORT ?= $(shell ls /dev/tty* | grep -m 1 -i USB) diff --git a/tests/device/libraries/BSTest/Makefile b/tests/device/libraries/BSTest/Makefile index 2677ad26f..93c181f5f 100644 --- a/tests/device/libraries/BSTest/Makefile +++ b/tests/device/libraries/BSTest/Makefile @@ -15,7 +15,7 @@ $(PYTHON_ENV_DIR): . $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt test: $(TEST_EXECUTABLE) $(PYTHON_ENV_DIR) - . $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE) -m test/test.py + . $(PYTHON_ENV_DIR)/bin/activate && $(PYTHON) runner.py -e $(TEST_EXECUTABLE) -m test/test.py $(TEST_EXECUTABLE): test/test.cpp g++ -std=c++11 -Isrc -o $@ test/test.cpp diff --git a/tests/device/libraries/BSTest/runner.py b/tests/device/libraries/BSTest/runner.py index 9778f35ad..425ac2a42 100644 --- a/tests/device/libraries/BSTest/runner.py +++ b/tests/device/libraries/BSTest/runner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import pexpect from pexpect import EOF, TIMEOUT, fdpexpect diff --git a/tests/device/test_BearSSL/make_spiffs.py b/tests/device/test_BearSSL/make_spiffs.py index 13c77ccf5..e423bc25b 100755 --- a/tests/device/test_BearSSL/make_spiffs.py +++ b/tests/device/test_BearSSL/make_spiffs.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # This script pulls the list of Mozilla trusted certificate authorities # from the web at the "mozurl" below, parses the file to grab the PEM @@ -7,16 +7,18 @@ # and use them for your outgoing SSL connections. # # Script by Earle F. Philhower, III. Released to the public domain. - +from __future__ import print_function import csv import os +import sys from subprocess import Popen, PIPE, call -import urllib2 try: - # for Python 2.x + from urllib.request import urlopen +except: + from urllib2 import urlopen +try: from StringIO import StringIO -except ImportError: - # for Python 3.x +except: from io import StringIO # Mozilla's URL for the CSV file with included PEM certs @@ -25,9 +27,12 @@ mozurl = "https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateRep # Load the manes[] and pems[] array from the URL names = [] pems = [] -response = urllib2.urlopen(mozurl) +response = urlopen(mozurl) csvData = response.read() -csvReader = csv.reader(StringIO(csvData)) +if sys.version_info[0] > 2: + csvData = csvData.decode('utf-8') +csvFile = StringIO(csvData) +csvReader = csv.reader(csvFile) for row in csvReader: names.append(row[0]+":"+row[1]+":"+row[2]) pems.append(row[30]) @@ -46,10 +51,10 @@ idx = 0 for i in range(0, len(pems)): certName = "data/ca_%03d.der" % (idx); thisPem = pems[i].replace("'", "") - print names[i] + " -> " + certName + print(names[i] + " -> " + certName) ssl = Popen(['openssl','x509','-inform','PEM','-outform','DER','-out', certName], shell = False, stdin = PIPE) pipe = ssl.stdin - pipe.write(thisPem) + pipe.write(thisPem.encode('utf-8')) pipe.close() ssl.wait() if os.path.exists(certName): diff --git a/tests/host/Makefile b/tests/host/Makefile index 3768c11b5..aaf8a88d9 100644 --- a/tests/host/Makefile +++ b/tests/host/Makefile @@ -69,6 +69,7 @@ CORE_CPP_FILES := $(addprefix $(CORE_PATH)/,\ libb64/cdecode.cpp \ Schedule.cpp \ HardwareSerial.cpp \ + crc32.cpp \ ) \ $(addprefix $(LIBRARIES_PATH)/ESP8266SdFat/src/, \ FatLib/FatFile.cpp \ diff --git a/tests/host/common/AddrList.h b/tests/host/common/AddrList.h deleted file mode 100644 index 0da63bc7f..000000000 --- a/tests/host/common/AddrList.h +++ /dev/null @@ -1,118 +0,0 @@ - -// TODO -// mock AddrList with POSIX mock API -// later: real AddrList will work with lwIP API - -// mock is IPv4 only - -#ifndef __ADDRLISTX_H -#define __ADDRLISTX_H - -#include - -namespace esp8266 -{ - -namespace AddressListImplementation -{ - - -struct netifWrapper -{ - netifWrapper (bool netif) : _netif(netif) {} - netifWrapper (const netifWrapper& o) : _netif(o._netif) {} - - netifWrapper& operator= (const netifWrapper& o) - { - _netif = o._netif; - return *this; - } - - bool equal(const netifWrapper& o) - { - return _netif == o._netif; - } - - // address properties - IPAddress addr () const { return WiFi.localIP(); } - bool isLegacy () const { return true; } - bool isLocal () const { return false; } - bool isV4 () const { return addr().isV4(); } - bool isV6 () const { return !addr().isV4(); } - String toString() const { return addr().toString(); } - - // related to legacy address (_num=0, ipv4) - IPAddress ipv4 () const { ip_info info; wifi_get_ip_info(0, &info); return info.ip; } - IPAddress netmask () const { ip_info info; wifi_get_ip_info(0, &info); return info.netmask; } - IPAddress gw () const { ip_info info; wifi_get_ip_info(0, &info); return info.gw; } - - // common to all addresses of this interface - String ifname () const { return "st"; } - const char* ifhostname () const { return wifi_station_get_hostname(); } - String ifmac () const { uint8_t mac[20]; WiFi.macAddress(mac); return String((char*)mac); } - int ifnumber () const { return 0; } - bool ifUp () const { return true; } - - bool _netif; -}; - - -class AddressListIterator -{ -public: - AddressListIterator (const netifWrapper& o) : netIf(o) {} - AddressListIterator (bool netif) : netIf(netif) - { - // This constructor is called with lwIP's global netif_list, or - // nullptr. operator++() is designed to loop through _configured_ - // addresses. That's why netIf's _num is initialized to -1 to allow - // returning the first usable address to AddressList::begin(). - (void)operator++(); - } - - const netifWrapper& operator* () const { return netIf; } - const netifWrapper* operator-> () const { return &netIf; } - - bool operator== (AddressListIterator& o) { return netIf.equal(*o); } - bool operator!= (AddressListIterator& o) { return !netIf.equal(*o); } - - AddressListIterator& operator= (const AddressListIterator& o) { netIf = o.netIf; return *this; } - - AddressListIterator operator++ (int) - { - AddressListIterator ret = *this; - (void)operator++(); - return ret; - } - - AddressListIterator& operator++ () - { - netIf._netif = !netIf._netif; - return *this; - } - - netifWrapper netIf; -}; - - -class AddressList -{ -public: - using const_iterator = const AddressListIterator; - - const_iterator begin () const { return const_iterator(true); } - const_iterator end () const { return const_iterator(false); } - -}; - -inline AddressList::const_iterator begin (const AddressList& a) { return a.begin(); } -inline AddressList::const_iterator end (const AddressList& a) { return a.end(); } - - -} // AddressListImplementation - -} // esp8266 - -extern esp8266::AddressListImplementation::AddressList addrList; - -#endif diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp index 7fdf4b22f..565c7942d 100644 --- a/tests/host/common/ArduinoMain.cpp +++ b/tests/host/common/ArduinoMain.cpp @@ -129,24 +129,26 @@ void help (const char* argv0, int exitcode) " -b - blocking tty/mocked-uart (default: not blocking tty)\n" " -S - spiffs size in KBytes (default: %zd)\n" " -L - littlefs size in KBytes (default: %zd)\n" - " -v - mock verbose\n" - " (negative value will force mismatched size)\n" + "\t (spiffs, littlefs: negative value will force mismatched size)\n" + " -T - show timestamp on output\n" + " -v - verbose\n" , argv0, MOCK_PORT_SHIFTER, spiffs_kb, littlefs_kb); exit(exitcode); } static struct option options[] = { - { "help", no_argument, NULL, 'h' }, - { "fast", no_argument, NULL, 'f' }, - { "local", no_argument, NULL, 'l' }, - { "sigint", no_argument, NULL, 'c' }, - { "blockinguart", no_argument, NULL, 'b' }, - { "verbose", no_argument, NULL, 'v' }, - { "interface", required_argument, NULL, 'i' }, - { "spiffskb", required_argument, NULL, 'S' }, - { "littlefskb", required_argument, NULL, 'L' }, - { "portshifter", required_argument, NULL, 's' }, + { "help", no_argument, NULL, 'h' }, + { "fast", no_argument, NULL, 'f' }, + { "local", no_argument, NULL, 'l' }, + { "sigint", no_argument, NULL, 'c' }, + { "blockinguart", no_argument, NULL, 'b' }, + { "verbose", no_argument, NULL, 'v' }, + { "timestamp", no_argument, NULL, 'T' }, + { "interface", required_argument, NULL, 'i' }, + { "spiffskb", required_argument, NULL, 'S' }, + { "littlefskb", required_argument, NULL, 'L' }, + { "portshifter", required_argument, NULL, 's' }, }; void cleanup () @@ -182,7 +184,7 @@ int main (int argc, char* const argv []) for (;;) { - int n = getopt_long(argc, argv, "hlcfbvi:S:s:L:", options, NULL); + int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:", options, NULL); if (n < 0) break; switch (n) @@ -217,6 +219,9 @@ int main (int argc, char* const argv []) case 'v': mockdebug = true; break; + case 'T': + serial_timestamp = true; + break; default: help(argv[0], EXIT_FAILURE); } diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp index 00e20b3e8..a2d72081d 100644 --- a/tests/host/common/MockTools.cpp +++ b/tests/host/common/MockTools.cpp @@ -41,6 +41,7 @@ uint32_t lwip_ntohl (uint32_t netlong) { return ntohl(netlong); } uint16_t lwip_ntohs (uint16_t netshort) { return ntohs(netshort); } char* ets_strcpy (char* d, const char* s) { return strcpy(d, s); } +char* ets_strncpy (char* d, const char* s, size_t n) { return strncpy(d, s, n); } size_t ets_strlen (const char* s) { return strlen(s); } int ets_printf (const char* fmt, ...) diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp index 6c6a54ab3..67af7ed2c 100644 --- a/tests/host/common/MockUART.cpp +++ b/tests/host/common/MockUART.cpp @@ -29,6 +29,8 @@ */ #include // write +#include // gettimeofday +#include // localtime #include "Arduino.h" #include "uart.h" @@ -59,13 +61,35 @@ struct uart_ struct uart_rx_buffer_ * rx_buffer; }; +bool serial_timestamp = false; + // write one byte to the emulated UART static void uart_do_write_char(const int uart_nr, char c) { + static bool w = false; + if (uart_nr >= UART0 && uart_nr <= UART1) - if (1 != write(uart_nr + 1, &c, 1)) - fprintf(stderr, "Unable to write character to emulated UART stream: %d\n", c); + { + if (serial_timestamp && (c == '\n' || c == '\r')) + { + if (w) + { + FILE* out = uart_nr == UART0? stdout: stderr; + timeval tv; + gettimeofday(&tv, nullptr); + const tm* tm = localtime(&tv.tv_sec); + fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec); + fflush(out); + w = false; + } + } + else + { + write(uart_nr + 1, &c, 1); + w = true; + } + } } // write a new byte into the RX FIFO buffer diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp index a4b9bbcad..bc5ae6ebc 100644 --- a/tests/host/common/MocklwIP.cpp +++ b/tests/host/common/MocklwIP.cpp @@ -1,10 +1,15 @@ +#include #include +esp8266::AddressListImplementation::AddressList addrList; + extern "C" { -netif* netif_list = nullptr; +extern netif netif0; + +netif* netif_list = &netif0; err_t dhcp_renew(struct netif *netif) { @@ -12,4 +17,13 @@ err_t dhcp_renew(struct netif *netif) return ERR_OK; } +void sntp_setserver(u8_t, const ip_addr_t) +{ +} + +const ip_addr_t* sntp_getserver(u8_t) +{ + return IP_ADDR_ANY; +} + } // extern "C" diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h index e61616737..a908b2aba 100644 --- a/tests/host/common/mock.h +++ b/tests/host/common/mock.h @@ -85,7 +85,7 @@ int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2))); int mockverbose (const char* fmt, ...) __attribute__ ((format (printf, 1, 2))); extern const char* host_interface; // cmdline parameter - +extern bool serial_timestamp; extern int mock_port_shifter; #define NO_GLOBAL_BINDING 0xffffffff diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp index ceba51de7..e7b109401 100644 --- a/tests/host/common/user_interface.cpp +++ b/tests/host/common/user_interface.cpp @@ -44,6 +44,7 @@ extern "C" { #include +#include uint8 wifi_get_opmode(void) { @@ -115,6 +116,8 @@ void wifi_fpm_set_sleep_type (sleep_type_t type) uint32_t global_ipv4_netfmt = 0; // global binding +netif netif0; + bool wifi_get_ip_info (uint8 if_index, struct ip_info *info) { struct ifaddrs * ifAddrStruct = NULL, * ifa = NULL; @@ -165,6 +168,12 @@ bool wifi_get_ip_info (uint8 if_index, struct ip_info *info) info->ip.addr = ipv4; info->netmask.addr = mask; info->gw.addr = ipv4; + + netif0.ip_addr.addr = ipv4; + netif0.netmask.addr = mask; + netif0.gw.addr = ipv4; + netif0.flags = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP; + netif0.next = nullptr; } return true; @@ -461,7 +470,9 @@ bool smartconfig_stop (void) return true; } - - +sleep_type_t wifi_fpm_get_sleep_type(void) +{ + return NONE_SLEEP_T; +} } // extern "C" diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h index be5046bd9..1b357d2e3 100644 --- a/tests/host/sys/pgmspace.h +++ b/tests/host/sys/pgmspace.h @@ -60,6 +60,7 @@ inline size_t strlen_P(const char *s) { return strlen(s); } inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap) { return vsnprintf(str, size, format, ap); } #define memcpy_P memcpy +#define memmove_P memmove #define strncpy_P strncpy #define strcmp_P strcmp #define memccpy_P memccpy diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 9e7e83926..3d8c947b2 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # boards.txt python builder for esp8266/Arduino # Copyright (C) 2017 community @@ -32,6 +32,7 @@ # 512K/1M/2M/4M/8M/16M: menus for flash & SPIFFS size # lwip/lwip2 menus for available lwip versions +from __future__ import print_function import os import sys import collections @@ -300,7 +301,7 @@ boards = collections.OrderedDict([ ( '.menu.ResetMethod.v1.upload.resetmethod', 'ck' ), ( '.menu.UploadTool.esptool', 'Serial' ), ( '.menu.UploadTool.esptool.upload.tool', 'esptool' ), - ( '.menu.UploadTool.esptool.upload.verbose', '-vv' ), + ( '.menu.UploadTool.esptool.upload.verbose', '--trace' ), ( '.menu.UploadTool.espota', 'OTA' ), ( '.menu.UploadTool.espota.upload.tool', 'espota' ), ]), @@ -882,8 +883,11 @@ macros = { ]), 'exception_menu': collections.OrderedDict([ - ( '.menu.exception.disabled', 'Disabled' ), - ( '.menu.exception.disabled.build.exception_flags', '-fno-exceptions' ), + ( '.menu.exception.legacy', 'Legacy (new can return nullptr)' ), + ( '.menu.exception.legacy.build.exception_flags', '-fno-exceptions' ), + ( '.menu.exception.legacy.build.stdcpp_lib', '-lstdc++' ), + ( '.menu.exception.disabled', 'Disabled (new can abort)' ), + ( '.menu.exception.disabled.build.exception_flags', '-fno-exceptions -DNEW_OOM_ABORT' ), ( '.menu.exception.disabled.build.stdcpp_lib', '-lstdc++' ), ( '.menu.exception.enabled', 'Enabled' ), ( '.menu.exception.enabled.build.exception_flags', '-fexceptions' ), @@ -1120,7 +1124,7 @@ def comb1 (lst): def all_debug (): listcomb = [ 'SSL', 'TLS_MEM', 'HTTP_CLIENT', 'HTTP_SERVER' ] - listnocomb = [ 'CORE', 'WIFI', 'HTTP_UPDATE', 'UPDATER', 'OTA', 'OOM' ] + listnocomb = [ 'CORE', 'WIFI', 'HTTP_UPDATE', 'UPDATER', 'OTA', 'OOM', 'MDNS' ] listsingle = [ 'NoAssert-NDEBUG' ] options = combn(listcomb) options += comb1(listnocomb) @@ -1410,7 +1414,7 @@ def all_boards (): # standalone options if 'opts' in board: - for optname in board['opts']: + for optname in sorted(board['opts']): print(id + optname + '=' + board['opts'][optname]) # macros diff --git a/tools/build.py b/tools/build.py index 828b53408..efb1409ba 100755 --- a/tools/build.py +++ b/tools/build.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # build.py — build a sketch using arduino-builder @@ -20,33 +20,46 @@ # # - from __future__ import print_function import sys import os import argparse +import platform import subprocess import tempfile import shutil + +# Arduino-builder needs forward-slash paths for passed in params or it cannot +# launch the needed toolset. +def windowsize_paths(l): + """Convert forward-slash paths to backslash paths referenced from C:""" + out = [] + for i in l: + if i.startswith('/'): + i = 'C:' + i + out += [i.replace('/', '\\')] + return out + def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args): - cmd = ide_path + '/arduino-builder ' - cmd += '-compile -logger=human ' - cmd += '-build-path "' + tmp_dir + '" ' - cmd += '-tools "' + ide_path + '/tools-builder" ' + cmd = [] + cmd += [ide_path + '/arduino-builder'] + cmd += ['-compile', '-logger=human'] + cmd += ['-build-path', tmp_dir] + cmd += ['-tools', ide_path + '/tools-builder'] if cache != "": - cmd += '-build-cache "' + cache + '" ' + cmd += ['-build-cache', cache ] if args.library_path: for lib_dir in args.library_path: - cmd += '-libraries "' + lib_dir + '" ' - cmd += '-hardware "' + ide_path + '/hardware" ' + cmd += ['-libraries', lib_dir] + cmd += ['-hardware', ide_path + '/hardware'] if args.hardware_dir: for hw_dir in args.hardware_dir: - cmd += '-hardware "' + hw_dir + '" ' + cmd += ['-hardware', hw_dir] else: - cmd += '-hardware "' + hardware_dir + '" ' + cmd += ['-hardware', hardware_dir] # Debug=Serial,DebugLevel=Core____ - cmd += '-fqbn=esp8266com:esp8266:{board_name}:' \ + fqbn = '-fqbn=esp8266com:esp8266:{board_name}:' \ 'xtal={cpu_freq},' \ 'FlashFreq={flash_freq},' \ 'FlashMode={flash_mode},' \ @@ -55,19 +68,22 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args): 'ip={lwIP},' \ 'ResetMethod=nodemcu'.format(**vars(args)) if args.debug_port and args.debug_level: - cmd += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args)) - cmd += ' ' - cmd += '-ide-version=10607 ' - cmd += '-warnings={warnings} '.format(**vars(args)) + fqbn += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args)) + cmd += [fqbn] + cmd += ['-built-in-libraries', ide_path + '/libraries'] + cmd += ['-ide-version=10607'] + cmd += ['-warnings={warnings}'.format(**vars(args))] if args.verbose: - cmd += '-verbose ' - cmd += sketch + cmd += ['-verbose'] + cmd += [sketch] + + if platform.system() == "Windows": + cmd = windowsize_paths(cmd) if args.verbose: - print('Building: ' + cmd, file=f) + print('Building: ' + " ".join(cmd), file=f) - cmds = cmd.split(' ') - p = subprocess.Popen(cmds, stdout=f, stderr=subprocess.STDOUT) + p = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT) p.wait() return p.returncode @@ -127,6 +143,7 @@ def main(): hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores' output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin' + if args.verbose: print("Sketch: ", sketch_path) print("Build dir: ", tmp_dir) diff --git a/tools/elf2bin.py b/tools/elf2bin.py index 214cd9407..e4423176e 100755 --- a/tools/elf2bin.py +++ b/tools/elf2bin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Generate an Arduino compatible BIN file from bootloader and sketch ELF # Replaces esptool-ck.exe and emulates its behavior. @@ -18,6 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from __future__ import print_function import argparse import re import os diff --git a/tools/espota.py b/tools/espota.py index 0b6270511..373020a91 100755 --- a/tools/espota.py +++ b/tools/espota.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Original espota.py by Ivan Grokhotkov: # https://gist.github.com/igrr/d35ab8446922179dc58c @@ -8,9 +8,9 @@ # Modified since 2016-01-03 from Matthew O'Gorman (https://githumb.com/mogorman) # # This script will push an OTA update to the ESP -# use it like: python espota.py -i -I -p -P [-a password] -f +# use it like: python3 espota.py -i -I -p -P [-a password] -f # Or to upload SPIFFS image: -# python espota.py -i -I -p -P [-a password] -s -f +# python3 espota.py -i -I -p -P [-a password] -s -f # # Changes # 2015-09-18: diff --git a/tools/get.py b/tools/get.py index a1091c5f0..74b6b510d 100755 --- a/tools/get.py +++ b/tools/get.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This script will download and extract required tools into the current directory. # Tools list is obtained from package/package_esp8266com_index.template.json file. # Written by Ivan Grokhotkov, 2015. @@ -15,6 +15,9 @@ import sys import tarfile import zipfile import re + +verbose = True + if sys.version_info[0] == 3: from urllib.request import urlretrieve else: @@ -38,10 +41,12 @@ def mkdir_p(path): raise def report_progress(count, blockSize, totalSize): - percent = int(count*blockSize*100/totalSize) - percent = min(100, percent) - sys.stdout.write("\r%d%%" % percent) - sys.stdout.flush() + global verbose + if verbose: + percent = int(count*blockSize*100/totalSize) + percent = min(100, percent) + sys.stdout.write("\r%d%%" % percent) + sys.stdout.flush() def unpack(filename, destination): dirname = '' @@ -111,6 +116,11 @@ def identify_platform(): return arduino_platform_names[sys_name][bits] def main(): + global verbose + # Support optional "-q" quiet mode simply + if len(sys.argv) == 2: + if sys.argv[1] == "-q": + verbose = False print('Platform: {0}'.format(identify_platform())) tools_to_download = load_tools_list('../package/package_esp8266com_index.template.json', identify_platform()) mkdir_p(dist_dir) diff --git a/tools/makecorever.py b/tools/makecorever.py index b8fbda8ef..3f1422b5d 100755 --- a/tools/makecorever.py +++ b/tools/makecorever.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Generate the core_version.h header per-build # @@ -35,9 +35,19 @@ def generate(path, platform_path, git_ver="ffffffff", git_desc="unspecified"): except: pass + text = "#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver) + text += "#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc) + + try: + with open(path, "r") as inp: + old_text = inp.read() + if old_text == text: + return + except: + pass + with open(path, "w") as out: - out.write("#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver)) - out.write("#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc)) + out.write(text) if __name__ == "__main__": diff --git a/tools/sdk/include/ets_sys.h b/tools/sdk/include/ets_sys.h index 731e562b4..da1f3897a 100644 --- a/tools/sdk/include/ets_sys.h +++ b/tools/sdk/include/ets_sys.h @@ -190,6 +190,7 @@ void *pvPortMalloc(size_t xWantedSize, const char* file, int line) __attribute__ void *pvPortRealloc(void* ptr, size_t xWantedSize, const char* file, int line) __attribute__((alloc_size(2))); void vPortFree(void *ptr, const char* file, int line); void *ets_memcpy(void *dest, const void *src, size_t n); +void *ets_memmove(void *dest, const void *src, size_t n); void *ets_memset(void *s, int c, size_t n); void ets_timer_arm_new(ETSTimer *a, int b, int c, int isMstimer); void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn, void *parg); diff --git a/tools/sdk/ld/eagle.rom.addr.v6.ld b/tools/sdk/ld/eagle.rom.addr.v6.ld index 0407fb880..144c72b55 100644 --- a/tools/sdk/ld/eagle.rom.addr.v6.ld +++ b/tools/sdk/ld/eagle.rom.addr.v6.ld @@ -119,8 +119,10 @@ PROVIDE ( ets_install_external_printf = 0x40002450 ); PROVIDE ( ets_install_putc1 = 0x4000242c ); PROVIDE ( ets_install_putc2 = 0x4000248c ); PROVIDE ( ets_install_uart_printf = 0x40002438 ); +/* permanently hide reimplemented ets_intr_*lock(), see #6484 PROVIDE ( ets_intr_lock = 0x40000f74 ); PROVIDE ( ets_intr_unlock = 0x40000f80 ); +*/ PROVIDE ( ets_isr_attach = 0x40000f88 ); PROVIDE ( ets_isr_mask = 0x40000f98 ); PROVIDE ( ets_isr_unmask = 0x40000fa8 ); @@ -128,7 +130,10 @@ PROVIDE ( ets_memcmp = 0x400018d4 ); PROVIDE ( ets_memcpy = 0x400018b4 ); PROVIDE ( ets_memmove = 0x400018c4 ); PROVIDE ( ets_memset = 0x400018a4 ); +/* renamed to ets_post_rom(), see #6484 PROVIDE ( ets_post = 0x40000e24 ); +*/ +PROVIDE ( ets_post_rom = 0x40000e24 ); PROVIDE ( ets_printf = 0x400024cc ); PROVIDE ( ets_putc = 0x40002be8 ); PROVIDE ( ets_rtc_int_register = 0x40002a40 ); diff --git a/tools/sdk/lib/NONOSDK221/libdriver.a b/tools/sdk/lib/NONOSDK221/libdriver.a deleted file mode 100644 index 531ea8727..000000000 Binary files a/tools/sdk/lib/NONOSDK221/libdriver.a and /dev/null differ diff --git a/tools/sdk/lib/NONOSDK22x/libdriver.a b/tools/sdk/lib/NONOSDK22x/libdriver.a deleted file mode 100644 index 89cf520a1..000000000 Binary files a/tools/sdk/lib/NONOSDK22x/libdriver.a and /dev/null differ diff --git a/tools/sdk/lib/NONOSDK22y/libdriver.a b/tools/sdk/lib/NONOSDK22y/libdriver.a deleted file mode 100644 index 89cf520a1..000000000 Binary files a/tools/sdk/lib/NONOSDK22y/libdriver.a and /dev/null differ diff --git a/tools/sdk/lib/NONOSDK3V0/libdriver.a b/tools/sdk/lib/NONOSDK3V0/libdriver.a deleted file mode 100644 index 531ea8727..000000000 Binary files a/tools/sdk/lib/NONOSDK3V0/libdriver.a and /dev/null differ diff --git a/tools/sdk/lib/liblwip2-1460-feat.a b/tools/sdk/lib/liblwip2-1460-feat.a index 5732de9cd..2194496de 100644 Binary files a/tools/sdk/lib/liblwip2-1460-feat.a and b/tools/sdk/lib/liblwip2-1460-feat.a differ diff --git a/tools/sdk/lib/liblwip2-1460.a b/tools/sdk/lib/liblwip2-1460.a index be9966fa6..5acb4f95e 100644 Binary files a/tools/sdk/lib/liblwip2-1460.a and b/tools/sdk/lib/liblwip2-1460.a differ diff --git a/tools/sdk/lib/liblwip2-536-feat.a b/tools/sdk/lib/liblwip2-536-feat.a index bc679a5a6..10cc2a01e 100644 Binary files a/tools/sdk/lib/liblwip2-536-feat.a and b/tools/sdk/lib/liblwip2-536-feat.a differ diff --git a/tools/sdk/lib/liblwip2-536.a b/tools/sdk/lib/liblwip2-536.a index 193d2d439..69e5e881d 100644 Binary files a/tools/sdk/lib/liblwip2-536.a and b/tools/sdk/lib/liblwip2-536.a differ diff --git a/tools/sdk/lib/liblwip6-1460-feat.a b/tools/sdk/lib/liblwip6-1460-feat.a index e4dd8b8fc..51db390d0 100644 Binary files a/tools/sdk/lib/liblwip6-1460-feat.a and b/tools/sdk/lib/liblwip6-1460-feat.a differ diff --git a/tools/sdk/lib/liblwip6-536-feat.a b/tools/sdk/lib/liblwip6-536-feat.a index 5cb1db04e..d16ec2be8 100644 Binary files a/tools/sdk/lib/liblwip6-536-feat.a and b/tools/sdk/lib/liblwip6-536-feat.a differ diff --git a/tools/sdk/lib/liblwip_gcc.a b/tools/sdk/lib/liblwip_gcc.a index c01b09de5..9ec42e0b7 100644 Binary files a/tools/sdk/lib/liblwip_gcc.a and b/tools/sdk/lib/liblwip_gcc.a differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h index 159b2d802..e19c3d843 100644 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h +++ b/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h @@ -25,6 +25,7 @@ extern "C" { int _EXFUN(memcmp_P,(const _PTR, const _PTR, size_t)); _PTR _EXFUN(memmem_P, (const _PTR, size_t, const _PTR, size_t)); _PTR _EXFUN(memcpy_P,(_PTR __restrict, const _PTR __restrict, size_t)); +_PTR _EXFUN(memmove_P,(_PTR __restrict, const _PTR __restrict, size_t)); _PTR _EXFUN(memccpy_P,(_PTR __restrict, const _PTR __restrict, int, size_t)); _PTR _EXFUN(memchr_P,(const _PTR, int, size_t)); diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a index 2a1a82d90..9c879cdeb 100644 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a and b/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a differ diff --git a/tools/sdk/lwip/include/arch/cc.h b/tools/sdk/lwip/include/arch/cc.h index 773abd55f..9aa10d45c 100644 --- a/tools/sdk/lwip/include/arch/cc.h +++ b/tools/sdk/lwip/include/arch/cc.h @@ -40,6 +40,7 @@ #include "osapi.h" #define EFAULT 14 #include +#include <../../../cores/esp8266/core_esp8266_features.h> //#define LWIP_PROVIDE_ERRNO @@ -84,9 +85,10 @@ typedef unsigned long mem_ptr_t; #define LWIP_PLATFORM_ASSERT(x) #endif -#define SYS_ARCH_DECL_PROTECT(x) -#define SYS_ARCH_PROTECT(x) -#define SYS_ARCH_UNPROTECT(x) +typedef uint32_t sys_prot_t; +#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev +#define SYS_ARCH_PROTECT(lev) lev = xt_rsil(15) +#define SYS_ARCH_UNPROTECT(lev) xt_wsr_ps(lev) #define LWIP_PLATFORM_BYTESWAP 1 #define LWIP_PLATFORM_HTONS(_n) ((u16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff))) diff --git a/tools/sdk/lwip2/builder b/tools/sdk/lwip2/builder index 2314329c8..ffa962483 160000 --- a/tools/sdk/lwip2/builder +++ b/tools/sdk/lwip2/builder @@ -1 +1 @@ -Subproject commit 2314329c86cb7eb9670e3adf7632bd52001f45cd +Subproject commit ffa962483cc1c5d874b11bec13080359619c4cb2 diff --git a/tools/sdk/lwip2/include/arch/cc.h b/tools/sdk/lwip2/include/arch/cc.h index 2ec8fe5a5..961c51aa3 100644 --- a/tools/sdk/lwip2/include/arch/cc.h +++ b/tools/sdk/lwip2/include/arch/cc.h @@ -58,10 +58,12 @@ void sntp_set_system_time (uint32_t t); #include "mem.h" // useful for os_malloc used in esp-arduino's mDNS -typedef uint32_t sys_prot_t; // not really used -#define SYS_ARCH_DECL_PROTECT(lev) -#define SYS_ARCH_PROTECT(lev) os_intr_lock() -#define SYS_ARCH_UNPROTECT(lev) os_intr_unlock() +#include "glue.h" // include assembly locking macro used below +typedef uint32_t sys_prot_t; +#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev +#define SYS_ARCH_PROTECT(lev) lev = lwip_xt_rsil(15) +#define SYS_ARCH_UNPROTECT(lev) lwip_xt_wsr_ps(lev) + #define LWIP_NO_CTYPE_H 1 /////////////////////////////// diff --git a/tools/sdk/lwip2/include/dhcpserver.h b/tools/sdk/lwip2/include/dhcpserver.h new file mode 100644 index 000000000..0f8f9c1e6 --- /dev/null +++ b/tools/sdk/lwip2/include/dhcpserver.h @@ -0,0 +1,130 @@ + +// adapted from dhcpserver.c distributed in esp8266 sdk 2.0.0 +// same license may apply + +#ifndef __DHCPS_H__ +#define __DHCPS_H__ + +#include "glue.h" // for UDEBUG + +#define USE_DNS + +typedef struct dhcps_state{ + sint16_t state; +} dhcps_state; + +typedef struct dhcps_msg { + uint8_t op, htype, hlen, hops; + uint8_t xid[4]; + uint16_t secs, flags; + uint8_t ciaddr[4]; + uint8_t yiaddr[4]; + uint8_t siaddr[4]; + uint8_t giaddr[4]; + uint8_t chaddr[16]; + uint8_t sname[64]; + uint8_t file[128]; + uint8_t options[312]; +}dhcps_msg; + +#ifndef LWIP_OPEN_SRC +struct dhcps_lease { + bool enable; + struct ipv4_addr start_ip; + struct ipv4_addr end_ip; +}; + +enum dhcps_offer_option{ + OFFER_START = 0x00, + OFFER_ROUTER = 0x01, + OFFER_END +}; +#endif + +typedef enum { + DHCPS_TYPE_DYNAMIC, + DHCPS_TYPE_STATIC +} dhcps_type_t; + +typedef enum { + DHCPS_STATE_ONLINE, + DHCPS_STATE_OFFLINE +} dhcps_state_t; + +struct dhcps_pool{ + struct ipv4_addr ip; + uint8 mac[6]; + uint32 lease_timer; + dhcps_type_t type; + dhcps_state_t state; + +}; + +typedef struct _list_node{ + void *pnode; + struct _list_node *pnext; +}list_node; + +extern uint32 dhcps_lease_time; +#define DHCPS_LEASE_TIMER dhcps_lease_time //0x05A0 +#define DHCPS_MAX_LEASE 0x64 +#define BOOTP_BROADCAST 0x8000 + +#define DHCP_REQUEST 1 +#define DHCP_REPLY 2 +#define DHCP_HTYPE_ETHERNET 1 +#define DHCP_HLEN_ETHERNET 6 +#define DHCP_MSG_LEN 236 + +#define DHCPS_SERVER_PORT 67 +#define DHCPS_CLIENT_PORT 68 + +#define DHCPDISCOVER 1 +#define DHCPOFFER 2 +#define DHCPREQUEST 3 +#define DHCPDECLINE 4 +#define DHCPACK 5 +#define DHCPNAK 6 +#define DHCPRELEASE 7 + +#define DHCP_OPTION_SUBNET_MASK 1 +#define DHCP_OPTION_ROUTER 3 +#define DHCP_OPTION_DNS_SERVER 6 +#define DHCP_OPTION_REQ_IPADDR 50 +#define DHCP_OPTION_LEASE_TIME 51 +#define DHCP_OPTION_MSG_TYPE 53 +#define DHCP_OPTION_SERVER_ID 54 +#define DHCP_OPTION_INTERFACE_MTU 26 +#define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31 +#define DHCP_OPTION_BROADCAST_ADDRESS 28 +#define DHCP_OPTION_REQ_LIST 55 +#define DHCP_OPTION_END 255 + +//#define USE_CLASS_B_NET 1 +#define DHCPS_DEBUG UDEBUG +#define MAX_STATION_NUM 8 + +#define DHCPS_STATE_OFFER 1 +#define DHCPS_STATE_DECLINE 2 +#define DHCPS_STATE_ACK 3 +#define DHCPS_STATE_NAK 4 +#define DHCPS_STATE_IDLE 5 +#define DHCPS_STATE_RELEASE 6 + +#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0) + +#ifdef __cplusplus +extern "C" +{ +#endif + +void dhcps_set_dns (int num, const ipv4_addr_t* dns); + +void dhcps_start(struct ip_info *info); +void dhcps_stop(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tools/sdk/lwip2/include/glue.h b/tools/sdk/lwip2/include/glue.h new file mode 100644 index 000000000..06ef36bdf --- /dev/null +++ b/tools/sdk/lwip2/include/glue.h @@ -0,0 +1,113 @@ + +/* + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. + +author: d. gauchard + +*/ + +#ifndef GLUE_H +#define GLUE_H + +#ifndef ARDUINO +#define ARDUINO 0 +#endif + +#ifndef OPENSDK +#define OPENSDK 0 +#endif + +#if !ARDUINO && !OPENSDK +#error Must defined ARDUINO or OPENSDK +#endif + +#include "gluedebug.h" + +#ifdef __cplusplus +extern "C" +{ +#endif +#include "ets_sys.h" +#include "osapi.h" +#include "user_interface.h" +#ifdef __cplusplus +} +#endif + +typedef enum +{ + GLUE_ERR_OK = 0, + GLUE_ERR_MEM = -1, + GLUE_ERR_BUF = -2, + GLUE_ERR_TIMEOUT = -3, + GLUE_ERR_RTE = -4, + GLUE_ERR_INPROGRESS = -5, + GLUE_ERR_VAL = -6, + GLUE_ERR_WOULDBLOCK = -7, + GLUE_ERR_USE = -8, + GLUE_ERR_ALREADY = -9, + GLUE_ERR_ISCONN = -10, + GLUE_ERR_CONN = -11, + GLUE_ERR_IF = -12, + GLUE_ERR_ABRT = -13, + GLUE_ERR_RST = -14, + GLUE_ERR_CLSD = -15, + GLUE_ERR_ARG = -16 +} err_glue_t; + +typedef enum +{ + GLUE_NETIF_FLAG_BROADCAST = 1, + GLUE_NETIF_FLAG_UP = 2, + GLUE_NETIF_FLAG_ETHARP = 4, + GLUE_NETIF_FLAG_IGMP = 8, + GLUE_NETIF_FLAG_LINK_UP = 16, +} glue_netif_flags_t; + +void esp2glue_lwip_init (void); +void esp2glue_espconn_init (void); +void esp2glue_dhcps_start (struct ip_info* info); +err_glue_t esp2glue_dhcp_start (int netif_idx); +void esp2glue_dhcp_stop (int netif_idx); +void esp2glue_netif_updated (int netif_idx, uint32_t ip, uint32_t mask, uint32_t gw, glue_netif_flags_t flags, size_t hwlen, const uint8_t* hw /*, void* state*/); +err_glue_t esp2glue_ethernet_input (int netif_idx, void* glue_pbuf); +void esp2glue_alloc_for_recv (size_t len, void** glue_pbuf, void** glue_data); +void esp2glue_pbuf_freed (void* ref_saved); +void esp2glue_netif_set_default (int netif_idx); +void esp2glue_netif_update (int netif_idx, uint32_t ip, uint32_t mask, uint32_t gw, size_t hwlen, const uint8_t* hwaddr, uint16_t mtu); +void esp2glue_netif_set_up1down0 (int netif_idx, int up1_or_down0); + +void glue2esp_ifupdown (int netif_idx, uint32_t ip, uint32_t mask, uint32_t gw); +err_glue_t glue2esp_linkoutput (int netif_idx, void* ref2save, void* data, size_t size); + +// fixed definitions from esp8266/arduino +// renamed with lwip_ to avoid name collision +// reference and credits: https://github.com/esp8266/Arduino/pull/6301 +#ifndef __STRINGIFY +#define __STRINGIFY(a) #a +#endif +#define lwip_xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;})) +#define lwip_xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory") + +#endif // GLUE_H diff --git a/tools/sdk/lwip2/include/lwip-git-hash.h b/tools/sdk/lwip2/include/lwip-git-hash.h index bf1fbda76..ffcef8ec4 100644 --- a/tools/sdk/lwip2/include/lwip-git-hash.h +++ b/tools/sdk/lwip2/include/lwip-git-hash.h @@ -1,5 +1,5 @@ // generated by makefiles/make-lwip2-hash #ifndef LWIP_HASH_H #define LWIP_HASH_H -#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-8-g2314329" +#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.2-8-g7958710" #endif // LWIP_HASH_H diff --git a/tools/sdk/lwip2/include/lwip/ip.h b/tools/sdk/lwip2/include/lwip/ip.h index 653c3b2f4..230bfdcf9 100644 --- a/tools/sdk/lwip2/include/lwip/ip.h +++ b/tools/sdk/lwip2/include/lwip/ip.h @@ -189,6 +189,12 @@ extern struct ip_globals ip_data; /** Destination IP4 address of current_header */ #define ip4_current_dest_addr() (&ip_data.current_iphdr_dest) +#if NAPT_DEBUG +void napt_debug_print()ICACHE_FLASH_ATTR; +#else +#define napt_debug_print(p) +#endif /* NAPT_DEBUG */ + #elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */ /** Get the IPv6 header of the current packet. diff --git a/tools/sdk/lwip2/include/lwip/napt.h b/tools/sdk/lwip2/include/lwip/napt.h new file mode 100644 index 000000000..b25e03941 --- /dev/null +++ b/tools/sdk/lwip2/include/lwip/napt.h @@ -0,0 +1,116 @@ +#ifndef __LWIP_NAPT_H__ +#define __LWIP_NAPT_H__ + +#include "lwip/opt.h" +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if IP_FORWARD +#if IP_NAPT + +/* Default size of the tables used for NAPT */ +#define IP_NAPT_MAX 512 +#define IP_PORTMAP_MAX 32 + +/* Timeouts in sec for the various protocol types */ +#define IP_NAPT_TIMEOUT_MS_TCP (30*60*1000) +#define IP_NAPT_TIMEOUT_MS_TCP_DISCON (20*1000) +#define IP_NAPT_TIMEOUT_MS_UDP (2*1000) +#define IP_NAPT_TIMEOUT_MS_ICMP (2*1000) + +#define IP_NAPT_PORT_RANGE_START 49152 +#define IP_NAPT_PORT_RANGE_END 61439 + +struct napt_table { + u32_t last; + u32_t src; + u32_t dest; + u16_t sport; + u16_t dport; + u16_t mport; + u8_t proto; + u8_t fin1 : 1; + u8_t fin2 : 1; + u8_t finack1 : 1; + u8_t finack2 : 1; + u8_t synack : 1; + u8_t rst : 1; + u16_t next, prev; +}; + +struct portmap_table { + u32_t maddr; + u32_t daddr; + u16_t mport; + u16_t dport; + u8_t proto; + u8_t valid; +}; + +extern struct portmap_table *ip_portmap_table; + +/** + * Allocates and initializes the NAPT tables. + * + * @param max_nat max number of enties in the NAPT table (use IP_NAPT_MAX if in doubt) + * @param max_portmap max number of enties in the NAPT table (use IP_PORTMAP_MAX if in doubt) + */ +err_t +ip_napt_init(u16_t max_nat, u8_t max_portmap); + + +/** + * Enable/Disable NAPT for a specified interface. + * + * @param addr ip address of the interface + * @param enable non-zero to enable NAPT, or 0 to disable. + */ +err_t +ip_napt_enable(u32_t addr, int enable); + + +/** + * Enable/Disable NAPT for a specified interface. + * + * @param netif number of the interface + * @param enable non-zero to enable NAPT, or 0 to disable. + */ +err_t +ip_napt_enable_no(u8_t number, int enable); + + +/** + * Register port mapping on the external interface to internal interface. + * When the same port mapping is registered again, the old mapping is overwritten. + * In this implementation, only 1 unique port mapping can be defined for each target address/port. + * + * @param proto target protocol + * @param maddr ip address of the external interface + * @param mport mapped port on the external interface, in host byte order. + * @param daddr destination ip address + * @param dport destination port, in host byte order. + */ +u8_t +ip_portmap_add(u8_t proto, u32_t maddr, u16_t mport, u32_t daddr, u16_t dport); + + +/** + * Unregister port mapping on the external interface to internal interface. + * + * @param proto target protocol + * @param maddr ip address of the external interface + */ +u8_t +ip_portmap_remove(u8_t proto, u16_t mport); + +#endif /* IP_NAPT */ +#endif /* IP_FORWARD */ + +#ifdef __cplusplus +} +#endif + +#endif /* __LWIP_NAPT_H__ */ diff --git a/tools/sdk/lwip2/include/lwip/netif.h b/tools/sdk/lwip2/include/lwip/netif.h index 911196ab3..c29a98761 100644 --- a/tools/sdk/lwip2/include/lwip/netif.h +++ b/tools/sdk/lwip2/include/lwip/netif.h @@ -387,6 +387,9 @@ struct netif { u16_t loop_cnt_current; #endif /* LWIP_LOOPBACK_MAX_PBUFS */ #endif /* ENABLE_LOOPBACK */ +#if LWIP_IPV4 && IP_NAPT + u8_t napt; +#endif }; #if LWIP_CHECKSUM_CTRL_PER_NETIF diff --git a/tools/sdk/lwip2/include/lwip/opt.h b/tools/sdk/lwip2/include/lwip/opt.h index 82c420c16..371286b6a 100644 --- a/tools/sdk/lwip2/include/lwip/opt.h +++ b/tools/sdk/lwip2/include/lwip/opt.h @@ -764,6 +764,10 @@ #define IP_FRAG 0 #endif /* !LWIP_IPV4 */ +#ifndef IP_NAPT +#define IP_NAPT 0 +#endif + /** * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. @@ -3484,6 +3488,14 @@ #if !defined DHCP6_DEBUG || defined __DOXYGEN__ #define DHCP6_DEBUG LWIP_DBG_OFF #endif + +/** + * NAPT_DEBUG: Enable debugging for NAPT. + */ +#ifndef NAPT_DEBUG +#define NAPT_DEBUG LWIP_DBG_OFF +#endif + /** * @} */ diff --git a/tools/sdk/lwip2/include/lwipopts.h b/tools/sdk/lwip2/include/lwipopts.h index f54208806..f5197795e 100644 --- a/tools/sdk/lwip2/include/lwipopts.h +++ b/tools/sdk/lwip2/include/lwipopts.h @@ -741,7 +741,7 @@ * interface, define this to 0. */ #if !defined IP_FORWARD || defined __DOXYGEN__ -#define IP_FORWARD 0 +#define IP_FORWARD LWIP_FEATURES #endif /** @@ -772,6 +772,10 @@ #define IP_FRAG 0 #endif /* !LWIP_IPV4 */ +#ifndef IP_NAPT +#define IP_NAPT (LWIP_FEATURES && !LWIP_IPV6) +#endif + /** * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. @@ -3496,6 +3500,13 @@ * @} */ +/** + * NAPT_DEBUG: Enable debugging for NAPT. + */ +#ifndef NAPT_DEBUG +#define NAPT_DEBUG LWIP_DBG_OFF +#endif + /** * LWIP_TESTMODE: Changes to make unit test possible */ diff --git a/tools/signing.py b/tools/signing.py index d3dcc7cc1..8c58d8bbb 100755 --- a/tools/signing.py +++ b/tools/signing.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # import argparse diff --git a/tools/sizes.py b/tools/sizes.py new file mode 100755 index 000000000..669712c1d --- /dev/null +++ b/tools/sizes.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 + +# Display the segment sizes used by an ELF +# +# Copyright (C) 2019 - Earle F. Philhower, III +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from __future__ import print_function +import argparse +import os +import subprocess +import sys + +def get_segment_sizes(elf, path): + sizes = {} + sizes['IROM'] = 0 + sizes['IRAM'] = 0 + sizes['DATA'] = 0 + sizes['RODATA'] = 0 + sizes['BSS'] = 0 + p = subprocess.Popen([path + "/xtensa-lx106-elf-size", '-A', elf], stdout=subprocess.PIPE, universal_newlines=True ) + lines = p.stdout.readlines() + for line in lines: + words = line.split() + if line.startswith('.irom0.text'): + sizes['IROM'] = sizes['IROM'] + int(words[1]) + elif line.startswith('.text'): # Gets .text and .text1 + sizes['IRAM'] = sizes['IRAM'] + int(words[1]) + elif line.startswith('.data'): # Gets .text and .text1 + sizes['DATA'] = sizes['DATA'] + int(words[1]) + elif line.startswith('.rodata'): # Gets .text and .text1 + sizes['RODATA'] = sizes['RODATA'] + int(words[1]) + elif line.startswith('.bss'): # Gets .text and .text1 + sizes['BSS'] = sizes['BSS'] + int(words[1]) + return sizes + +def main(): + parser = argparse.ArgumentParser(description='Report the different segment sizes of a compiled ELF file') + parser.add_argument('-e', '--elf', action='store', required=True, help='Path to the Arduino sketch ELF') + parser.add_argument('-p', '--path', action='store', required=True, help='Path to Xtensa toolchain binaries') + + args = parser.parse_args() + sizes = get_segment_sizes(args.elf, args.path) + + sys.stderr.write("Executable segment sizes:" + os.linesep) + for k in sizes.keys(): + sys.stderr.write("%-7s: %d%s" % (k, sizes[k], os.linesep)) + + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/upload.py b/tools/upload.py index e6725fdf7..1cc911a70 100755 --- a/tools/upload.py +++ b/tools/upload.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Wrapper for Arduino core / others that can call esptool.py possibly multiple times # Adds pyserial to sys.path automatically based on the path of the current file