Browse Source

working

master
agr 4 years ago
parent
commit
9984218e15
8 changed files with 172 additions and 37 deletions
  1. +3
    -0
      .cproject
  2. +6
    -1
      .project
  3. +1
    -1
      .settings/language.settings.xml
  4. +51
    -15
      .settings/org.eclipse.cdt.core.prefs
  5. +78
    -20
      Web_Net_Setup.ino
  6. +9
    -0
      sensor.cpp
  7. +15
    -0
      sensor.h
  8. +9
    -0
      struct.h

+ 3
- 0
.cproject View File

@@ -24,6 +24,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/EEPROM/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/EEPROM/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/Ethernet/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/Ethernet/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/SPI/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/SPI/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/PubSubClient/src}&quot;"/>
</option> </option>
<inputType id="io.sloeber.compiler.cpp.sketch.input.1548351445" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/> <inputType id="io.sloeber.compiler.cpp.sketch.input.1548351445" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/>
</tool> </tool>
@@ -34,6 +35,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/EEPROM/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/EEPROM/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/Ethernet/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/Ethernet/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/SPI/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/SPI/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/PubSubClient/src}&quot;"/>
</option> </option>
<inputType id="io.sloeber.compiler.c.sketch.input.1902735707" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/> <inputType id="io.sloeber.compiler.c.sketch.input.1902735707" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/>
</tool> </tool>
@@ -44,6 +46,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/EEPROM/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/EEPROM/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/Ethernet/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/Ethernet/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/SPI/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/SPI/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/configWebserver/libraries/PubSubClient/src}&quot;"/>
</option> </option>
<inputType id="io.sloeber.compiler.S.sketch.input.52936448" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/> <inputType id="io.sloeber.compiler.S.sketch.input.52936448" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/>
</tool> </tool>


+ 6
- 1
.project View File

@@ -39,7 +39,7 @@
<link> <link>
<name>core/variant</name> <name>core/variant</name>
<type>2</type> <type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.8.2/variants/eightanaloginputs</locationURI>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.8.2/variants/mega</locationURI>
</link> </link>
<link> <link>
<name>libraries/EEPROM</name> <name>libraries/EEPROM</name>
@@ -51,6 +51,11 @@
<type>2</type> <type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/libraries/Ethernet/2.0.0</locationURI> <locationURI>ECLIPSE_HOME/arduinoPlugin/libraries/Ethernet/2.0.0</locationURI>
</link> </link>
<link>
<name>libraries/PubSubClient</name>
<type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/libraries/PubSubClient/2.7.0</locationURI>
</link>
<link> <link>
<name>libraries/SPI</name> <name>libraries/SPI</name>
<type>2</type> <type>2</type>


+ 1
- 1
.settings/language.settings.xml View File

@@ -4,7 +4,7 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="io.sloeber.core.toolchain.ArduinoLanguageProvider" console="false" env-hash="950558152315445550" id="io.sloeber.languageSettingsProvider" keep-relative-paths="false" name="Arduino Compiler Settings" parameter="${COMMAND} -E -P -v -dD -D__IN_ECLIPSE__ &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="io.sloeber.core.toolchain.ArduinoLanguageProvider" console="false" env-hash="924733868962110222" id="io.sloeber.languageSettingsProvider" keep-relative-paths="false" name="Arduino Compiler Settings" parameter="${COMMAND} -E -P -v -dD -D__IN_ECLIPSE__ &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>


+ 51
- 15
.settings/org.eclipse.cdt.core.prefs View File

@@ -13,10 +13,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.EXT
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.EXTENDED_FUSES/value=0xFD environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.EXTENDED_FUSES/value=0xFD
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/value=atmega/ATmegaBOOT_168_atmega328.hex
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/value=stk500v2/stk500boot_v2_mega2560.hex
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/value=0xDA
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/value=0xD8
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/value=0x0F environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/value=0x0F
@@ -34,7 +34,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.ARCH/ope
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.ARCH/value=AVR environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.ARCH/value=AVR
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/value=AVR_NANO
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/value=AVR_MEGA2560
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\cores\\arduino environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\cores\\arduino
@@ -49,7 +49,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.F_CPU/op
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.F_CPU/value=16000000L environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.F_CPU/value=16000000L
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/value=atmega328p
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/value=atmega2560
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/value=${ProjDirPath}/${ConfigName} environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/value=${ProjDirPath}/${ConfigName}
@@ -67,10 +67,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.USB_MANU
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.USB_MANUFACTURER/value=\\"Unknown\\" environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.USB_MANUFACTURER/value=\\"Unknown\\"
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\variants\\eightanaloginputs
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\variants\\mega
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/value=eightanaloginputs
environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/value=mega
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/value=avr-gcc-ar environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/value=avr-gcc-ar
@@ -91,7 +91,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.EXTRA_FLAGS/value= environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.EXTRA_FLAGS/value=
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/value=${A.COMPILER.WARNING_FLAGS} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/value=${A.COMPILER.WARNING_FLAGS} -Os -Wl,--gc-sections,--relax
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/value= environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/value=
@@ -160,10 +160,28 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.ESP8266.NETWOR
environment/project/io.sloeber.core.toolChain.release.613547860/A.ESP8266.NETWORK.UPLOAD.TOOL/value=esp8266OTA environment/project/io.sloeber.core.toolChain.release.613547860/A.ESP8266.NETWORK.UPLOAD.TOOL/value=esp8266OTA
environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/value=Arduino Nano
environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/value=Arduino Mega or Mega 2560
environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/value=${eclipse_home}/arduinoPlugin/packages environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/value=${eclipse_home}/arduinoPlugin/packages
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.0/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.0/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.0/value=0x0010
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.1/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.1/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.1/value=0x0042
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.2/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.2/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.2/value=0x0010
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.3/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.3/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.3/value=0x0042
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.4/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.4/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.4/value=0x0210
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.5/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.5/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.5/value=0x0242
environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/value=-w -x c++ -M -MG -MP environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/value=-w -x c++ -M -MG -MP
@@ -406,16 +424,16 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.ALTID/o
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.ALTID/value=no_altID environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.ALTID/value=no_altID
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/value=2048
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/value=8192
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/value=30720
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/value=253952
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/value=arduino
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/value=wiring
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/value=57600
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/value=115200
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/value=avrdude environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/value=avrdude
@@ -425,6 +443,24 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.USBID/v
environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/value=1.8.2 environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/value=1.8.2
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.0/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.0/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.0/value=0x2341
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.1/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.1/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.1/value=0x2341
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.2/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.2/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.2/value=0x2A03
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.3/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.3/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.3/value=0x2A03
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.4/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.4/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.4/value=0x2341
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.5/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.5/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.5/value=0x2341
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/value=avr environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/value=avr
@@ -433,10 +469,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARDS_FI
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARDS_FILE/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\boards.txt environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARDS_FILE/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\boards.txt
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/value=nano
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/value=mega
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/value=Arduino Nano
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/value=Arduino Mega or Mega 2560
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/value=COM4 environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/value=COM4
@@ -469,7 +505,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MAKE_LOCA
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MAKE_LOCATION/value=C\:\\Sloeber\\arduinoPlugin\\tools\\make\\ environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MAKE_LOCATION/value=C\:\\Sloeber\\arduinoPlugin\\tools\\make\\
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/value=cpu\=atmega328old
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/value=cpu\=atmega2560
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/delimiter=;
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/operation=replace
environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/value=${A.RECIPE.OBJCOPY.EEP.PATTERN}\n\t${A.RECIPE.OBJCOPY.HEX.PATTERN} environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/value=${A.RECIPE.OBJCOPY.EEP.PATTERN}\n\t${A.RECIPE.OBJCOPY.HEX.PATTERN}


+ 78
- 20
Web_Net_Setup.ino View File

@@ -90,23 +90,9 @@ For more informations about EEPROMAnything.h look at http://playground.arduino.c
*/ */
#include "struct.h" #include "struct.h"


// int EEPROM_readAnything(int ee, config_t& value)
//{
// byte* p = (byte*)(void*)&value;
// unsigned int i;
// for (i = 0; i < sizeof(value); i++)
// *p++ = EEPROM.read(ee++);
// return i;
//}
//
// int EEPROM_writeAnything(int ee, const config_t& value)
//{
// const byte* p = (const byte*)(const void*)&value;
// unsigned int i;
// for (i = 0; i < sizeof(value); i++)
// EEPROM.write(ee++, *p++);
// return i;
//}
//MQTT intern include
//#include "mqttintern.h"



/** /**
* set_EEPROM_Default() function * set_EEPROM_Default() function
@@ -128,13 +114,13 @@ void set_EEPROM_Default() {
eeprom_config.mac[4]=0xFE; eeprom_config.mac[4]=0xFE;
eeprom_config.mac[5]=0xED; eeprom_config.mac[5]=0xED;
// set the default IP address for the arduino. In this case its 192.168.0.111
// set the default IP address for the arduino. In this case its 192.168.1.97
eeprom_config.ip[0]=192; eeprom_config.ip[0]=192;
eeprom_config.ip[1]=168; eeprom_config.ip[1]=168;
eeprom_config.ip[2]=1; eeprom_config.ip[2]=1;
eeprom_config.ip[3]=97; eeprom_config.ip[3]=97;
// set the default GATEWAY. In this case its 192.168.0.254
// set the default GATEWAY. In this case its 192.168.1.1
eeprom_config.gateway[0]=192; eeprom_config.gateway[0]=192;
eeprom_config.gateway[1]=168; eeprom_config.gateway[1]=168;
eeprom_config.gateway[2]=1; eeprom_config.gateway[2]=1;
@@ -146,7 +132,7 @@ void set_EEPROM_Default() {
eeprom_config.subnet[2]=255; eeprom_config.subnet[2]=255;
eeprom_config.subnet[3]=0; eeprom_config.subnet[3]=0;


// set the default DNS SERVER. In this case its 192.168.0.254
// set the default DNS SERVER. In this case its 192.168.1.1
eeprom_config.dns_server[0]=192; eeprom_config.dns_server[0]=192;
eeprom_config.dns_server[1]=168; eeprom_config.dns_server[1]=168;
eeprom_config.dns_server[2]=1; eeprom_config.dns_server[2]=1;
@@ -155,6 +141,14 @@ void set_EEPROM_Default() {
// set the default Webserver Port. In this case its Port 80 // set the default Webserver Port. In this case its Port 80
eeprom_config.webserverPort=80; eeprom_config.webserverPort=80;
// set the default MQTT SERVER. In this case its 192.168.1.35
eeprom_config.mqtt_server[0]=192;
eeprom_config.mqtt_server[1]=168;
eeprom_config.mqtt_server[2]=1;
eeprom_config.mqtt_server[3]=35;

// set the default Webserver Port. In this case its Port 80
eeprom_config.mqttserverPort=1883;
#ifdef DEBUG #ifdef DEBUG
Serial.println("Config reset"); Serial.println("Config reset");
#endif #endif
@@ -231,6 +225,15 @@ void print_EEPROM_Settings() {
} }
Serial.println(); Serial.println();
Serial.print("MQTT Server: ");
for(int i = 0; i<4; i++) {
Serial.print(eeprom_config.mqtt_server[i]);
if (i<3) {
Serial.print('.');
}
}
Serial.println();

Serial.print("MAC: "); Serial.print("MAC: ");
for (int a=0;a<6;a++) { for (int a=0;a<6;a++) {
Serial.print(eeprom_config.mac[a],HEX); Serial.print(eeprom_config.mac[a],HEX);
@@ -239,6 +242,8 @@ void print_EEPROM_Settings() {
} }
} }
Serial.println(); Serial.println();
Serial.print("MQTTserver Port: ");
Serial.println(eeprom_config.mqttserverPort);
Serial.print("Webserver Port: "); Serial.print("Webserver Port: ");
Serial.println(eeprom_config.webserverPort); Serial.println(eeprom_config.webserverPort);
@@ -360,6 +365,8 @@ P(DNS_SERVER) = "DNS server: ";
P(WEB_PORT) = "Webserver port (1-65535): "; P(WEB_PORT) = "Webserver port (1-65535): ";
P(DHCP_ACTIVE) = "Use DHCP: "; P(DHCP_ACTIVE) = "Use DHCP: ";
P(DHCP_REFRESH) = "Renew interval for DHCP in minutes (1 - 255): "; P(DHCP_REFRESH) = "Renew interval for DHCP in minutes (1 - 255): ";
P(MQTT_SERVER) = "MQTT server: ";
P(MQTT_PORT) = "MQTTserver port (1-65535): ";


P(Form_cb) = "<input type=\"radio\" name=\"23\" value=\""; P(Form_cb) = "<input type=\"radio\" name=\"23\" value=\"";
P(Form_cb_checked) = " checked "; P(Form_cb_checked) = " checked ";
@@ -507,6 +514,16 @@ void setupNetHTML(WebServer &server, WebServer::ConnectionType type, char *url_t
if (param_number == 24) { if (param_number == 24) {
eeprom_config.dhcp_refresh_minutes=atoi(value); eeprom_config.dhcp_refresh_minutes=atoi(value);
} }
// read MQTT-SERVER
if (param_number >=25 && param_number <=28) {
eeprom_config.mqtt_server[param_number-25]=atoi(value);
}

// read MQTTServer port
if (param_number == 29) {
eeprom_config.mqttserverPort=atoi(value);
}

} }
} }
EEPROM_writeAnything(0, eeprom_config); EEPROM_writeAnything(0, eeprom_config);
@@ -644,6 +661,8 @@ void setupNetHTML(WebServer &server, WebServer::ConnectionType type, char *url_t
server.printP(table_td_end); server.printP(table_td_end);
server.printP(table_tr_end); server.printP(table_tr_end);


//print the current DHCP renew time //print the current DHCP renew time
server.printP(table_tr_start); server.printP(table_tr_start);
server.printP(table_td_start); server.printP(table_td_start);
@@ -659,6 +678,39 @@ void setupNetHTML(WebServer &server, WebServer::ConnectionType type, char *url_t
server.printP(table_td_end); server.printP(table_td_end);
server.printP(table_tr_end); server.printP(table_tr_end);



// print the current MQTT-SERVER
server.printP(table_tr_start);
server.printP(table_td_start);
server.printP(MQTT_SERVER);
server.printP(table_td_end);
server.printP(table_td_start);
for (int a=0;a<4;a++) {
server.printP(Form_input_text_start);
server.print(a+25);
server.printP(Form_input_value);
server.print(eeprom_config.mqtt_server[a]);
server.printP(Form_input_size3);
server.printP(Form_input_end);
}
server.printP(table_td_end);
server.printP(table_tr_end);


// print the current mqttserver port
server.printP(table_tr_start);
server.printP(table_td_start);
server.printP(MQTT_PORT);
server.printP(table_td_end);
server.printP(table_td_start);
server.printP(Form_input_text_start);
server.print(29);
server.printP(Form_input_value);
server.print(eeprom_config.mqttserverPort);
server.printP(Form_input_end);
server.printP(table_td_end);
server.printP(table_tr_end);

//print DHCP status //print DHCP status
if(eeprom_config.use_dhcp == 1) { if(eeprom_config.use_dhcp == 1) {
server.printP(table_tr_start); server.printP(table_tr_start);
@@ -769,6 +821,12 @@ void setup()


/* start the webserver */ /* start the webserver */
webserver->begin(); webserver->begin();


MQTTclient.setServer(eeprom_config.mqtt_server, eeprom_config.mqttserverPort);
//MQTTclient.setCallback(MQTTcallback);


} }


/** /**


+ 9
- 0
sensor.cpp View File

@@ -0,0 +1,9 @@
/*
* sensor.cpp
*
* Created on: 07.04.2020
* Author: agr
*/


#include "sensor.h"

+ 15
- 0
sensor.h View File

@@ -0,0 +1,15 @@
/*
* sensor.h
*
* Created on: 07.04.2020
* Author: agr
*/

#ifndef SENSOR_H_
#define SENSOR_H_





#endif /* SENSOR_H_ */

+ 9
- 0
struct.h View File

@@ -9,6 +9,10 @@
#define STRUCT_H_ #define STRUCT_H_





#include <PubSubClient.h>
#include <Ethernet.h>

struct config_t struct config_t
{ {
byte config_set; byte config_set;
@@ -20,6 +24,8 @@ struct config_t
byte subnet[4]; byte subnet[4];
byte dns_server[4]; byte dns_server[4];
unsigned int webserverPort; unsigned int webserverPort;
byte mqtt_server[4];
unsigned int mqttserverPort;
} eeprom_config; } eeprom_config;


int EEPROM_readAnything(int ee, config_t& value) int EEPROM_readAnything(int ee, config_t& value)
@@ -40,5 +46,8 @@ int EEPROM_readAnything(int ee, config_t& value)
return i; return i;
} }


EthernetClient MQTTethClient;
PubSubClient MQTTclient(MQTTethClient);



#endif /* STRUCT_H_ */ #endif /* STRUCT_H_ */

Loading…
Cancel
Save