OTA + nvs parameters bug fixes

This commit is contained in:
Sebastien
2019-10-15 21:01:22 -04:00
parent 47f24dbbfd
commit d4315f29ca
11 changed files with 591 additions and 134 deletions

454
.cproject
View File

@@ -3,9 +3,15 @@
<storageModule moduleId="org.eclipse.cdt.core.settings"> <storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.993609302"> <cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.993609302" moduleId="org.eclipse.cdt.core.settings" name="Default"> <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348" moduleId="org.eclipse.cdt.core.settings" name="Default">
<macros>
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="0"/>
</macros>
<externalSettings/> <externalSettings/>
@@ -29,31 +35,57 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> <storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" id="cdt.managedbuild.toolchain.gnu.cross.base.993609302" name="Default" parent="org.eclipse.cdt.build.core.emptycfg"> <configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348" name="Default" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.993609302.1530459227" name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.949515869" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1555647520" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base"> <toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1860816932" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.1576765099" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/> <option id="cdt.managedbuild.option.gnu.cross.prefix.211558150" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.1146973775" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/> <option id="cdt.managedbuild.option.gnu.cross.path.660444977" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1544552640" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1109615480" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder id="cdt.managedbuild.builder.gnu.cross.1315027012" managedBuildOn="false" name="Gnu Make Builder.Default" superClass="cdt.managedbuild.builder.gnu.cross"/> <builder arguments="-j8 EXTRA_CPPFLAGS=&quot;-DRECOVERY_APPLICATION=0&quot;" command="make" id="cdt.managedbuild.builder.gnu.cross.1247197310" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.94972701" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"/> <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.924305212" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.237333664" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.851339966" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1720457903" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"/> <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1689301712" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.1320841573" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1117032298" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.346221528" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/> <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.69706729" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.404007926" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"/> <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1919651858" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1241928244" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.64705117" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/> <tool id="cdt.managedbuild.tool.gnu.cross.archiver.1543827445" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1896438563" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler"/> <tool id="cdt.managedbuild.tool.gnu.cross.assembler.1248561272" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.736707865" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain> </toolChain>
@@ -66,6 +98,390 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration> </cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934" moduleId="org.eclipse.cdt.core.settings" name="recovery">
<macros>
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="1"/>
</macros>
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934" name="recovery" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1561608239" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.878380733" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.576225618" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1674304340" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder arguments="-j8 EXTRA_CPPFLAGS=&quot;-DRECOVERY_APPLICATION=1&quot;" command="make" id="cdt.managedbuild.builder.gnu.cross.1616827916" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.1168574489" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.24917724" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.40066190" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.1538103313" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.773825889" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.750042642" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.791695355" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.363611836" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.788163154" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.747849588" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.597864277" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291" moduleId="org.eclipse.cdt.core.settings" name="recovery_windows">
<macros>
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="1"/>
</macros>
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="Building recovery in windows" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291" name="recovery_windows" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.845245133" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.1090509495" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.447265559" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1831977109" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder arguments="&quot;C:/msys32/opt/esp-idf/tools/windows/eclipse_make.py&quot; -j8 EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=1 -DSQUEEZELITE_ESP32_RELEASE_URL=\&quot;https://github.com/sle118/squeezelite-esp32/releases\&quot; '" command="python" id="cdt.managedbuild.builder.gnu.cross.1069921467" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1302011176" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.623798750" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.539301587" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1722031516" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.2010227748" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2073997022" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.746651743" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.149944553" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1372009292" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.649046248" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.2132030687" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1779870241" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736" moduleId="org.eclipse.cdt.core.settings" name="squeezelite_windows">
<macros>
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="0"/>
</macros>
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="building squeezelite app in windows" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736" name="squeezelite_windows" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1034176750" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.1038632104" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.1589817380" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.784380822" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder arguments="&quot;C:/msys32/opt/esp-idf/tools/windows/eclipse_make.py&quot; -j8 EXTRA_CPPFLAGS=&quot;-DRECOVERY_APPLICATION=0&quot;" command="python" id="cdt.managedbuild.builder.gnu.cross.1150681639" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.824219909" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.217201640" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.644208200" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1907231332" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.959275134" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.604467026" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1073903870" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.898376794" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1560070168" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1462690215" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.40469999" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.798539361" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="squeezelite-esp32-merge.null.1711307563" name="squeezelite-esp32-merge"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="squeezelite_windows">
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32-merge"/>
</configuration>
<configuration configurationName="recovery_windows">
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
</configuration>
<configuration configurationName="recovery">
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
</configuration>
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="app" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"</buildArguments>
<buildTarget>app</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule> </storageModule>
@@ -122,13 +538,5 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
</storageModule> </storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="squeezelite-esp32.null.1967044667" name="squeezelite-esp32"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject> </cproject>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project> <project>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.993609302" name="Default"> <configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
@@ -11,7 +11,79 @@
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1436848517107" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="66711578333" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934" name="recovery">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="66711578333" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291" name="recovery_windows">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1733991311150261732" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736" name="squeezelite_windows">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1733991311150261732" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>

View File

@@ -314,32 +314,17 @@ void ota_task(void *pvParameter)
} }
esp_err_t process_recovery_ota(const char * bin_url){ esp_err_t process_recovery_ota(const char * bin_url){
int ret = 0;
// Initialize NVS.
int ret=0;
esp_err_t err = nvs_flash_init();
if(ota_status.bOTAThreadStarted){ if(ota_status.bOTAThreadStarted){
ESP_LOGE(TAG,"OTA Already started. "); ESP_LOGE(TAG,"OTA Already started. ");
return ESP_FAIL; return ESP_FAIL;
} }
memset(&ota_status, 0x00, sizeof(ota_status)); memset(&ota_status, 0x00, sizeof(ota_status));
ota_status.bOTAThreadStarted=true; ota_status.bOTAThreadStarted=true;
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
// todo: If we ever change the size of the nvs partition, we need to figure out a mechanism to enlarge the nvs.
// 1.OTA app partition table has a smaller NVS partition size than the non-OTA
// partition table. This size mismatch may cause NVS initialization to fail.
// 2.NVS partition contains data in new format and cannot be recognized by this version of code.
// If this happens, we erase NVS partition and initialize NVS again.
ESP_LOGW(TAG,"NVS flash size has changed. Formatting nvs");
ESP_ERROR_CHECK(nvs_flash_erase());
err = nvs_flash_init();
}
ESP_ERROR_CHECK(err);
char * urlPtr=strdup(bin_url); char * urlPtr=strdup(bin_url);
// the first thing we need to do here is to erase the firmware url // the first thing we need to do here is to erase the firmware url
// to avoid a boot loop // to avoid a boot loop
#ifdef CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 #ifdef CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1
#define OTA_CORE 0 #define OTA_CORE 0
#warning "OTA will run on core 0" #warning "OTA will run on core 0"
@@ -348,13 +333,11 @@ esp_err_t process_recovery_ota(const char * bin_url){
#define OTA_CORE 1 #define OTA_CORE 1
#endif #endif
ESP_LOGI(TAG, "Starting ota on core %u for : %s", OTA_CORE,urlPtr); ESP_LOGI(TAG, "Starting ota on core %u for : %s", OTA_CORE,urlPtr);
ret=xTaskCreatePinnedToCore(&ota_task, "ota_task", 1024*20, (void *)urlPtr, ESP_TASK_MAIN_PRIO+1, NULL, OTA_CORE); ret=xTaskCreatePinnedToCore(&ota_task, "ota_task", 1024*20, (void *)urlPtr, ESP_TASK_MAIN_PRIO+1, NULL, OTA_CORE);
if (ret != pdPASS) { if (ret != pdPASS) {
ESP_LOGI(TAG, "create thread %s failed", "ota_task"); ESP_LOGI(TAG, "create thread %s failed", "ota_task");
return ESP_FAIL; return ESP_FAIL;
} }
return ESP_OK; return ESP_OK;
} }

View File

@@ -162,10 +162,12 @@ $(document).ready(function(){
$.ajax({ $.ajax({
url: '/connect.json', url: '/connect.json',
dataType: 'json', dataType: 'text',
method: 'DELETE', method: 'DELETE',
cache: false, cache: false,
data: { 'timestamp': Date.now()} contentType: 'application/json; charset=utf-8',
data: JSON.stringify({ 'timestamp': Date.now()})
}); });
startCheckStatusInterval(); startCheckStatusInterval();
@@ -181,11 +183,12 @@ $(document).ready(function(){
showMessage('please wait for the ESP32 to reboot', 'WARNING'); showMessage('please wait for the ESP32 to reboot', 'WARNING');
$.ajax({ $.ajax({
url: '/config.json', url: '/config.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
headers: { "X-Custom-autoexec": autoexec }, headers: { "X-Custom-autoexec": autoexec },
data: data, contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);
console.log(thrownError); console.log(thrownError);
@@ -196,10 +199,11 @@ $(document).ready(function(){
console.log('now triggering reboot'); console.log('now triggering reboot');
$.ajax({ $.ajax({
url: '/reboot.json', url: '/reboot.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
data: { 'timestamp': Date.now()}, contentType: 'application/json; charset=utf-8',
data: JSON.stringify({ 'timestamp': Date.now()}),
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);
console.log(thrownError); console.log(thrownError);
@@ -215,11 +219,12 @@ $(document).ready(function(){
$.ajax({ $.ajax({
url: '/config.json', url: '/config.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
headers: { "X-Custom-autoexec1": autoexec1 }, headers: { "X-Custom-autoexec1": autoexec1 },
data: data, contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);
console.log(thrownError); console.log(thrownError);
@@ -227,6 +232,7 @@ $(document).ready(function(){
} }
}); });
console.log('sent config JSON with headers:', autoexec1); console.log('sent config JSON with headers:', autoexec1);
console.log('sent data:', JSON.stringify(data));
}); });
$("input#save-gpio").on("click", function() { $("input#save-gpio").on("click", function() {
@@ -242,11 +248,12 @@ $(document).ready(function(){
}); });
$.ajax({ $.ajax({
url: '/config.json', url: '/config.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
headers: headers, headers: headers,
data: data, contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);
console.log(thrownError); console.log(thrownError);
@@ -254,6 +261,7 @@ $(document).ready(function(){
} }
}); });
console.log('sent config JSON with headers:', JSON.stringify(headers)); console.log('sent config JSON with headers:', JSON.stringify(headers));
console.log('sent config JSON with data:', JSON.stringify(data));
}); });
$("#save-nvs").on("click", function() { $("#save-nvs").on("click", function() {
@@ -275,11 +283,12 @@ $(document).ready(function(){
} }
$.ajax({ $.ajax({
url: '/config.json', url: '/config.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
headers: headers, headers: headers,
data: data, contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);
console.log(thrownError); console.log(thrownError);
@@ -287,6 +296,7 @@ $(document).ready(function(){
} }
}); });
console.log('sent config JSON with headers:', JSON.stringify(headers)); console.log('sent config JSON with headers:', JSON.stringify(headers));
console.log('sent config JSON with data:', JSON.stringify(data));
}); });
$("#flash").on("click", function() { $("#flash").on("click", function() {
@@ -297,11 +307,12 @@ $(document).ready(function(){
data['fwurl'] = url; data['fwurl'] = url;
$.ajax({ $.ajax({
url: '/config.json', url: '/config.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
headers: { "X-Custom-fwurl": url }, headers: { "X-Custom-fwurl": url },
data: data, contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);
console.log(thrownError); console.log(thrownError);
@@ -463,10 +474,11 @@ function performConnect(conntype){
$.ajax({ $.ajax({
url: '/connect.json', url: '/connect.json',
dataType: 'json', dataType: 'text',
method: 'POST', method: 'POST',
cache: false, cache: false,
headers: { 'X-Custom-ssid': selectedSSID, 'X-Custom-pwd': pwd, 'X-Custom-host_name': dhcpname }, headers: { 'X-Custom-ssid': selectedSSID, 'X-Custom-pwd': pwd, 'X-Custom-host_name': dhcpname },
contentType: 'application/json; charset=utf-8',
data: { 'timestamp': Date.now()}, data: { 'timestamp': Date.now()},
error: function (xhr, ajaxOptions, thrownError) { error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status); console.log(xhr.status);

View File

@@ -75,13 +75,13 @@ extern const uint8_t index_html_end[] asm("_binary_index_html_end");
/* const http headers stored in ROM */ /* const http headers stored in ROM */
const static char http_hdr_template[] = "HTTP/1.1 200 OK\nContent-type: %s\nAccept-Ranges: bytes\nContent-Length: %d\nContent-Encoding: %s\nAccess-Control-Allow-Origin: *\n\n"; const static char http_hdr_template[] = "HTTP/1.1 200 OK\nContent-type: %s\nAccept-Ranges: bytes\nContent-Length: %d\nContent-Encoding: %s\nAccess-Control-Allow-Origin: *\n\n";
const static char http_html_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/html\nAccess-Control-Allow-Origin: *\n\n"; const static char http_html_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/html\nAccess-Control-Allow-Origin: *\nAccept-Encoding: identity\n\n";
const static char http_css_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/css\nCache-Control: public, max-age=31536000\nAccess-Control-Allow-Origin: *\n\n"; const static char http_css_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/css\nCache-Control: public, max-age=31536000\nAccess-Control-Allow-Origin: *\n\n";
const static char http_js_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/javascript\nAccess-Control-Allow-Origin: *\n\n"; const static char http_js_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/javascript\nAccess-Control-Allow-Origin: *\n\n";
const static char http_400_hdr[] = "HTTP/1.1 400 Bad Request\nContent-Length: 0\n\n"; const static char http_400_hdr[] = "HTTP/1.1 400 Bad Request\nContent-Length: 0\n\n";
const static char http_404_hdr[] = "HTTP/1.1 404 Not Found\nContent-Length: 0\n\n"; const static char http_404_hdr[] = "HTTP/1.1 404 Not Found\nContent-Length: 0\n\n";
const static char http_503_hdr[] = "HTTP/1.1 503 Service Unavailable\nContent-Length: 0\n\n"; const static char http_503_hdr[] = "HTTP/1.1 503 Service Unavailable\nContent-Length: 0\n\n";
const static char http_ok_json_no_cache_hdr[] = "HTTP/1.1 200 OK\nContent-type: application/json\nCache-Control: no-store, no-cache, must-revalidate, max-age=0\nPragma: no-cache\nAccess-Control-Allow-Origin: *\n\n"; const static char http_ok_json_no_cache_hdr[] = "HTTP/1.1 200 OK\nContent-type: application/json\nCache-Control: no-store, no-cache, must-revalidate, max-age=0\nPragma: no-cache\nAccess-Control-Allow-Origin: *\nAccept-Encoding: identity\n\n";
const static char http_redirect_hdr_start[] = "HTTP/1.1 302 Found\nLocation: http://"; const static char http_redirect_hdr_start[] = "HTTP/1.1 302 Found\nLocation: http://";
const static char http_redirect_hdr_end[] = "/\n\n"; const static char http_redirect_hdr_end[] = "/\n\n";
@@ -119,7 +119,7 @@ void http_server(void *pvParameters) {
netconn_close(conn); netconn_close(conn);
netconn_delete(conn); netconn_delete(conn);
vSemaphoreDelete(http_server_config_mutex); vSemaphoreDelete(http_server_config_mutex);
wifi_manager_json_mutex = NULL; http_server_config_mutex = NULL;
vTaskDelete( NULL ); vTaskDelete( NULL );
} }
@@ -213,12 +213,12 @@ void http_server_send_resource_file(struct netconn *conn,const uint8_t * start,
} }
} }
err_t http_server_nvs_dump(struct netconn *conn, nvs_type_t nvs_type, bool * bFirst){ err_t http_server_nvs_dump(struct netconn *conn, nvs_type_t nvs_type){
nvs_entry_info_t info; nvs_entry_info_t info;
char * num_buffer = NULL; char * num_buffer = NULL;
cJSON * nvs_json = cJSON_CreateObject(); cJSON * nvs_json = cJSON_CreateObject();
num_buffer = malloc(NUM_BUFFER_LEN); num_buffer = malloc(NUM_BUFFER_LEN);
nvs_iterator_t it = nvs_entry_find(NVS_PARTITION_NAME, NULL, nvs_type); nvs_iterator_t it = nvs_entry_find(settings_partition, NULL, nvs_type);
if (it == NULL) { if (it == NULL) {
ESP_LOGW(TAG, "No nvs entry found in %s",NVS_PARTITION_NAME ); ESP_LOGW(TAG, "No nvs entry found in %s",NVS_PARTITION_NAME );
} }
@@ -277,7 +277,7 @@ err_t http_server_nvs_dump(struct netconn *conn, nvs_type_t nvs_type, bool * bFi
return ESP_OK; return ESP_OK;
} }
void http_server_process_config(struct netconn *conn, struct netbuf *inbuf){ void http_server_process_config(struct netconn *conn, char *inbuf){
// Here, we are passed a buffer which contains the http request // Here, we are passed a buffer which contains the http request
@@ -289,7 +289,7 @@ void http_server_process_config(struct netconn *conn, struct netbuf *inbuf){
// char *save_ptr = buf; // char *save_ptr = buf;
// char *line = strtok_r(save_ptr, new_line, &save_ptr); // char *line = strtok_r(save_ptr, new_line, &save_ptr);
// ESP_LOGD(TAG,"Processing line %s",line); // ESP_LOGD(TAG,"Processing line %s",line);
ESP_LOGD(TAG,"Processing request buffer: \n%s",inbuf);
char *last = NULL; char *last = NULL;
char *ptr = NULL; char *ptr = NULL;
last = ptr = inbuf; last = ptr = inbuf;
@@ -301,12 +301,19 @@ void http_server_process_config(struct netconn *conn, struct netbuf *inbuf){
ptr++; ptr++;
} }
// terminate the header string // terminate the header string
if( *(ptr) == '\0' ) {
ESP_LOGD(TAG, "End of buffer found");
return;
}
*ptr = '\0'; *ptr = '\0';
if( *ptr+1 == '\n' ) { if( *(ptr+1) == '\n' ) {
*ptr+1='\0'; *(ptr+1)='\0';
ptr+=2; ptr+=2;
} }
if(ptr==last) break; if(ptr==last) {
ESP_LOGD(TAG,"Processing body. ");
break;
}
if(strlen(last)>0){ if(strlen(last)>0){
ESP_LOGD(TAG,"Found Header Line %s ", last); ESP_LOGD(TAG,"Found Header Line %s ", last);
//Content-Type: application/json //Content-Type: application/json
@@ -318,9 +325,12 @@ void http_server_process_config(struct netconn *conn, struct netbuf *inbuf){
last=ptr; last=ptr;
} }
else { else {
ESP_LOGD(TAG,"Body content: %s", last); //ESP_LOGD(TAG,"Body content: %s", last);
cJSON * json = cJSON_Parse(last); //cJSON * json = cJSON_Parse(last);
cJSON_Delete(json); //cJSON_Delete(json);
//todo: implement body json parsing
// right now, body is coming as compressed, so we need some type of decompression to happen.
return;
} }
} }
return ; return ;
@@ -345,7 +355,7 @@ void http_server_netconn_serve(struct netconn *conn) {
/* extract the first line of the request */ /* extract the first line of the request */
char *save_ptr = buf; char *save_ptr = buf;
char *line = strtok_r(save_ptr, new_line, &save_ptr); char *line = strtok_r(save_ptr, new_line, &save_ptr);
ESP_LOGD(TAG,"Processing line %s",line); ESP_LOGD(TAG,"http_server_netconn_serve Processing line %s, socket: %u",line, conn->socket);
if(line) { if(line) {
@@ -401,7 +411,7 @@ void http_server_netconn_serve(struct netconn *conn) {
//dynamic stuff //dynamic stuff
else if(strstr(line, "GET /ap.json ")) { else if(strstr(line, "GET /ap.json ")) {
/* if we can get the mutex, write the last version of the AP list */ /* if we can get the mutex, write the last version of the AP list */
ESP_LOGI(TAG,"Processing ap.json request"); ESP_LOGI(TAG,"Processing ap.json request for socket %u",conn->socket);
if(wifi_manager_lock_json_buffer(( TickType_t ) 10)){ if(wifi_manager_lock_json_buffer(( TickType_t ) 10)){
netconn_write(conn, http_ok_json_no_cache_hdr, sizeof(http_ok_json_no_cache_hdr) - 1, NETCONN_NOCOPY); netconn_write(conn, http_ok_json_no_cache_hdr, sizeof(http_ok_json_no_cache_hdr) - 1, NETCONN_NOCOPY);
char *buff = wifi_manager_get_ap_list_json(); char *buff = wifi_manager_get_ap_list_json();
@@ -415,15 +425,16 @@ void http_server_netconn_serve(struct netconn *conn) {
/* request a wifi scan */ /* request a wifi scan */
ESP_LOGI(TAG,"Starting wifi scan"); ESP_LOGI(TAG,"Starting wifi scan");
wifi_manager_scan_async(); wifi_manager_scan_async();
ESP_LOGI(TAG,"Done serving ap.json for socket %u",conn->socket);
} }
else if(strstr(line, "GET /config.json ")){ else if(strstr(line, "GET /config.json ")){
ESP_LOGI(TAG,"Serving config.json"); ESP_LOGI(TAG,"Serving config.json for socket %u",conn->socket);
ESP_LOGI(TAG, "About to get config from flash"); ESP_LOGI(TAG, "About to get config from flash");
http_server_nvs_dump(conn,NVS_TYPE_STR); http_server_nvs_dump(conn,NVS_TYPE_STR);
ESP_LOGD(TAG,"Done serving config.json"); ESP_LOGD(TAG,"Done serving config.json for socket %u",conn->socket);
} }
else if(strstr(line, "POST /config.json ")){ else if(strstr(line, "POST /config.json ")){
ESP_LOGI(TAG,"Serving POST config.json"); ESP_LOGI(TAG,"Serving POST config.json for socket %u",conn->socket);
int lenA=0; int lenA=0;
char * last_parm=save_ptr; char * last_parm=save_ptr;
@@ -435,7 +446,8 @@ void http_server_netconn_serve(struct netconn *conn) {
// make sure we terminate the netconn string // make sure we terminate the netconn string
save_ptr[buflen-1]='\0'; save_ptr[buflen-1]='\0';
http_server_process_config(conn); // todo: implement json body parsing
//http_server_process_config(conn,save_ptr);
while(last_parm!=NULL){ while(last_parm!=NULL){
// Search will return // Search will return
@@ -471,10 +483,11 @@ void http_server_netconn_serve(struct netconn *conn) {
free(otaURL); free(otaURL);
} }
} }
ESP_LOGI(TAG,"Done Serving POST config.json for socket %u",conn->socket);
} }
else if(strstr(line, "POST /connect.json ")) { else if(strstr(line, "POST /connect.json ")) {
ESP_LOGI(TAG, "http_server_netconn_serve: POST /connect.json"); ESP_LOGI(TAG, "http_server_netconn_serve: POST /connect.json for socket %u",conn->socket);
bool found = false; bool found = false;
int lenS = 0, lenP = 0; int lenS = 0, lenP = 0;
char *ssid = NULL, *password = NULL; char *ssid = NULL, *password = NULL;
@@ -498,21 +511,27 @@ void http_server_netconn_serve(struct netconn *conn) {
ESP_LOGE(TAG, "bad request the authentification header is not complete/not the correct format"); ESP_LOGE(TAG, "bad request the authentification header is not complete/not the correct format");
} }
ESP_LOGI(TAG, "http_server_netconn_serve: done serving connect.json for socket %u",conn->socket);
} }
else if(strstr(line, "DELETE /connect.json ")) { else if(strstr(line, "DELETE /connect.json ")) {
ESP_LOGI(TAG, "http_server_netconn_serve: DELETE /connect.json"); ESP_LOGI(TAG, "http_server_netconn_serve: DELETE /connect.json for socket %u",conn->socket);
/* request a disconnection from wifi and forget about it */ /* request a disconnection from wifi and forget about it */
wifi_manager_disconnect_async(); wifi_manager_disconnect_async();
netconn_write(conn, http_ok_json_no_cache_hdr, sizeof(http_ok_json_no_cache_hdr) - 1, NETCONN_NOCOPY); /* 200 ok */ netconn_write(conn, http_ok_json_no_cache_hdr, sizeof(http_ok_json_no_cache_hdr) - 1, NETCONN_NOCOPY); /* 200 ok */
ESP_LOGI(TAG, "http_server_netconn_serve: done serving DELETE /connect.json for socket %u",conn->socket);
} }
else if(strstr(line, "POST /reboot.json ")){ else if(strstr(line, "POST /reboot.json ")){
ESP_LOGI(TAG, "http_server_netconn_serve: POST reboot.json for socket %u",conn->socket);
guided_restart_ota(); guided_restart_ota();
ESP_LOGI(TAG, "http_server_netconn_serve: done serving POST reboot.json for socket %u",conn->socket);
} }
else if(strstr(line, "POST /recovery.json ")){ else if(strstr(line, "POST /recovery.json ")){
ESP_LOGI(TAG, "http_server_netconn_serve: POST recovery.json for socket %u",conn->socket);
guided_factory(); guided_factory();
ESP_LOGI(TAG, "http_server_netconn_serve: done serving POST recovery.json for socket %u",conn->socket);
} }
else if(strstr(line, "GET /status.json ")){ else if(strstr(line, "GET /status.json ")){
ESP_LOGI(TAG,"Serving status.json"); ESP_LOGI(TAG,"Serving status.json for socket %u",conn->socket);
if(wifi_manager_lock_json_buffer(( TickType_t ) 10)){ if(wifi_manager_lock_json_buffer(( TickType_t ) 10)){
char *buff = wifi_manager_get_ip_info_json(); char *buff = wifi_manager_get_ip_info_json();
if(buff){ if(buff){
@@ -528,15 +547,16 @@ void http_server_netconn_serve(struct netconn *conn) {
netconn_write(conn, http_503_hdr, sizeof(http_503_hdr) - 1, NETCONN_NOCOPY); netconn_write(conn, http_503_hdr, sizeof(http_503_hdr) - 1, NETCONN_NOCOPY);
ESP_LOGE(TAG, "http_server_netconn_serve: GET /status failed to obtain mutex"); ESP_LOGE(TAG, "http_server_netconn_serve: GET /status failed to obtain mutex");
} }
ESP_LOGI(TAG,"Done Serving status.json for socket %u",conn->socket);
} }
else{ else{
netconn_write(conn, http_400_hdr, sizeof(http_400_hdr) - 1, NETCONN_NOCOPY); netconn_write(conn, http_400_hdr, sizeof(http_400_hdr) - 1, NETCONN_NOCOPY);
ESP_LOGE(TAG, "bad request"); ESP_LOGE(TAG, "bad request for socket %u",conn->socket);
} }
} }
} }
else{ else{
ESP_LOGE(TAG, "URL Not found. Sending 404."); ESP_LOGE(TAG, "URL Not found. Sending 404. for socket %u",conn->socket);
netconn_write(conn, http_404_hdr, sizeof(http_404_hdr) - 1, NETCONN_NOCOPY); netconn_write(conn, http_404_hdr, sizeof(http_404_hdr) - 1, NETCONN_NOCOPY);
} }
} }
@@ -563,7 +583,7 @@ bool http_server_lock_json_object(TickType_t xTicksToWait){
} }
void http_server__unlock_json_object(){ void http_server_unlock_json_object(){
ESP_LOGD(TAG,"Unlocking json buffer!"); ESP_LOGD(TAG,"Unlocking json buffer!");
xSemaphoreGive( http_server_config_mutex ); xSemaphoreGive( http_server_config_mutex );
} }

View File

@@ -92,7 +92,7 @@ void CODE_RAM_LOCATION strreplace(char *src, char *str, char *rep);
/* @brief lock the json config object */ /* @brief lock the json config object */
bool http_server_lock_json_object(TickType_t xTicksToWait); bool http_server_lock_json_object(TickType_t xTicksToWait);
/* @brief unlock the json config object */ /* @brief unlock the json config object */
void http_server__unlock_json_object() void http_server_unlock_json_object();
#define PROTECTED_JSON_CALL(a) if(http_server_lock_json_object( portMAX_DELAY )){ \ a; http_server_unlocklock_json_object(); } else{ ESP_LOGE(TAG, "could not get access to json mutex in wifi_scan"); } #define PROTECTED_JSON_CALL(a) if(http_server_lock_json_object( portMAX_DELAY )){ \ a; http_server_unlocklock_json_object(); } else{ ESP_LOGE(TAG, "could not get access to json mutex in wifi_scan"); }

View File

@@ -164,8 +164,6 @@ void wifi_manager_start(){
/* disable the default wifi logging */ /* disable the default wifi logging */
esp_log_level_set("wifi", ESP_LOG_NONE); esp_log_level_set("wifi", ESP_LOG_NONE);
/* initialize flash memory */
nvs_flash_init();
/* memory allocation */ /* memory allocation */
wifi_manager_queue = xQueueCreate( 3, sizeof( queue_message) ); wifi_manager_queue = xQueueCreate( 3, sizeof( queue_message) );

View File

@@ -89,14 +89,6 @@ void process_autoexec(){
} }
} }
static void initialize_nvs() {
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
err = nvs_flash_init();
}
ESP_ERROR_CHECK(err);
}
void initialize_console() { void initialize_console() {
@@ -151,8 +143,7 @@ void initialize_console() {
} }
void console_start() { void console_start() {
initialize_nvs();
//initialize_filesystem();
initialize_console(); initialize_console();
/* Register commands */ /* Register commands */

View File

@@ -101,6 +101,14 @@ static void initialize_nvs() {
err = nvs_flash_init(); err = nvs_flash_init();
} }
ESP_ERROR_CHECK(err); ESP_ERROR_CHECK(err);
err = nvs_flash_init_partition(settings_partition);
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase_partition(settings_partition));
err = nvs_flash_init_partition(settings_partition);
}
ESP_ERROR_CHECK(err);
} }
char * process_ota_url(){ char * process_ota_url(){
nvs_handle nvs; nvs_handle nvs;

View File

@@ -18,40 +18,6 @@ const char current_namespace[] = "config";
const char settings_partition[] = "settings"; const char settings_partition[] = "settings";
static const char * TAG = "platform_esp32"; static const char * TAG = "platform_esp32";
bool isNameValid(char * key){
bool bFound=false;
nvs_handle nvs;
esp_err_t err;
int8_t val=0;
err = nvs_open(current_namespace, NVS_READONLY, &nvs);
if (err != ESP_OK) {
ESP_LOGE(TAG,"Error opening nvs storage for namespace %s",current_namespace);
return false;
}
err = nvs_get_i8(nvs, key, &val);
if(err==ESP_OK || err== ESP_ERR_NVS_INVALID_LENGTH){
bFound=true;
}
else {
ESP_LOGD(TAG,"Search for key %s in namespace %s returned %#08X",key,current_namespace,err);
}
// nvs_iterator_t it = nvs_entry_find(NVS_DEFAULT_PART_NAME, current_namespace, NVS_TYPE_ANY);
// while (it != NULL) {
// nvs_entry_info_t info;
// nvs_entry_info(it, &info);
// it = nvs_entry_next(it);
// if(!strcmp(info.key,key)){
// bFound=true;
// }
// printf("key '%s', type '%d' \n", info.key, info.type);
// };
// // Note: no need to release iterator obtained from nvs_entry_find function when
// // nvs_entry_find or nvs_entry_next function return NULL, indicating no other
// // element for specified criteria was found.
nvs_close(nvs);
return bFound;
}
esp_err_t store_nvs_value(nvs_type_t type, const char *key, void * data) { esp_err_t store_nvs_value(nvs_type_t type, const char *key, void * data) {
if (type == NVS_TYPE_BLOB) if (type == NVS_TYPE_BLOB)
return ESP_ERR_NVS_TYPE_MISMATCH; return ESP_ERR_NVS_TYPE_MISMATCH;
@@ -66,7 +32,7 @@ esp_err_t store_nvs_value_len(nvs_type_t type, const char *key, void * data,
return ESP_ERR_NVS_TYPE_MISMATCH; return ESP_ERR_NVS_TYPE_MISMATCH;
} }
err = nvs_open(current_namespace, NVS_READWRITE, &nvs); err = nvs_open_from_partition(settings_partition, current_namespace, NVS_READWRITE, &nvs);
if (err != ESP_OK) { if (err != ESP_OK) {
return err; return err;
} }
@@ -133,7 +99,7 @@ void * get_nvs_value_alloc(nvs_type_t type, const char *key) {
esp_err_t err; esp_err_t err;
void * value=NULL; void * value=NULL;
err = nvs_open(current_namespace, NVS_READONLY, &nvs); err = nvs_open_from_partition(settings_partition, current_namespace, NVS_READONLY, &nvs);
if (err != ESP_OK) { if (err != ESP_OK) {
ESP_LOGE(TAG,"Could not open the nvs storage."); ESP_LOGE(TAG,"Could not open the nvs storage.");
return NULL; return NULL;
@@ -191,7 +157,7 @@ esp_err_t get_nvs_value(nvs_type_t type, const char *key, void*value, const uint
nvs_handle nvs; nvs_handle nvs;
esp_err_t err; esp_err_t err;
err = nvs_open(current_namespace, NVS_READONLY, &nvs); err = nvs_open_from_partition(settings_partition, current_namespace, NVS_READONLY, &nvs);
if (err != ESP_OK) { if (err != ESP_OK) {
return err; return err;
} }

View File

@@ -7,7 +7,6 @@ extern "C" {
#endif #endif
extern const char current_namespace[]; extern const char current_namespace[];
extern const char settings_partition[]; extern const char settings_partition[];
bool isNameValid(char * key);
esp_err_t store_nvs_value_len(nvs_type_t type, const char *key, void * data, size_t data_len); esp_err_t store_nvs_value_len(nvs_type_t type, const char *key, void * data, size_t data_len);
esp_err_t store_nvs_value(nvs_type_t type, const char *key, void * data); esp_err_t store_nvs_value(nvs_type_t type, const char *key, void * data);
esp_err_t get_nvs_value(nvs_type_t type, const char *key, void*value, const uint8_t buf_size); esp_err_t get_nvs_value(nvs_type_t type, const char *key, void*value, const uint8_t buf_size);