From 91c2841ef506520c22d015dbc789759097f60698 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 22 Apr 2018 22:18:13 +0200 Subject: [PATCH] initial --- .cproject | 83 ++++ .gitignore | 1 + .gitmodules | 3 + .project | 66 +++ .pydevproject | 5 + .settings/language.settings.xml | 14 + .settings/org.eclipse.cdt.core.prefs | 528 +++++++++++++++++++++ ConfigGenerator/configGen.py | 40 ++ ConfigGenerator/configuration_c.tmpl | 153 ++++++ ConfigGenerator/configuration_h.tmpl | 17 + RainSensor.cpp | 70 +++ RainSensor.h | 22 + configuration.cpp | 388 ++++++++++++++++ configuration.h | 24 + configurationMode.cpp | 56 +++ configurationMode.h | 18 + defines.h | 18 + productionMode.cpp | 145 ++++++ productionMode.h | 19 + pubsubclient/PubSubClient.cpp | 670 +++++++++++++++++++++++++++ pubsubclient/PubSubClient.h | 160 +++++++ 21 files changed, 2500 insertions(+) create mode 100644 .cproject create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .project create mode 100644 .pydevproject create mode 100644 .settings/language.settings.xml create mode 100644 .settings/org.eclipse.cdt.core.prefs create mode 100644 ConfigGenerator/configGen.py create mode 100644 ConfigGenerator/configuration_c.tmpl create mode 100644 ConfigGenerator/configuration_h.tmpl create mode 100644 RainSensor.cpp create mode 100644 RainSensor.h create mode 100644 configuration.cpp create mode 100644 configuration.h create mode 100644 configurationMode.cpp create mode 100644 configurationMode.h create mode 100644 defines.h create mode 100644 productionMode.cpp create mode 100644 productionMode.h create mode 100644 pubsubclient/PubSubClient.cpp create mode 100644 pubsubclient/PubSubClient.h diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..46590f0 --- /dev/null +++ b/.cproject @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f963cf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/Release/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8eb95f8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hottislib"] + path = hottislib + url = git@gitlab.com:wolutator/hottislib.git diff --git a/.project b/.project new file mode 100644 index 0000000..d6551a6 --- /dev/null +++ b/.project @@ -0,0 +1,66 @@ + + + RainSensor + + + + + + org.python.pydev.PyDevBuilder + + + + + io.sloeber.core.inoToCpp + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + io.sloeber.arduinonature + org.python.pydev.pythonNature + + + + core/core + 2 + ECLIPSE_HOME/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266 + + + core/variant + 2 + ECLIPSE_HOME/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/variants/nodemcu + + + libraries/EEPROM + 2 + ECLIPSE_HOME/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/libraries/EEPROM + + + libraries/ESP8266WebServer + 2 + ECLIPSE_HOME/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WebServer + + + libraries/ESP8266WiFi + 2 + ECLIPSE_HOME/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi + + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..d001f0a --- /dev/null +++ b/.pydevproject @@ -0,0 +1,5 @@ + + +Default +python interpreter + diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml new file mode 100644 index 0000000..a5e2de5 --- /dev/null +++ b/.settings/language.settings.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 0000000..eac3c96 --- /dev/null +++ b/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,528 @@ +eclipse.preferences.version=1 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ALT_SIZE_COMMAND/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ALT_SIZE_COMMAND/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ALT_SIZE_COMMAND/value="${A.COMPILER.PATH}${A.COMPILER.SIZE.CMD}" --format\=avr --mcu\=${A.BUILD.MCU} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ARCHIVE_FILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ARCHIVE_FILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ARCHIVE_FILE/value=arduino.ar +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ARCHIVE_FILE_PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ARCHIVE_FILE_PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ARCHIVE_FILE_PATH/value=${A.BUILD.PATH}/${A.ARCHIVE_FILE} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.ARCH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.ARCH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.ARCH/value=ESP8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.BOARD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.BOARD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.BOARD/value=ESP8266_NODEMCU +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.CORE.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.CORE.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.CORE.PATH/value=${A.RUNTIME.PLATFORM.PATH}/cores/${A.BUILD.CORE} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.CORE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.CORE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.CORE/value=esp8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.DEBUG_LEVEL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.DEBUG_LEVEL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.DEBUG_LEVEL/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.DEBUG_PORT/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.DEBUG_PORT/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.DEBUG_PORT/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.EXTRA_FLAGS/value=-DESP8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_FREQ/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_FREQ/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_FREQ/value=40 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_LD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_LD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_LD/value=eagle.flash.4m1m.ld +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_MODE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_MODE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_MODE/value=dio +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_SIZE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_SIZE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.FLASH_SIZE/value=4M +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.F_CPU/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.F_CPU/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.F_CPU/value=80000000L +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.LWIP_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.LWIP_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.LWIP_FLAGS/value=-DLWIP_OPEN_SRC +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.LWIP_LIB/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.LWIP_LIB/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.LWIP_LIB/value=-llwip_gcc +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.MCU/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.MCU/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.MCU/value=esp8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.PATH/value=${ProjDirPath}/${ConfigName} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.PROJECT_NAME/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.PROJECT_NAME/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.PROJECT_NAME/value=${ProjName} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_BLOCKSIZE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_BLOCKSIZE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_BLOCKSIZE/value=8192 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_END/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_END/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_END/value=0x3FB000 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_PAGESIZE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_PAGESIZE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_PAGESIZE/value=256 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_START/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_START/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SPIFFS_START/value=0x300000 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SYSTEM.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SYSTEM.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.SYSTEM.PATH/value=${A.RUNTIME.PLATFORM.PATH}/system +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.VARIANT.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.VARIANT.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.VARIANT.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/variants/nodemcu +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.VARIANT/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.VARIANT/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.BUILD.VARIANT/value=nodemcu +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.CMD/value=xtensa-lx106-elf-ar +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AR.FLAGS/value=cru +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AS.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AS.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.AS.CMD/value=xtensa-lx106-elf-as +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.CMD/value=xtensa-lx106-elf-gcc +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.CMD/value=xtensa-lx106-elf-gcc +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.FLAGS/value=-g ${A.COMPILER.WARNING_FLAGS} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L${A.COMPILER.SDK.PATH}/lib" "-L${A.COMPILER.SDK.PATH}/ld" "-T${A.BUILD.FLASH_LD}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.LIBS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.LIBS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.ELF.LIBS/value=-lm -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig -lmesh -lwpa2 ${A.BUILD.LWIP_LIB} -lstdc++ +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.C.FLAGS/value=-c ${A.COMPILER.WARNING_FLAGS} -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions\=4 -MMD -std\=gnu99 -ffunction-sections -fdata-sections +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.CMD/value=xtensa-lx106-elf-g++ +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPP.FLAGS/value=-c ${A.COMPILER.WARNING_FLAGS} -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions\=4 -std\=c++11 -MMD -ffunction-sections -fdata-sections +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPREPROCESSOR.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPREPROCESSOR.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.CPREPROCESSOR.FLAGS/value=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I${A.COMPILER.SDK.PATH}/include" "-I${A.COMPILER.SDK.PATH}/lwip/include" "-I${A.BUILD.PATH}/core" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.CMD/value=esptool +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ELF2HEX.FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ESPTOOL.CMD.WINDOWS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ESPTOOL.CMD.WINDOWS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ESPTOOL.CMD.WINDOWS/value=esptool.exe +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ESPTOOL.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ESPTOOL.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.ESPTOOL.CMD/value=esptool +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.OBJCOPY.EEP.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.OBJCOPY.EEP.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.OBJCOPY.EEP.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.PATH/value=${A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC.PATH}/bin/ +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.CMD/value=xtensa-lx106-elf-gcc +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.EXTRA_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.EXTRA_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.EXTRA_FLAGS/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.S.FLAGS/value=-c -g -x assembler-with-cpp -MMD -mlongcalls +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.SDK.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.SDK.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.SDK.PATH/value=${A.RUNTIME.PLATFORM.PATH}/tools/sdk +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.SIZE.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.SIZE.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.SIZE.CMD/value=xtensa-lx106-elf-size +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.ALL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.ALL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.ALL/value=-Wall -Wextra +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.DEFAULT/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.DEFAULT/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.DEFAULT/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.MORE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.MORE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.MORE/value=-Wall +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.NONE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.NONE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS.NONE/value=-w +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.COMPILER.WARNING_FLAGS/value=${A.COMPILER.WARNING_FLAGS.ALL} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ESP8266.NETWORK.UPLOAD.TOOL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ESP8266.NETWORK.UPLOAD.TOOL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.ESP8266.NETWORK.UPLOAD.TOOL/value=esp8266OTA +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.DTS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.DTS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.DTS/value=3600 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/value=1524433102 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/value=1524425902 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/value=3600 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.CORE.REFERENCED.PLATFORM/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.CORE.REFERENCED.PLATFORM/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.CORE.REFERENCED.PLATFORM/value=${JANTJE.SELECTED.PLATFORM} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.USED.BOARDS_FILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.USED.BOARDS_FILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.USED.BOARDS_FILE/value=${JANTJE.BOARDS_FILE} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.VARIANT.REFERENCED.PLATFORM/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.VARIANT.REFERENCED.PLATFORM/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.JANTJE.VARIANT.REFERENCED.PLATFORM/value=${JANTJE.SELECTED.PLATFORM} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.NAME/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.NAME/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.NAME/value=NodeMCU 1.0 (ESP-12E Module) +environment/project/io.sloeber.core.toolChain.release.1856809793/A.PACKAGES/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.PACKAGES/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.PACKAGES/value=${eclipse_home}/arduinoPlugin/packages +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-ar" cru "/home/wn/workspace-sloeber/RainSensor/Release/arduino.ar" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN.2/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN.2/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN.2/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.AR.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.AR.CMD}" ${A.COMPILER.AR.FLAGS} ${A.COMPILER.AR.EXTRA_FLAGS} "${A.BUILD.PATH}/arduino.ar" "${A.OBJECT_FILE}" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -g -Wall -Wextra -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/lib" "-L/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/ld" "-Teagle.flash.4m1m.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -o "/home/wn/workspace-sloeber/RainSensor/Release/RainSensor.elf" -Wl,--start-group +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN.2/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN.2/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN.2/value=\ "/home/wn/workspace-sloeber/RainSensor/Release/arduino.ar" -lm -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig -lmesh -lwpa2 -llwip_gcc -lstdc++ -Wl,--end-group "-L/home/wn/workspace-sloeber/RainSensor/Release" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.COMBINE.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.ELF.CMD}" ${A.COMPILER.C.ELF.FLAGS} ${A.COMPILER.C.ELF.EXTRA_FLAGS} -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" -Wl,--start-group ${A.OBJECT_FILES} "${A.BUILD.PATH}/arduino.ar" ${A.COMPILER.C.ELF.LIBS} -Wl,--end-group "-L${A.BUILD.PATH}" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/include" "-I/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/lwip/include" "-I/home/wn/workspace-sloeber/RainSensor/Release/core" -c -Wall -Wextra -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions\=4 -std\=gnu99 -ffunction-sections -fdata-sections -DF_CPU\=80000000L -DLWIP_OPEN_SRC -DARDUINO\=10802 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 '-DARDUINO_BOARD\="ESP8266_NODEMCU"' -DESP8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.2/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.2/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.2/value=\ -o +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.3/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.3/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN.3/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.C.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.CMD}" ${A.COMPILER.CPREPROCESSOR.FLAGS} ${A.COMPILER.C.FLAGS} -DF_CPU\=${A.BUILD.F_CPU} ${A.BUILD.LWIP_FLAGS} ${A.BUILD.DEBUG_PORT} ${A.BUILD.DEBUG_LEVEL} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} '-DARDUINO_BOARD\="${A.BUILD.BOARD}"' ${A.COMPILER.C.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/include" "-I/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/lwip/include" "-I/home/wn/workspace-sloeber/RainSensor/Release/core" -c -Wall -Wextra -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions\=4 -std\=c++11 -ffunction-sections -fdata-sections -DF_CPU\=80000000L -DLWIP_OPEN_SRC -DARDUINO\=10802 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 '-DARDUINO_BOARD\="ESP8266_NODEMCU"' -DESP8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.2/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.2/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.2/value=\ -o +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.3/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.3/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN.3/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.CPP.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.CPP.CMD}" ${A.COMPILER.CPREPROCESSOR.FLAGS} ${A.COMPILER.CPP.FLAGS} -DF_CPU\=${A.BUILD.F_CPU} ${A.BUILD.LWIP_FLAGS} ${A.BUILD.DEBUG_PORT} ${A.BUILD.DEBUG_LEVEL} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} '-DARDUINO_BOARD\="${A.BUILD.BOARD}"' ${A.COMPILER.CPP.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.EEP.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.EEP.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.EEP.PATTERN.1/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.EEP.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.EEP.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.EEP.PATTERN/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.HEX.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.HEX.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.HEX.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/esptool/0.4.9/esptool" -eo "/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/bootloaders/eboot/eboot.elf" -bo "/home/wn/workspace-sloeber/RainSensor/Release/RainSensor.bin" -bm dio -bf 40 -bz 4M -bs .text -bp 4096 -ec -eo "/home/wn/workspace-sloeber/RainSensor/Release/RainSensor.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.HEX.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.HEX.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OBJCOPY.HEX.PATTERN/value="${A.RUNTIME.TOOLS.ESPTOOL.PATH}/${A.COMPILER.ESPTOOL.CMD}" -eo "${A.RUNTIME.PLATFORM.PATH}/bootloaders/eboot/eboot.elf" -bo "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin" -bm ${A.BUILD.FLASH_MODE} -bf ${A.BUILD.FLASH_FREQ} -bz ${A.BUILD.FLASH_SIZE} -bs .text -bp 4096 -ec -eo "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OUTPUT.SAVE_FILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OUTPUT.SAVE_FILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OUTPUT.SAVE_FILE/value=${A.BUILD.PROJECT_NAME}.${A.BUILD.VARIANT}.bin +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OUTPUT.TMP_FILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OUTPUT.TMP_FILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.OUTPUT.TMP_FILE/value=${A.BUILD.PROJECT_NAME}.bin +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/include" "-I/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/lwip/include" "-I/home/wn/workspace-sloeber/RainSensor/Release/core" -c -g -x assembler-with-cpp -mlongcalls -DF_CPU\=80000000L -DLWIP_OPEN_SRC -DARDUINO\=10802 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 '-DARDUINO_BOARD\="ESP8266_NODEMCU"' -DESP8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.2/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.2/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.2/value=\ -o +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.3/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.3/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN.3/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.S.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.CMD}" ${A.COMPILER.CPREPROCESSOR.FLAGS} ${A.COMPILER.S.FLAGS} -DF_CPU\=${A.BUILD.F_CPU} ${A.BUILD.LWIP_FLAGS} ${A.BUILD.DEBUG_PORT} ${A.BUILD.DEBUG_LEVEL} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} '-DARDUINO_BOARD\="${A.BUILD.BOARD}"' ${A.COMPILER.C.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.PATTERN.1/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.PATTERN.1/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.PATTERN.1/value="/opt/eclipse/sloeber//arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-size" -A "/home/wn/workspace-sloeber/RainSensor/Release/RainSensor.elf" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.SIZE.CMD}" -A "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.REGEX.DATA/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.REGEX.DATA/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.REGEX.DATA/value=^(?\:\\.data|\\.rodata|\\.bss)\\s+([0-9]+).* +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.REGEX/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.REGEX/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RECIPE.SIZE.REGEX/value=^(?\:\\.irom0\\.text|\\.text|\\.data|\\.rodata|)\\s+([0-9]+).* +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.HARDWARE.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.HARDWARE.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.HARDWARE.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/hardware/esp8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.IDE.VERSION/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.IDE.VERSION/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.IDE.VERSION/value=10802 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.PLATFORM.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.PLATFORM.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.PLATFORM.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.REFERENCED.PLATFORM.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.REFERENCED.PLATFORM.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.REFERENCED.PLATFORM.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA-1.1.1.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA-1.1.1.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA-1.1.1.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/arduinoOTA/1.1.1 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/arduinoOTA/1.1.1 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA1.1.1.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA1.1.1.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ARDUINOOTA1.1.1.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/arduinoOTA/1.1.1 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC-4.9.2-ATMEL3.5.4-ARDUINO2.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC-4.9.2-ATMEL3.5.4-ARDUINO2.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC-4.9.2-ATMEL3.5.4-ARDUINO2.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC4.9.2-ATMEL3.5.4-ARDUINO2.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC4.9.2-ATMEL3.5.4-ARDUINO2.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVR-GCC4.9.2-ATMEL3.5.4-ARDUINO2.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE-6.3.0-ARDUINO9.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE-6.3.0-ARDUINO9.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE-6.3.0-ARDUINO9.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/avrdude/6.3.0-arduino9 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/avrdude/6.3.0-arduino9 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE6.3.0-ARDUINO9.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE6.3.0-ARDUINO9.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.AVRDUDE6.3.0-ARDUINO9.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/avrdude/6.3.0-arduino9 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL-0.4.9.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL-0.4.9.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL-0.4.9.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/esptool/0.4.9 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/esptool/0.4.9 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL0.4.9.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL0.4.9.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.ESPTOOL0.4.9.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/esptool/0.4.9 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS-0.1.2.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS-0.1.2.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS-0.1.2.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/mkspiffs/0.1.2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/mkspiffs/0.1.2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS0.1.2.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS0.1.2.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.MKSPIFFS0.1.2.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/mkspiffs/0.1.2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC-1.20.0-26-GB404FB9-2.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC-1.20.0-26-GB404FB9-2.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC-1.20.0-26-GB404FB9-2.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC1.20.0-26-GB404FB9-2.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC1.20.0-26-GB404FB9-2.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.RUNTIME.TOOLS.XTENSA-LX106-ELF-GCC1.20.0-26-GB404FB9-2.PATH/value=${eclipse_home}/arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.DISABLEDTR/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.DISABLEDTR/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.DISABLEDTR/value=true +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.DISABLERTS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.DISABLERTS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.DISABLERTS/value=true +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.PORT.FILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.PORT.FILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.PORT.FILE/value=${A.SERIAL.PORT} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.PORT/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.PORT/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SERIAL.PORT/value=${JANTJE.COM_PORT} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SOFTWARE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SOFTWARE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.SOFTWARE/value=ARDUINO +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.AVRDUDE_REMOTE.UPLOAD.VERBOSE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.AVRDUDE_REMOTE.UPLOAD.VERBOSE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.AVRDUDE_REMOTE.UPLOAD.VERBOSE/value=-v +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESP8266OTA.UPLOAD.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESP8266OTA.UPLOAD.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESP8266OTA.UPLOAD.PATTERN/value=${A.TOOLS.ESPTOOL.UPLOAD.NETWORK_PATTERN} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESP8266OTA/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESP8266OTA/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESP8266OTA/value=${A.TOOLS.ESPTOOL.NETWORK_CMD} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.CMD.WINDOWS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.CMD.WINDOWS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.CMD.WINDOWS/value=esptool.exe +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.CMD/value=esptool +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK.PASSWORD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK.PASSWORD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK.PASSWORD/value=${A.TOOLS.ESPTOOL.NETWORK.AUTH} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK_CMD.WINDOWS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK_CMD.WINDOWS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK_CMD.WINDOWS/value=python.exe +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK_CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK_CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.NETWORK_CMD/value=python +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.PATH/value=${A.RUNTIME.TOOLS.ESPTOOL.PATH} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.NETWORK_PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.NETWORK_PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.NETWORK_PATTERN/value="${A.TOOLS.ESPTOOL.NETWORK_CMD}" "${A.RUNTIME.PLATFORM.PATH}/tools/espota.py" -i "${A.SERIAL.PORT}" -p "${A.TOOLS.ESPTOOL.NETWORK.PORT}" "--auth\=${A.TOOLS.ESPTOOL.NETWORK.PASSWORD}" -f "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PARAMS.QUIET/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PARAMS.QUIET/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PARAMS.QUIET/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PARAMS.VERBOSE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PARAMS.VERBOSE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PARAMS.VERBOSE/value=-vv +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PATTERN/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PATTERN/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PATTERN/value="${A.TOOLS.ESPTOOL.PATH}/${A.TOOLS.ESPTOOL.CMD}" ${A.TOOLS.ESPTOOL.UPLOAD.VERBOSE} -cd ${A.UPLOAD.RESETMETHOD} -cb ${A.UPLOAD.SPEED} -cp "${A.SERIAL.PORT}" -ca 0x00000 -cf "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin" +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PROTOCOL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PROTOCOL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.ESPTOOL.UPLOAD.PROTOCOL/value=esp +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.CMD.WINDOWS/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.CMD.WINDOWS/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.CMD.WINDOWS/value=mkspiffs.exe +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.CMD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.CMD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.CMD/value=mkspiffs +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.TOOLS.MKSPIFFS.PATH/value=${A.RUNTIME.TOOLS.MKSPIFFS.PATH} +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.ALTID/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.ALTID/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.ALTID/value=no_altID +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.MAXIMUM_DATA_SIZE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.MAXIMUM_DATA_SIZE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.MAXIMUM_DATA_SIZE/value=81920 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.MAXIMUM_SIZE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.MAXIMUM_SIZE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.MAXIMUM_SIZE/value=1044464 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.PROTOCOL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.PROTOCOL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.PROTOCOL/value=stk500v1 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.RESETMETHOD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.RESETMETHOD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.RESETMETHOD/value=nodemcu +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.SPEED/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.SPEED/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.SPEED/value=115200 +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.TOOL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.TOOL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.TOOL/value=esptool +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.USBID/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.USBID/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.USBID/value=no_altID +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/value=true +environment/project/io.sloeber.core.toolChain.release.1856809793/A.VERSION/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/A.VERSION/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/A.VERSION/value=2.2.0 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ARCHITECTURE_ID/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ARCHITECTURE_ID/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ARCHITECTURE_ID/value=esp8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARDS_FILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARDS_FILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARDS_FILE/value=${eclipse_home}/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0/boards.txt +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_ID/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_ID/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_ID/value=nodemcuv2 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_NAME/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_NAME/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_NAME/value=NodeMCU 1.0 (ESP-12E Module) +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/value=/dev/ttyUSB5 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/value=${eclipse_home}///////////////// +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ARCHIVE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ARCHIVE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ARCHIVE/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ASSEMBLY/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ASSEMBLY/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ASSEMBLY/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.C.COMPILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.C.COMPILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.C.COMPILE/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.COMPILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.COMPILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.COMPILE/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.CPP.COMPILE/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.CPP.COMPILE/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.CPP.COMPILE/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.LINK/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.LINK/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.LINK/value= +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.MENU/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.MENU/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.MENU/value=CpuFrequency\=80\nFlashSize\=4M1M\nUploadSpeed\=115200 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.OBJCOPY/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.OBJCOPY/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.OBJCOPY/value=${A.RECIPE.OBJCOPY.HEX.PATTERN} +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.OS_NAME/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.OS_NAME/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.OS_NAME/value=linux +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.PACKAGE_ID/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.PACKAGE_ID/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.PACKAGE_ID/value=esp8266 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.PROJECT_NAME/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.PROJECT_NAME/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.PROJECT_NAME/value=RainSensor +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.SELECTED.PLATFORM/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.SELECTED.PLATFORM/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.SELECTED.PLATFORM/value=${eclipse_home}/arduinoPlugin/packages/esp8266/hardware/esp8266/2.3.0 +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.SIZE.SWITCH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.SIZE.SWITCH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.SIZE.SWITCH/value=${A.RECIPE.SIZE.PATTERN} +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.UPLOAD/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.UPLOAD/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.UPLOAD/value=Default +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.WARNING_LEVEL/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.WARNING_LEVEL/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.WARNING_LEVEL/value=true +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.WORKSPACE_LOCATION/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.WORKSPACE_LOCATION/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.WORKSPACE_LOCATION/value=/home/wn/workspace-sloeber +environment/project/io.sloeber.core.toolChain.release.1856809793/PATH/delimiter=\: +environment/project/io.sloeber.core.toolChain.release.1856809793/PATH/operation=replace +environment/project/io.sloeber.core.toolChain.release.1856809793/PATH/value=${A.COMPILER.PATH}${PathDelimiter}${A.BUILD.GENERIC.PATH}${PathDelimiter}${PATH} +environment/project/io.sloeber.core.toolChain.release.1856809793/append=true +environment/project/io.sloeber.core.toolChain.release.1856809793/appendContributed=true diff --git a/ConfigGenerator/configGen.py b/ConfigGenerator/configGen.py new file mode 100644 index 0000000..800b51d --- /dev/null +++ b/ConfigGenerator/configGen.py @@ -0,0 +1,40 @@ +#!/usr/bin/python + +from Cheetah.Template import Template + + + + +configItems = [ + {"label":"_", "key":"magic", "type":"I", "default": ""}, + {"label":"Config Username", "key":"confUser", "type":"C", "length":16, "default":"admin"}, + {"label":"Config Password", "key":"confPasswd", "type":"C", "length":16, "default":"geheim123"}, + {"label":"Wifi SSID", "key":"wifiSsid", "type":"C", "length":32, "default":"test"}, + {"label":"Wifi Key", "key":"wifiKey", "type":"C", "length":64, "default":"geheim"}, + {"label":"MQTT Broker", "key":"mqttBroker", "type":"C", "length":32, "default":"broker.hottis.de"}, + {"label":"MQTT Username", "key":"mqttUser", "type":"C", "length":32, "default":"RainSensor1"}, + {"label":"MQTT Password", "key":"mqttPass", "type":"C", "length":32, "default":"geheim123"}, + {"label":"MQTT ClientId", "key":"mqttClientId", "type":"C", "length":32, "default":"RainSensor1"}, + {"label":"MQTT Port", "key":"mqttPort", "type":"I", "default":8883}, + {"label":"MQTT Topic", "key":"mqttTopic", "type":"C", "length":64, "default":"IoT/RainSensor1/Value"}, + {"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RainSensor1/Debug"}, + {"label":"DebugMode", "key":"debugMode", "type":"I", "default":0}, + {"label":"Period", "key":"period", "type":"I", "default":300} +] + + +magic = 0xC0DE0003 +appName = "ESP8266 based RainSensor" +confWifiSsid = "espconfig" + +params = { + "magic":magic, + "appName":appName, + "confWifiSsid":confWifiSsid, + "configItems":configItems +} + +h_file = Template(file="configuration_h.tmpl", searchList=[params]) +open('configuration.h','w').write(str(h_file)) +c_file = Template(file="configuration_c.tmpl", searchList=[params]) +open('configuration.cpp','w').write(str(c_file)) diff --git a/ConfigGenerator/configuration_c.tmpl b/ConfigGenerator/configuration_c.tmpl new file mode 100644 index 0000000..9bf61a9 --- /dev/null +++ b/ConfigGenerator/configuration_c.tmpl @@ -0,0 +1,153 @@ +#raw +#include + +#include +#include +#include + +#include "defines.h" +#include "configuration.h" +#end raw + + +tConfigBlock configBlock; +const uint32_t MAGIC = $magic; +const char* CONFIG_SSID = "$confWifiSsid"; +extern ESP8266WebServer webServer; + +bool configSaved = false; + + +static bool checkAuthentication() { + Serial.print("User: "); Serial.println(configBlock.confUser); + Serial.print("Pass: "); Serial.println(configBlock.confPasswd); + return webServer.authenticate(configBlock.confUser, configBlock.confPasswd); +} + +void configServeIndex() { + bool configValid = (configBlock.magic == MAGIC); + + if (! configValid) { + configBlock.magic = MAGIC; + #for $configItem in $configItems + #if $configItem.label != "_" + #if $configItem.type == "C" + strcpy(configBlock.$configItem.key, "$configItem.default"); + #else if $configItem.type == "I" + configBlock.$configItem.key = $configItem.default; + #end if + #end if + #end for + } + + if (! checkAuthentication()) { + return webServer.requestAuthentication(); + } + + + String buffer = + "" + " " + " $appName" + " " + " " + "

$appName - ESP8266 Configuration Page

"; + + if (configSaved) { + configSaved = false; + buffer += "

Configuration saved

"; + } + + buffer += + "
" + " " + #for $configItem in $configItems + #if $configItem.label != "_" + " " + " " + " " + #end if + #end for + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + "
" + "
" + " " + ""; + + webServer.send(200, "text/html", buffer); + + +#ifdef DEBUG + Serial.println("indexHtml request served"); +#endif +} + +void configServeGetConfiguration() { + if (! checkAuthentication()) { + return webServer.requestAuthentication(); + } + + String arg; + + #for $configItem in $configItems + #if $configItem.label != "_" + arg = webServer.arg("$configItem.key"); + #if $configItem.type == "C" + strcpy(configBlock.$configItem.key, arg.c_str()); + #else if $configItem.type == "I" + configBlock.$configItem.key = atoi(arg.c_str()); + #end if + #end if + #end for + + configBlock.magic = MAGIC; + + showConfiguration(); + + EEPROM.begin(512); + EEPROM.put(EEPROM_ADDR, configBlock); + EEPROM.commit(); + + Serial.println("EEPROM saved"); + + configSaved = true; + webServer.sendHeader("Location", String("/"), true); + webServer.send(302, "text/plain", ""); + //webServer.send(200, "text/html", "configuration saved"); +} + +void showConfiguration() { + Serial.println("Configuration is"); + + #for $configItem in $configItems + Serial.print("$configItem.key = <"); + Serial.print(configBlock.$configItem.key); + Serial.println(">"); + + #end for + + Serial.println("---"); +} \ No newline at end of file diff --git a/ConfigGenerator/configuration_h.tmpl b/ConfigGenerator/configuration_h.tmpl new file mode 100644 index 0000000..e528f14 --- /dev/null +++ b/ConfigGenerator/configuration_h.tmpl @@ -0,0 +1,17 @@ +typedef struct { +#for $configItem in $configItems +#if $configItem.type == 'C' + char ${configItem.key}[$configItem.length]; +#else if $configItem.type == 'I' + uint32_t $configItem.key; +#end if +#end for +} tConfigBlock; + +extern const uint32_t MAGIC; +extern tConfigBlock configBlock; +extern const char* CONFIG_SSID; + +void configServeIndex(); +void configServeGetConfiguration(); +void showConfiguration(); \ No newline at end of file diff --git a/RainSensor.cpp b/RainSensor.cpp new file mode 100644 index 0000000..e5c6e47 --- /dev/null +++ b/RainSensor.cpp @@ -0,0 +1,70 @@ +#include "RainSensor.h" +#include "defines.h" + +// #define ESP8266 + + +#include + +#include "configuration.h" +#include "productionMode.h" +#include "configurationMode.h" + + + + +bool configMode = false; + +uint32_t startTime = 0; + + +void setup() { + startTime = millis(); +#ifdef DEBUG + Serial.begin(115200); + Serial.println("Starting ..."); +#endif + + pinMode(CONFIG_SWITCH, INPUT_PULLUP); + + + EEPROM.begin(512); + EEPROM.get(EEPROM_ADDR, configBlock); + + + Serial.print("Magic: "); + Serial.println(configBlock.magic); + + configMode = ((LOW == digitalRead(CONFIG_SWITCH)) || (configBlock.magic != MAGIC)); + + if (configMode) { +#ifdef DEBUG + Serial.println("Configuration mode"); +#endif + setupConfigurationNetwork(); + setupConfigurationServer(); + } else { +#ifdef DEBUG + Serial.println("Production mode"); + Serial.println(); + Serial.println(); + showConfiguration(); +#endif + + setupProduction(); + setupConfigurationServer(); + } + +#ifdef DEBUG + Serial.println("Started."); +#endif +} + +void loop() { + if (configMode) { + loopConfiguration(); + } else { + loopConfiguration(); + loopProduction(); + } +} diff --git a/RainSensor.h b/RainSensor.h new file mode 100644 index 0000000..0dc37ba --- /dev/null +++ b/RainSensor.h @@ -0,0 +1,22 @@ +// Only modify this file to include +// - function definitions (prototypes) +// - include files +// - extern variable definitions +// In the appropriate section + +#ifndef _RainSensor_H_ +#define _RainSensor_H_ +#include "Arduino.h" +//add your includes for the project RainSensor here + + +//end of add your includes here + + +//add your function definitions for the project RainSensor here + + + + +//Do not add code below this line +#endif /* _RainSensor_H_ */ diff --git a/configuration.cpp b/configuration.cpp new file mode 100644 index 0000000..bb60755 --- /dev/null +++ b/configuration.cpp @@ -0,0 +1,388 @@ +#include + +#include +#include +#include + +#include "defines.h" +#include "configuration.h" + + +tConfigBlock configBlock; +const uint32_t MAGIC = 3235774467; +const char* CONFIG_SSID = "espconfig"; +extern ESP8266WebServer webServer; + +bool configSaved = false; + + +static bool checkAuthentication() { + Serial.print("User: "); Serial.println(configBlock.confUser); + Serial.print("Pass: "); Serial.println(configBlock.confPasswd); + return webServer.authenticate(configBlock.confUser, configBlock.confPasswd); +} + +void configServeIndex() { + bool configValid = (configBlock.magic == MAGIC); + + if (! configValid) { + configBlock.magic = MAGIC; + strcpy(configBlock.confUser, "admin"); + strcpy(configBlock.confPasswd, "geheim123"); + strcpy(configBlock.wifiSsid, "test"); + strcpy(configBlock.wifiKey, "geheim"); + strcpy(configBlock.mqttBroker, "broker.hottis.de"); + strcpy(configBlock.mqttUser, "RainSensor1"); + strcpy(configBlock.mqttPass, "geheim123"); + strcpy(configBlock.mqttClientId, "RainSensor1"); + configBlock.mqttPort = 8883; + strcpy(configBlock.mqttTopic, "IoT/RainSensor1/Value"); + strcpy(configBlock.mqttDebugTopic, "IoT/RainSensor1/Debug"); + configBlock.debugMode = 0; + configBlock.period = 500; + } + + if (! checkAuthentication()) { + return webServer.requestAuthentication(); + } + + + String buffer = + "" + " " + " ESP8266 based RainSensor" + " " + " " + "

ESP8266 based RainSensor - ESP8266 Configuration Page

"; + + if (configSaved) { + configSaved = false; + buffer += "

Configuration saved

"; + } + + buffer += + "
" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + " " + " " + "
" + " " + "
" + "
" + " " + ""; + + webServer.send(200, "text/html", buffer); + + +#ifdef DEBUG + Serial.println("indexHtml request served"); +#endif +} + +void configServeGetConfiguration() { + if (! checkAuthentication()) { + return webServer.requestAuthentication(); + } + + String arg; + + arg = webServer.arg("confUser"); + strcpy(configBlock.confUser, arg.c_str()); + arg = webServer.arg("confPasswd"); + strcpy(configBlock.confPasswd, arg.c_str()); + arg = webServer.arg("wifiSsid"); + strcpy(configBlock.wifiSsid, arg.c_str()); + arg = webServer.arg("wifiKey"); + strcpy(configBlock.wifiKey, arg.c_str()); + arg = webServer.arg("mqttBroker"); + strcpy(configBlock.mqttBroker, arg.c_str()); + arg = webServer.arg("mqttUser"); + strcpy(configBlock.mqttUser, arg.c_str()); + arg = webServer.arg("mqttPass"); + strcpy(configBlock.mqttPass, arg.c_str()); + arg = webServer.arg("mqttClientId"); + strcpy(configBlock.mqttClientId, arg.c_str()); + arg = webServer.arg("mqttPort"); + configBlock.mqttPort = atoi(arg.c_str()); + arg = webServer.arg("mqttTopic"); + strcpy(configBlock.mqttTopic, arg.c_str()); + arg = webServer.arg("mqttDebugTopic"); + strcpy(configBlock.mqttDebugTopic, arg.c_str()); + arg = webServer.arg("debugMode"); + configBlock.debugMode = atoi(arg.c_str()); + arg = webServer.arg("period"); + configBlock.period = atoi(arg.c_str()); + + configBlock.magic = MAGIC; + + showConfiguration(); + + EEPROM.begin(512); + EEPROM.put(EEPROM_ADDR, configBlock); + EEPROM.commit(); + + Serial.println("EEPROM saved"); + + configSaved = true; + webServer.sendHeader("Location", String("/"), true); + webServer.send(302, "text/plain", ""); + //webServer.send(200, "text/html", "configuration saved"); +} + +void showConfiguration() { + Serial.println("Configuration is"); + + Serial.print("magic = <"); + Serial.print(configBlock.magic); + Serial.println(">"); + + Serial.print("confUser = <"); + Serial.print(configBlock.confUser); + Serial.println(">"); + + Serial.print("confPasswd = <"); + Serial.print(configBlock.confPasswd); + Serial.println(">"); + + Serial.print("wifiSsid = <"); + Serial.print(configBlock.wifiSsid); + Serial.println(">"); + + Serial.print("wifiKey = <"); + Serial.print(configBlock.wifiKey); + Serial.println(">"); + + Serial.print("mqttBroker = <"); + Serial.print(configBlock.mqttBroker); + Serial.println(">"); + + Serial.print("mqttUser = <"); + Serial.print(configBlock.mqttUser); + Serial.println(">"); + + Serial.print("mqttPass = <"); + Serial.print(configBlock.mqttPass); + Serial.println(">"); + + Serial.print("mqttClientId = <"); + Serial.print(configBlock.mqttClientId); + Serial.println(">"); + + Serial.print("mqttPort = <"); + Serial.print(configBlock.mqttPort); + Serial.println(">"); + + Serial.print("mqttTopic = <"); + Serial.print(configBlock.mqttTopic); + Serial.println(">"); + + Serial.print("mqttDebugTopic = <"); + Serial.print(configBlock.mqttDebugTopic); + Serial.println(">"); + + Serial.print("debugMode = <"); + Serial.print(configBlock.debugMode); + Serial.println(">"); + + Serial.print("period = <"); + Serial.print(configBlock.period); + Serial.println(">"); + + + Serial.println("---"); +} \ No newline at end of file diff --git a/configuration.h b/configuration.h new file mode 100644 index 0000000..e1d2f65 --- /dev/null +++ b/configuration.h @@ -0,0 +1,24 @@ +typedef struct { + uint32_t magic; + char confUser[16]; + char confPasswd[16]; + char wifiSsid[32]; + char wifiKey[64]; + char mqttBroker[32]; + char mqttUser[32]; + char mqttPass[32]; + char mqttClientId[32]; + uint32_t mqttPort; + char mqttTopic[64]; + char mqttDebugTopic[64]; + uint32_t debugMode; + uint32_t period; +} tConfigBlock; + +extern const uint32_t MAGIC; +extern tConfigBlock configBlock; +extern const char* CONFIG_SSID; + +void configServeIndex(); +void configServeGetConfiguration(); +void showConfiguration(); \ No newline at end of file diff --git a/configurationMode.cpp b/configurationMode.cpp new file mode 100644 index 0000000..66a461a --- /dev/null +++ b/configurationMode.cpp @@ -0,0 +1,56 @@ +/* + * configurationMode.cpp + * + * Created on: Aug 20, 2017 + * Author: wn + */ + +#include "defines.h" + +#include +#include +#include +#include + + +#include "configurationMode.h" +#include "configuration.h" + + + + +ESP8266WebServer webServer(80); + +void configServeNotFound() { + webServer.send(404, "text/plain", "page not found"); +#ifdef DEBUG + Serial.println("page not found served"); +#endif +} + + + +void setupConfigurationNetwork() { + WiFi.mode(WIFI_AP); + WiFi.softAP(CONFIG_SSID); +#ifdef DEBUG + Serial.println("AP started"); +#endif +} + +void setupConfigurationServer() { + webServer.on("/", configServeIndex); + webServer.on("/config", configServeGetConfiguration); + webServer.onNotFound(configServeNotFound); + webServer.begin(); +#ifdef DEBUG + Serial.println("Webserver started"); +#endif +} + +void loopConfiguration() { + webServer.handleClient(); +} + + + diff --git a/configurationMode.h b/configurationMode.h new file mode 100644 index 0000000..59f5e19 --- /dev/null +++ b/configurationMode.h @@ -0,0 +1,18 @@ +/* + * configurationMode.h + * + * Created on: Aug 20, 2017 + * Author: wn + */ + +#ifndef CONFIGURATIONMODE_H_ +#define CONFIGURATIONMODE_H_ + + + +void setupConfigurationNetwork(); +void setupConfigurationServer(); +void loopConfiguration(); + + +#endif /* CONFIGURATIONMODE_H_ */ diff --git a/defines.h b/defines.h new file mode 100644 index 0000000..01abc20 --- /dev/null +++ b/defines.h @@ -0,0 +1,18 @@ +/* + * defines.h + * + * Created on: Aug 20, 2017 + * Author: wn + */ + +#ifndef DEFINES_H_ +#define DEFINES_H_ + +#define DEBUG + +#define EEPROM_ADDR 0 + +#define CONFIG_SWITCH 0 +#define HALL_PIN 2 + +#endif /* DEFINES_H_ */ diff --git a/productionMode.cpp b/productionMode.cpp new file mode 100644 index 0000000..3280cf1 --- /dev/null +++ b/productionMode.cpp @@ -0,0 +1,145 @@ +/* + * productionMode.cpp + * + * Created on: Jan 24, 2018 + * Author: wn + */ + + +#include "defines.h" + +#define MQTT_MAX_PACKET_SIZE 256 + +#include +#include +#include +#include +#include +#include + +#include "configuration.h" + + +volatile uint32_t cnt = 0; + +WiFiClientSecure espClient; +PubSubClient client(espClient); + + +void count() { + cnt++; +} + +void setup_wifi() { + delay(10); + WiFi.mode(WIFI_STA); + + // We start by connecting to a WiFi network +#ifdef DEBUG + Serial.println(); + Serial.print("Connecting to "); + Serial.println(configBlock.wifiSsid); +#endif + + WiFi.begin(configBlock.wifiSsid, configBlock.wifiKey); + + while (WiFi.status() != WL_CONNECTED) { + delay(50); +#ifdef DEBUG + Serial.print("."); +#endif + } + Serial.println("!"); + +#ifdef DEBUG + Serial.println(""); + Serial.println("WiFi connected"); + Serial.println("IP address: "); + Serial.println(WiFi.localIP()); +#endif +} + + + + + +void reconnect() { + // Loop until we're reconnected + while (!client.connected()) { +#ifdef DEBUG + Serial.print("Attempting MQTT connection..."); +#endif + // Attempt to connect + //char clientId[128]; + //snprintf(clientId, 127, "esp%s", WiFi.macAddress().c_str()); + if (client.connect(configBlock.mqttClientId, configBlock.mqttUser, configBlock.mqttPass)) { +#ifdef DEBUG + Serial.println("connected"); +#endif +// client.setCallback(callback); + + // Once connected, publish an announcement... + client.publish(configBlock.mqttDebugTopic, "hello world"); + client.publish(configBlock.mqttDebugTopic, WiFi.localIP().toString().c_str()); + } else { +#ifdef DEBUG + Serial.print("failed, rc="); + Serial.print(client.state()); + Serial.println(" try again in 5 seconds"); +#endif + // Wait 5 seconds before retrying + delay(5000); + } + } +} + + +bool mqtt_connect() { + bool reconnected = false; + if (!client.connected()) { + reconnect(); + reconnected = true; + } + client.loop(); + return reconnected; +} + + +void setupProduction() { + pinMode(HALL_PIN, INPUT_PULLUP); + + attachInterrupt(HALL_PIN, count, FALLING); + + setup_wifi(); + client.setServer(configBlock.mqttBroker, configBlock.mqttPort); +} + + +void loopProduction() { + bool reconnected = mqtt_connect(); + static uint32_t reconnectTime = 0; + if (reconnected) { + reconnectTime = millis(); + } + + static uint32_t lastMillis = 0; + uint32_t currentMillis = millis(); + + if (currentMillis > (lastMillis + (configBlock.period * 1000))) { + lastMillis = currentMillis; + + uint32_t myCnt = 0; + noInterrupts(); + myCnt = cnt; + cnt = 0; + interrupts(); + + Serial.println(myCnt); + } + + +} + + + + diff --git a/productionMode.h b/productionMode.h new file mode 100644 index 0000000..48a68cc --- /dev/null +++ b/productionMode.h @@ -0,0 +1,19 @@ +/* + * productionMode.h + * + * Created on: Jan 24, 2018 + * Author: wn + */ + +#ifndef PRODUCTIONMODE_H_ +#define PRODUCTIONMODE_H_ + + + +void setupProduction(); +void loopProduction(); + + + + +#endif /* PRODUCTIONMODE_H_ */ diff --git a/pubsubclient/PubSubClient.cpp b/pubsubclient/PubSubClient.cpp new file mode 100644 index 0000000..89d0f05 --- /dev/null +++ b/pubsubclient/PubSubClient.cpp @@ -0,0 +1,670 @@ +/* + PubSubClient.cpp - A simple client for MQTT. + Nick O'Leary + http://knolleary.net +*/ + +#include "PubSubClient.h" +#include "Arduino.h" + +#ifdef ESP8266 + #define INIT_FINGERPRINT() this->fingerprint = NULL; +#else + #define INIT_FINGERPRINT() +#endif + +PubSubClient::PubSubClient() { + this->_state = MQTT_DISCONNECTED; + this->_client = NULL; + this->stream = NULL; + setCallback(NULL); + this->_available = 0; + INIT_FINGERPRINT() +} + +PubSubClient::PubSubClient(Client& client) { + this->_state = MQTT_DISCONNECTED; + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} + +#ifdef ESP8266 +PubSubClient::PubSubClient(WiFiClientSecure& client, const char* fingerprint) { + this->_state = MQTT_DISCONNECTED; + setClient(client); + this->stream = NULL; + this->_available = 0; + this->fingerprint = fingerprint; +} +#endif + +PubSubClient::PubSubClient(IPAddress addr, uint16_t port, Client& client) { + this->_state = MQTT_DISCONNECTED; + setServer(addr, port); + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(IPAddress addr, uint16_t port, Client& client, Stream& stream) { + this->_state = MQTT_DISCONNECTED; + setServer(addr,port); + setClient(client); + setStream(stream); + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(IPAddress addr, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client) { + this->_state = MQTT_DISCONNECTED; + setServer(addr, port); + setCallback(callback); + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(IPAddress addr, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client, Stream& stream) { + this->_state = MQTT_DISCONNECTED; + setServer(addr,port); + setCallback(callback); + setClient(client); + setStream(stream); + this->_available = 0; + INIT_FINGERPRINT() +} + +PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, Client& client) { + this->_state = MQTT_DISCONNECTED; + setServer(ip, port); + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, Client& client, Stream& stream) { + this->_state = MQTT_DISCONNECTED; + setServer(ip,port); + setClient(client); + setStream(stream); + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client) { + this->_state = MQTT_DISCONNECTED; + setServer(ip, port); + setCallback(callback); + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client, Stream& stream) { + this->_state = MQTT_DISCONNECTED; + setServer(ip,port); + setCallback(callback); + setClient(client); + setStream(stream); + this->_available = 0; + INIT_FINGERPRINT() +} + +PubSubClient::PubSubClient(const char* domain, uint16_t port, Client& client) { + this->_state = MQTT_DISCONNECTED; + setServer(domain,port); + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(const char* domain, uint16_t port, Client& client, Stream& stream) { + this->_state = MQTT_DISCONNECTED; + setServer(domain,port); + setClient(client); + setStream(stream); + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(const char* domain, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client) { + this->_state = MQTT_DISCONNECTED; + setServer(domain,port); + setCallback(callback); + setClient(client); + this->stream = NULL; + this->_available = 0; + INIT_FINGERPRINT() +} +PubSubClient::PubSubClient(const char* domain, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client, Stream& stream) { + this->_state = MQTT_DISCONNECTED; + setServer(domain,port); + setCallback(callback); + setClient(client); + setStream(stream); + this->_available = 0; + INIT_FINGERPRINT() +} + +boolean PubSubClient::connect(const char *id) { + return connect(id,NULL,NULL,0,0,0,0); +} + +boolean PubSubClient::connect(const char *id, const char *user, const char *pass) { + return connect(id,user,pass,0,0,0,0); +} + +boolean PubSubClient::connect(const char *id, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage) { + return connect(id,NULL,NULL,willTopic,willQos,willRetain,willMessage); +} + +boolean PubSubClient::connect(const char *id, const char *user, const char *pass, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage) { + if (!connected()) { + int result = 0; + + if (domain != NULL) { + result = _client->connect(this->domain, this->port); + } else { + result = _client->connect(this->ip, this->port); + } + +#ifdef ESP8266 + if (fingerprint != NULL) { + if (domain != NULL) { + // there's only one way to set fingerprint: using the WiFiClientSecure-based constructor, so this cast is safe + if (!static_cast(_client)->verify(fingerprint, domain)) { + _state = MQTT_TLS_BAD_SERVER_CREDENTIALS; + return false; + } + } + else { + char buffer[16]; // IPv4 only (which is what IPAddress supports anyway) + + ip.toString().toCharArray(buffer, 16); + + if (!static_cast(_client)->verify(fingerprint, buffer)) { + _state = MQTT_TLS_BAD_SERVER_CREDENTIALS; + return false; + } + } + } +#endif + + if (result == 1) { + nextMsgId = 1; + // Leave room in the buffer for header and variable length field + uint16_t length = 5; + unsigned int j; + +#if MQTT_VERSION == MQTT_VERSION_3_1 + uint8_t d[9] = {0x00,0x06,'M','Q','I','s','d','p', MQTT_VERSION}; +#define MQTT_HEADER_VERSION_LENGTH 9 +#elif MQTT_VERSION == MQTT_VERSION_3_1_1 + uint8_t d[7] = {0x00,0x04,'M','Q','T','T',MQTT_VERSION}; +#define MQTT_HEADER_VERSION_LENGTH 7 +#endif + for (j = 0;j>1); + } + } + + buffer[length++] = v; + + buffer[length++] = ((MQTT_KEEPALIVE) >> 8); + buffer[length++] = ((MQTT_KEEPALIVE) & 0xFF); + length = writeString(id,buffer,length); + if (willTopic) { + length = writeString(willTopic,buffer,length); + length = writeString(willMessage,buffer,length); + } + + if(user != NULL) { + length = writeString(user,buffer,length); + if(pass != NULL) { + length = writeString(pass,buffer,length); + } + } + + write(MQTTCONNECT,buffer,length-5); + + lastInActivity = lastOutActivity = millis(); + + while (!available()) { + unsigned long t = millis(); + if (t-lastInActivity >= ((int32_t) MQTT_SOCKET_TIMEOUT*1000UL)) { + _state = MQTT_CONNECTION_TIMEOUT; + _client->stop(); + return false; + } + } + uint8_t llen; + uint16_t len = readPacket(&llen); + + if (len == 4) { + if (buffer[3] == 0) { + lastInActivity = millis(); + pingOutstanding = false; + _state = MQTT_CONNECTED; + return true; + } else { + _state = buffer[3]; + } + } + _client->stop(); + } else { + _state = MQTT_CONNECT_FAILED; + } + return false; + } + return true; +} + +// return and cache the available number of bytes in the client; +// remember to reduce the available count when consuming the buffer +int PubSubClient::available() { + if (_available == 0) { + _available = _client->available(); + } + return _available; +} + +// reads a byte into result +boolean PubSubClient::readByte(uint8_t * result) { + uint32_t previousMillis = millis(); + while(!available()) { + uint32_t currentMillis = millis(); + if(currentMillis - previousMillis >= ((int32_t) MQTT_SOCKET_TIMEOUT * 1000)){ + return false; + } + } + *result = _client->read(); + _available -= 1; + return true; +} + +// reads a byte into result[*index] and increments index +boolean PubSubClient::readByte(uint8_t * result, uint16_t * index){ + uint16_t current_index = *index; + uint8_t * write_address = &(result[current_index]); + if(readByte(write_address)){ + *index = current_index + 1; + return true; + } + return false; +} + +uint16_t PubSubClient::readPacket(uint8_t* lengthLength) { + uint16_t len = 0; + if(!readByte(buffer, &len)) return 0; + bool isPublish = (buffer[0]&0xF0) == MQTTPUBLISH; + uint32_t multiplier = 1; + uint16_t length = 0; + uint8_t digit = 0; + uint16_t skip = 0; + uint8_t start = 0; + + do { + if(!readByte(&digit)) return 0; + buffer[len++] = digit; + length += (digit & 127) * multiplier; + multiplier *= 128; + } while ((digit & 128) != 0); + *lengthLength = len-1; + + if (isPublish) { + // Read in topic length to calculate bytes to skip over for Stream writing + if(!readByte(buffer, &len)) return 0; + if(!readByte(buffer, &len)) return 0; + skip = (buffer[*lengthLength+1]<<8)+buffer[*lengthLength+2]; + start = 2; + if (buffer[0]&MQTTQOS1) { + // skip message id + skip += 2; + } + } + + for (uint16_t i = start;istream) { + if (isPublish && len-*lengthLength-2>skip) { + this->stream->write(digit); + } + } + if (len < MQTT_MAX_PACKET_SIZE) { + buffer[len] = digit; + } + len++; + } + + if (!this->stream && len > MQTT_MAX_PACKET_SIZE) { + len = 0; // This will cause the packet to be ignored. + } + + return len; +} + +boolean PubSubClient::loop() { + if (connected()) { + do { + unsigned long t = millis(); + if ((t - lastInActivity > MQTT_KEEPALIVE*1000UL) || (t - lastOutActivity > MQTT_KEEPALIVE*1000UL)) { + if (pingOutstanding) { + this->_state = MQTT_CONNECTION_TIMEOUT; + _client->stop(); + return false; + } else { + buffer[0] = MQTTPINGREQ; + buffer[1] = 0; + _client->write(buffer,2); + lastOutActivity = t; + lastInActivity = t; + pingOutstanding = true; + } + } + + if (available()) { + uint8_t llen; + uint16_t len = readPacket(&llen); + uint16_t msgId = 0; + uint8_t *payload; + if (len > 0) { + lastInActivity = t; + uint8_t type = buffer[0]&0xF0; + if (type == MQTTPUBLISH) { + if (callback) { + uint16_t tl = (buffer[llen+1]<<8)+buffer[llen+2]; /* topic length in bytes */ + memmove(buffer+llen+2,buffer+llen+3,tl); /* move topic inside buffer 1 byte to front */ + buffer[llen+2+tl] = 0; /* end the topic as a 'C' string with \x00 */ + char *topic = (char*) buffer+llen+2; + // msgId only present for QOS>0 + if ((buffer[0]&0x06) == MQTTQOS1) { + msgId = (buffer[llen+3+tl]<<8)+buffer[llen+3+tl+1]; + payload = buffer+llen+3+tl+2; + callback(topic,payload,len-llen-3-tl-2); + + buffer[0] = MQTTPUBACK; + buffer[1] = 2; + buffer[2] = (msgId >> 8); + buffer[3] = (msgId & 0xFF); + _client->write(buffer,4); + lastOutActivity = t; + + } else { + payload = buffer+llen+3+tl; + callback(topic,payload,len-llen-3-tl); + } + } + } else if (type == MQTTPINGREQ) { + buffer[0] = MQTTPINGRESP; + buffer[1] = 0; + _client->write(buffer,2); + } else if (type == MQTTPINGRESP) { + pingOutstanding = false; + } + } + } + } while (_available > 0); // can't leave data in the buffer, or subsequent publish() calls + // may fail (axTLS is only half-duplex, so writes will fail, to + // avoid losing information) + return true; + } + return false; +} + +boolean PubSubClient::publish(const char* topic, const char* payload) { + return publish(topic,(const uint8_t*)payload,strlen(payload),false); +} + +boolean PubSubClient::publish(const char* topic, const char* payload, boolean retained) { + return publish(topic,(const uint8_t*)payload,strlen(payload),retained); +} + +boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigned int plength) { + return publish(topic, payload, plength, false); +} + +boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigned int plength, boolean retained) { + if (connected()) { + if (MQTT_MAX_PACKET_SIZE < 5 + 2+strlen(topic) + plength) { + // Too long + return false; + } + // Leave room in the buffer for header and variable length field + uint16_t length = 5; + length = writeString(topic,buffer,length); + uint16_t i; + for (i=0;i 0) { + digit |= 0x80; + } + buffer[pos++] = digit; + llen++; + } while(len>0); + + pos = writeString(topic,buffer,pos); + + rc += _client->write(buffer,pos); + + for (i=0;iwrite((char)pgm_read_byte_near(payload + i)); + } + + lastOutActivity = millis(); + + return rc == tlen + 4 + plength; +} + +boolean PubSubClient::write(uint8_t header, uint8_t* buf, uint16_t length) { + uint8_t lenBuf[4]; + uint8_t llen = 0; + uint8_t digit; + uint8_t pos = 0; + uint16_t rc; + uint16_t len = length; + do { + digit = len % 128; + len = len / 128; + if (len > 0) { + digit |= 0x80; + } + lenBuf[pos++] = digit; + llen++; + } while(len>0); + + buf[4-llen] = header; + for (int i=0;i 0) && result) { + bytesToWrite = (bytesRemaining > MQTT_MAX_TRANSFER_SIZE)?MQTT_MAX_TRANSFER_SIZE:bytesRemaining; + rc = _client->write(writeBuf,bytesToWrite); + result = (rc == bytesToWrite); + bytesRemaining -= rc; + writeBuf += rc; + } + return result; +#else + rc = _client->write(buf+(4-llen),length+1+llen); + lastOutActivity = millis(); + return (rc == 1+llen+length); +#endif +} + +boolean PubSubClient::subscribe(const char* topic) { + return subscribe(topic, 0); +} + +boolean PubSubClient::subscribe(const char* topic, uint8_t qos) { + if (qos < 0 || qos > 1) { + return false; + } + if (MQTT_MAX_PACKET_SIZE < 9 + strlen(topic)) { + // Too long + return false; + } + if (connected()) { + // Leave room in the buffer for header and variable length field + uint16_t length = 5; + nextMsgId++; + if (nextMsgId == 0) { + nextMsgId = 1; + } + buffer[length++] = (nextMsgId >> 8); + buffer[length++] = (nextMsgId & 0xFF); + length = writeString((char*)topic, buffer,length); + buffer[length++] = qos; + return write(MQTTSUBSCRIBE|MQTTQOS1,buffer,length-5); + } + return false; +} + +boolean PubSubClient::unsubscribe(const char* topic) { + if (MQTT_MAX_PACKET_SIZE < 9 + strlen(topic)) { + // Too long + return false; + } + if (connected()) { + uint16_t length = 5; + nextMsgId++; + if (nextMsgId == 0) { + nextMsgId = 1; + } + buffer[length++] = (nextMsgId >> 8); + buffer[length++] = (nextMsgId & 0xFF); + length = writeString(topic, buffer,length); + return write(MQTTUNSUBSCRIBE|MQTTQOS1,buffer,length-5); + } + return false; +} + +void PubSubClient::disconnect() { + buffer[0] = MQTTDISCONNECT; + buffer[1] = 0; + _client->write(buffer,2); + _state = MQTT_DISCONNECTED; + _client->stop(); + lastInActivity = lastOutActivity = millis(); +} + +uint16_t PubSubClient::writeString(const char* string, uint8_t* buf, uint16_t pos) { + const char* idp = string; + uint16_t i = 0; + pos += 2; + while (*idp) { + buf[pos++] = *idp++; + i++; + } + buf[pos-i-2] = (i >> 8); + buf[pos-i-1] = (i & 0xFF); + return pos; +} + + +boolean PubSubClient::connected() { + boolean rc; + if (_client == NULL ) { + rc = false; + } else { + rc = (int)_client->connected(); + if (!rc) { + if (this->_state == MQTT_CONNECTED) { + this->_state = MQTT_CONNECTION_LOST; + _client->flush(); + _client->stop(); + } + } + } + return rc; +} + +PubSubClient& PubSubClient::setServer(uint8_t * ip, uint16_t port) { + IPAddress addr(ip[0],ip[1],ip[2],ip[3]); + return setServer(addr,port); +} + +PubSubClient& PubSubClient::setServer(IPAddress ip, uint16_t port) { + this->ip = ip; + this->port = port; + this->domain = NULL; + return *this; +} + +PubSubClient& PubSubClient::setServer(const char * domain, uint16_t port) { + this->domain = domain; + this->port = port; + return *this; +} + +PubSubClient& PubSubClient::setCallback(MQTT_CALLBACK_SIGNATURE) { + this->callback = callback; + return *this; +} + +PubSubClient& PubSubClient::setClient(Client& client){ + this->_client = &client; + return *this; +} + +PubSubClient& PubSubClient::setStream(Stream& stream){ + this->stream = &stream; + return *this; +} + +int PubSubClient::state() { + return this->_state; +} diff --git a/pubsubclient/PubSubClient.h b/pubsubclient/PubSubClient.h new file mode 100644 index 0000000..16bf8d3 --- /dev/null +++ b/pubsubclient/PubSubClient.h @@ -0,0 +1,160 @@ +/* + PubSubClient.h - A simple client for MQTT. + Nick O'Leary + http://knolleary.net +*/ + +#ifndef PubSubClient_h +#define PubSubClient_h + +#include +#include "IPAddress.h" +#include "Client.h" +#include "Stream.h" + +#ifdef ESP8266 +#include "WiFiClientSecure.h" +#endif + +#define MQTT_VERSION_3_1 3 +#define MQTT_VERSION_3_1_1 4 + +// MQTT_VERSION : Pick the version +//#define MQTT_VERSION MQTT_VERSION_3_1 +#ifndef MQTT_VERSION +#define MQTT_VERSION MQTT_VERSION_3_1_1 +#endif + +// MQTT_MAX_PACKET_SIZE : Maximum packet size +#ifndef MQTT_MAX_PACKET_SIZE +#define MQTT_MAX_PACKET_SIZE 128 +#endif + +// MQTT_KEEPALIVE : keepAlive interval in Seconds +#ifndef MQTT_KEEPALIVE +#define MQTT_KEEPALIVE 15 +#endif + +// MQTT_SOCKET_TIMEOUT: socket timeout interval in Seconds +#ifndef MQTT_SOCKET_TIMEOUT +#define MQTT_SOCKET_TIMEOUT 15 +#endif + +// MQTT_MAX_TRANSFER_SIZE : limit how much data is passed to the network client +// in each write call. Needed for the Arduino Wifi Shield. Leave undefined to +// pass the entire MQTT packet in each write call. +//#define MQTT_MAX_TRANSFER_SIZE 80 + +// Possible values for client.state() +#define MQTT_TLS_BAD_SERVER_CREDENTIALS -5 +#define MQTT_CONNECTION_TIMEOUT -4 +#define MQTT_CONNECTION_LOST -3 +#define MQTT_CONNECT_FAILED -2 +#define MQTT_DISCONNECTED -1 +#define MQTT_CONNECTED 0 +#define MQTT_CONNECT_BAD_PROTOCOL 1 +#define MQTT_CONNECT_BAD_CLIENT_ID 2 +#define MQTT_CONNECT_UNAVAILABLE 3 +#define MQTT_CONNECT_BAD_CREDENTIALS 4 +#define MQTT_CONNECT_UNAUTHORIZED 5 + +#define MQTTCONNECT 1 << 4 // Client request to connect to Server +#define MQTTCONNACK 2 << 4 // Connect Acknowledgment +#define MQTTPUBLISH 3 << 4 // Publish message +#define MQTTPUBACK 4 << 4 // Publish Acknowledgment +#define MQTTPUBREC 5 << 4 // Publish Received (assured delivery part 1) +#define MQTTPUBREL 6 << 4 // Publish Release (assured delivery part 2) +#define MQTTPUBCOMP 7 << 4 // Publish Complete (assured delivery part 3) +#define MQTTSUBSCRIBE 8 << 4 // Client Subscribe request +#define MQTTSUBACK 9 << 4 // Subscribe Acknowledgment +#define MQTTUNSUBSCRIBE 10 << 4 // Client Unsubscribe request +#define MQTTUNSUBACK 11 << 4 // Unsubscribe Acknowledgment +#define MQTTPINGREQ 12 << 4 // PING Request +#define MQTTPINGRESP 13 << 4 // PING Response +#define MQTTDISCONNECT 14 << 4 // Client is Disconnecting +#define MQTTReserved 15 << 4 // Reserved + +#define MQTTQOS0 (0 << 1) +#define MQTTQOS1 (1 << 1) +#define MQTTQOS2 (2 << 1) + +#ifdef ESP8266 +#include +#define MQTT_CALLBACK_SIGNATURE std::function callback +#else +#define MQTT_CALLBACK_SIGNATURE void (*callback)(char*, uint8_t*, unsigned int) +#endif + +class PubSubClient { +private: + Client* _client; + uint8_t buffer[MQTT_MAX_PACKET_SIZE]; + uint16_t nextMsgId; + unsigned long lastOutActivity; + unsigned long lastInActivity; + int _available; + bool pingOutstanding; + MQTT_CALLBACK_SIGNATURE; + int available(); + uint16_t readPacket(uint8_t*); + boolean readByte(uint8_t * result); + boolean readByte(uint8_t * result, uint16_t * index); + boolean write(uint8_t header, uint8_t* buf, uint16_t length); + uint16_t writeString(const char* string, uint8_t* buf, uint16_t pos); + IPAddress ip; + const char* domain; + uint16_t port; + Stream* stream; + int _state; + +#ifdef ESP8266 + const char* fingerprint; +#endif + +public: + PubSubClient(); + PubSubClient(Client& client); + PubSubClient(IPAddress, uint16_t, Client& client); + PubSubClient(IPAddress, uint16_t, Client& client, Stream&); + PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client); + PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&); + PubSubClient(uint8_t *, uint16_t, Client& client); + PubSubClient(uint8_t *, uint16_t, Client& client, Stream&); + PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client); + PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&); + PubSubClient(const char*, uint16_t, Client& client); + PubSubClient(const char*, uint16_t, Client& client, Stream&); + PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client); + PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&); + +#ifdef ESP8266 + PubSubClient(WiFiClientSecure& client, const char* fingerprint); +#endif + + PubSubClient& setServer(IPAddress ip, uint16_t port); + PubSubClient& setServer(uint8_t * ip, uint16_t port); + PubSubClient& setServer(const char * domain, uint16_t port); + PubSubClient& setCallback(MQTT_CALLBACK_SIGNATURE); + PubSubClient& setClient(Client& client); + PubSubClient& setStream(Stream& stream); + + boolean connect(const char* id); + boolean connect(const char* id, const char* user, const char* pass); + boolean connect(const char* id, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage); + boolean connect(const char* id, const char* user, const char* pass, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage); + void disconnect(); + boolean publish(const char* topic, const char* payload); + boolean publish(const char* topic, const char* payload, boolean retained); + boolean publish(const char* topic, const uint8_t * payload, unsigned int plength); + boolean publish(const char* topic, const uint8_t * payload, unsigned int plength, boolean retained); + boolean publish_P(const char* topic, const uint8_t * payload, unsigned int plength, boolean retained); + boolean subscribe(const char* topic); + boolean subscribe(const char* topic, uint8_t qos); + boolean unsubscribe(const char* topic); + boolean loop(); + boolean connected(); + int state(); +}; + + +#endif