Code Monkey home page Code Monkey logo

esp8266-iot-framework's Introduction

ESP8266 IoT Framework Status PlatformIO Registry

Important

Archive notice

As of now (February 2024) this code is still functional and has reached a high level of maturity thanks to all your input in more than 100 closed issues and 50 pull requests. I have archived this repository due to a shift in priorities. Thanks for using this project, and keep building and making!

The ESP8266 IoT Framework is a set of modules to be used as a starting point in new ESP8266 projects, implementing HTTPS requests, a React web interface, WiFi manager, configuration manager, live dashboard and OTA updates.

The unique advantage of this framework is that code generation at build time is used to provide different benefits. Code generation is used to dynamically generate a configuration struct and a live dashboard from JSON files, to incorporate the web interface into PROGMEM in the firmware and to bundle a full root certificate store in PROGMEM that allows the ESP8266 to do secure HTTPS requests to arbitrary URLs.

Documentation

Details beyond the documentation can be found at maakbaas.com.

Quick start

If you are new to PlatformIO, start with the installation guide. Otherwise, simply start a new project for your ESP8266, and add the following line to your platformio.ini file:

lib_deps = ESP8266 IoT Framework

Take one of the examples as a starting point to develop your application.

Screenshots

Dashboard

  

  

Introduction

The framework consists of five main parts. A web server including the interface it's serving, a WiFi manager, a configuration manager and classes for HTTP requests and OTA updates. The architecture of the framework is shown in the following diagram:

Architecture Architecture of the framework shown in blue

The basic principles used in developing this framework are:

  1. The framework is built upon the ESP8266 Arduino libraries
  2. The framework does not include any functionality to control external hardware.
  3. The framework is fully self-contained for easy deployment. SPIFFS/LittleFS storage is not needed.
  4. There is a strict split between the ESP8266 application and the web interface through an API.

In short, the framework aims to be unobtrusive, easy to deploy, with a modern web interface that's easy to modify and expand for different projects :).

Note: The ESP32 is not supported by this framework right now, due to the reliance on BearSSL. BearSSL is part of the ESP8266 Arduino libraries, but not part of the ESP32 Arduino libraries. Also, many functionalities of this framework are supported by ESP-IDF for the ESP32. Therefore my recommendation would be to use ESP-IDF and I don't see enough added value in porting this framework. See also here: #142 (comment)

esp8266-iot-framework's People

Contributors

bmanifold avatar dependabot[bot] avatar etlamgit avatar factormystic avatar fernandogarcia avatar jarrodbell avatar loiiiic avatar maakbaas avatar marcolino7 avatar maxgerhardt avatar tssva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266-iot-framework's Issues

SSID "Generic ESP8266 Firmware" not showing

Hi!

I followed your instructions steps 1-10 with "timeSyncExample.cpp" as example code. Uploading code to esp8266 works great and without any issues.

On step 11 though, no WiFi with SSID of Generic ESP8266 Firmware is detected.

Serial monitor show:

Fatal exception (28):
epc1=0x4000228b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000b5, depc=0x00000000

over and over again.

What am I doing wrong?

Best regards.

Pre build script are not executed on 1.6.1

Hi,
I ugraded library on a working project, and seems that pre build script are not executed anymore, so the files config.h and config.c are not created with my custom parameter and got compilation errors.
Is there something I have to do in 1.6.1 ?

Marco

Thoughts on supporting ESP32?

Hello! @maakbaas, firstly thank you for creating and sharing this project.

Any thoughts on supporting ESP32?

Has anyone already done so? Am digging around to see if anyone has already, and trying to grasp what's involved. Am relatively new to ESPxx development.

Cheers!

Error building HTML

Hi,
very very good your framework.
I would minimal change HTML code, I know npm, React and webpack.

This is my platformio.ini:

[platformio]
default_envs = nodemcuv2
[common]
platform = https://github.com/platformio/platform-espressif8266.git
[env]
framework = arduino
build_flags = 
	-w ; supress all warnings
monitor_speed = 115200
upload_speed = 921600
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps = ESP Async WebServer, ArduinoJson
extra_scripts = scripts/preBuild.py
build_flags = -DREBUILD_HTML  forces a rebuild of the html.h, this is needed if you make modifications to the GUI, or the configuration or dashboard JSON files
#-DREBUILD_CERTS forces a rebuild of the root certificate store
#-DREBUILD_CONFIG forces a rebuild of the configuration manager cpp files based on the JSON
#-DREBUILD_DASHBOARD forces a rebuild of the dashboard cpp files based on the JSON
#-DDOMAIN_LIST=google.com,maakbaas.com comma separated list of domain names to limit the certificates included
#-DCONFIG_PATH=configuration.json defines a custom location for your JSON file
#-DDASHBOARD_PATH=dashboard.json defines a custom location for your JSON file

I have this build blocking error, but I don't know how to solve.

...
Compiling .pio\build\nodemcuv2\FrameworkArduino\umm_malloc\umm_poison.c.o
Archiving .pio\build\nodemcuv2\libFrameworkArduino.a
*** [.pio\build\nodemcuv2\firmware.elf] Implicit dependency `C:\users\claudio\.platformio\platforms\espressif8266\builder\forces' not found, needed by target `.pio\build\nodemcuv2\firmware.elf'.

Thank's for sharing your work.

Best regards,
Claudio

Difficulty starting up due to HTTPRequest::begin loop

Hi, I'm just getting started with this framework and have got it compiled, uploaded etc.

I noticed that while the captive portal loads if you navigate directly to the IP address, it wouldn't seem to connect to my wifi or run requests from the main loop. This lead me to adding some Serial.println's around the code, and I realized that the main setup function wasn't even being completed, and therefore the main loop wasn't getting started (and therefore nothing was fully working).

Eventually I realized that it's getting stuck in the while loop in fetch.cpp, here:

    time_t now = time(nullptr);
    while (now < 8 * 3600 * 2)
    {
        delay(500);
        now = time(nullptr);
    }

The initial now value is 2 and increments up from there, so that means the loop will wait basically need to wait about 16 hours before completing...!

I commented out the while loop and everything seems to then be working normally (main loop runs, http requests succeed, captive portal automatically detected, etc).

I'm wondering what the while loop is for? And is it intentional that it should take this long? Is there any harm in removing it?

Identifier is undefined

After whole day of using the code without problems Im facing issues with Platformio: IntelliSense Index Rebuild running again and again and again. And getting errors with Identifiers are undefined.
Webp net-gifmaker (3)

Executing task in folder Test_Project_Framework: C:\Users\shalk.platformio\penv\Scripts\pio.exe run <

Processing esp12e (platform: espressif8266; board: esp12e; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp12e.html
PLATFORM: Espressif 8266 (2.6.2) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 3.20704.0 (2.7.4)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.20800.0 (2.8.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft

[email protected] build C:\Users\shalk\Documents\PlatformIO\Projects\Test_Project_Framework.pio\libdeps\esp12e\ESP8266 IoT Framework
webpack --mode=production

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Hash: 110bdeef2c8bae2456ea
Version: webpack 4.42.1
Time: 10839ms
Built at: 16. 12. 2020 9:16:40
Asset Size Chunks Chunk Names
./index.html 452 KiB [emitted] [big]
./index.html.gz 118 KiB [emitted]
bundle.js 448 KiB 0 [emitted] [big] main
bundle.js.gz 117 KiB [emitted]
main.css 3.52 KiB 0, 0 [emitted] main, main
main.css.gz 1.01 KiB [emitted]
Entrypoint main [big] = main.css main.css bundle.js
[1] ./node_modules/preact/compat/dist/compat.module.js + 2 modules 19.2 KiB {0} [built]
| 3 modules
[3] ./gui/js/configuration.json 927 bytes {0} [built]
[8] ./gui/js/dashboard.json 2.1 KiB {0} [built]
[11] (webpack)/buildin/global.js 472 bytes {0} [built]
[28] ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js + 1 modules 4.41 KiB {0} [built]
| 2 modules
[70] ./gui/js/index.js + 343 modules 897 KiB {0} [built]
| ./gui/js/index.js 6.51 KiB [built]
| ./gui/js/comp/UiComponents.js 10 KiB [built]
| ./gui/js/comp/WifiPage.js 7.92 KiB [built]
| ./gui/js/functions/configHelpers.js 4.57 KiB [built]
| ./gui/js/comp/ConfigPage.js 1.96 KiB [built]
| ./gui/js/comp/DashboardPage.js 4.14 KiB [built]
| ./gui/js/comp/FilePage.js 393 bytes [built]
| ./gui/js/comp/FirmwarePage.js 7.62 KiB [built]
| ./gui/js/comp/DashboardItems.js 7.3 KiB [built]
| ./gui/js/comp/FileListing.js 8.48 KiB [built]
| ./gui/js/comp/ControlItem.js 5.52 KiB [built]
| ./gui/js/comp/DisplayItem.js 2.08 KiB [built]
| + 332 hidden modules
+ 403 hidden modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
bundle.js (448 KiB)
./index.html (452 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
main (452 KiB)
main.css
bundle.js

WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = ./index.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./gui/index.html 277 bytes {0} [built]
Child mini-css-extract-plugin ../ESP8266 IoT Framework\node_modules\css-loader\dist\cjs.js!../ESP8266 IoT Framework\node_modules\react-vis\dist\style.css:
Entrypoint mini-css-extract-plugin = *
2 modules
KeyError: 'value':
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\main.py", line 170:
env.SConscript("$BUILD_SCRIPT")
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\shalk.platformio\platforms\espressif8266\builder\main.py", line 238:
target_elf = env.BuildProgram()
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
return self.method(*nargs, **kwargs)
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 62:
env.ProcessProjectDeps()
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
return self.method(*nargs, **kwargs)
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 140:
project_lib_builder = env.ConfigureProjectLibBuilder()
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
return self.method(*nargs, **kwargs)
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 1062:
project.install_dependencies()
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 880:
if _is_builtin(spec):
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 872:
for lb in self.env.GetLibBuilders():
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
return self.method(*nargs, **kwargs)
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 993:
lb = LibBuilderFactory.new(env, lib_dir)
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 61:
obj = getattr(sys.modules[name], clsname)(env, path, verbose=verbose)
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 137:
self.process_extra_options()
File "C:\Users\shalk.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 282:
exports={"env": self.env, "pio_lib_builder": self},
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\shalk.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\shalk\Documents\PlatformIO\Projects\Test_Project_Framework.pio\libdeps\esp12e\ESP8266 IoT Framework\scripts\preBuild.py", line 45:
preBuildConfigFun()
File "C:\Users\shalk\Documents\PlatformIO\Projects\Test_Project_Framework.pio\libdeps\esp12e\ESP8266 IoT Framework\scripts\preBuildConfig.py", line 43:
cpp.write("\t" + str(item['value']).lower())
==================================================================== [FAILED] Took 24.60 seconds ====================================================================The terminal process "C:\Users\shalk.platformio\penv\Scripts\pio.exe 'run'" terminated with exit code: 1.

Firmware ugrade size

Hi maakbaas,
you say: "The firmware can be uploaded through the Browser to LittleFS and then flashed to the device."
How to upgrade our firmware if the current sketch size is over 90% ROM size ?

It fail miserably... We would implement a mode similar as TASMOTA upgrade. It download first a minimal fw from site to recovery space, install it, and then download finally the "fat" version with the latest version.

Can it will possible on the future ?

Thank's.

Claudio

Build errors

Hi,
this project seems interestings.

Cloned this repo, build on Windows 10PRO with VSCODE PlatformIO Core 5.0.3, I have this error on building.

Any suggestion ? Thanks

c:/users/claudio/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\nodemcuv2\libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x4): undefined reference to `setup'
c:/users/claudio/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\nodemcuv2\libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x8): undefined reference to `loop'
c:/users/claudio/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\nodemcuv2\libFrameworkArduino.a(core_esp8266_main.cpp.o): in function `loop_wrapper()':
core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x21): undefined reference to `setup'
c:/users/claudio/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x2d): undefined reference 
to `loop'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\nodemcuv2\firmware.elf] Error 1
========================================================================================== [FAILED] Took 41.15 seconds ==========================================================================================The terminal process "C:\Users\Claudio\.platformio\penv\Scripts\pio.exe 'run'" terminated with exit code: 1.

Error with -DREBUILD_CERTS

See error message below. Note that I have openssl (version 1.1.1.g 21 Apr 2020) installed and in the path. I installed the asn1crypto python library in order for preBuildCertificates.py to run . I'm using v1.3.0 of the ESP8266 IOT Framework. File ca_000.pem is being created in the build directory prior to the error.

Start building certificate store
For all domains
Added: AC Camerfirma, S.A.:AC Camerfirma SA CIF A82743287:http://www.chambersign.org
Traceback (most recent call last):
File "C:\Users\xxx\Documents\PlatformIO\Projects\yyy.pio\libdeps\d1_mini_pro\ESP8266 IoT Framework\build\preBuildCertificates.py", line 120, in
ssl = Popen([openssl,'x509','-inform','PEM','-outform','DER','-out', certName + '.der'], shell = False, stdin = PIPE)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Update certificates store

Hi Maakbaas,

I don't think if this is a bug of your code, but updating and reducing the certificates store, (to reduce size on RAM) I have this error:

Start building certificate store
Only for domains: google.com
Skipped: AC Camerfirma, S.A.:AC Camerfirma SA CIF A82743287:http://www.chambersign.org
Skipped: AC Camerfirma, S.A.:AC Camerfirma S.A.:
Skipped: AC Camerfirma, S.A.:AC Camerfirma SA CIF A82743287:http://www.chambersign.org
Skipped: AC Camerfirma, S.A.:AC Camerfirma S.A.:
Skipped: Actalis:Actalis S.p.A./03358520967:
Skipped: Amazon Trust Services:Amazon:
Skipped: Amazon Trust Services:Amazon:
Skipped: Amazon Trust Services:Amazon:
Skipped: Amazon Trust Services:Amazon:
Skipped: Amazon Trust Services:Starfield Technologies, Inc.:
Skipped: Asseco Data Systems S.A. (previously Unizeto Certum):Unizeto Sp. z o.o.:
Skipped: Asseco Data Systems S.A. (previously Unizeto Certum):Unizeto Technologies S.A.:Certum Certification Authority
Skipped: Asseco Data Systems S.A. (previously Unizeto Certum):Unizeto Technologies S.A.:Certum Certification Authority
Skipped: Atos:Atos:
Skipped: Autoridad de Certificacion Firmaprofesional::
Skipped: Buypass:Buypass AS-983163327:
Skipped: Buypass:Buypass AS-983163327:
Skipped: certSIGN:certSIGN:certSIGN ROOT CA
Skipped: certSIGN:CERTSIGN SA:certSIGN ROOT CA G2
Skipped: China Financial Certification Authority (CFCA):China Financial Certification Authority:
Skipped: Chunghwa Telecom:Chunghwa Telecom Co., Ltd.:ePKI Root Certification Authority
Skipped: Consorci Administraci Oberta de Catalunya (Consorci AOC, CATCert):Agencia Catalana de Certificacio (NIF Q-0801176-I):Serveis Publics de Certificacio, Vegeu https://www.catcert.net/verarrel (c)03, Jerarquia Entitats de Certificacio Catalanes
Skipped: Cybertrust Japan / JCSI:Japan Certification Services, Inc.:
Skipped: D-TRUST:D-Trust GmbH:
Skipped: D-TRUST:D-Trust GmbH:
Skipped: D-TRUST:D-Trust GmbH:
Skipped: Deutsche Telekom Security GmbH:T-Systems Enterprise Services GmbH:T-Systems Trust Center
Skipped: Deutsche Telekom Security GmbH:T-Systems Enterprise Services GmbH:T-Systems Trust Center
Skipped: Dhimyotis / Certigna:Dhimyotis:
Skipped: Dhimyotis / Certigna:Dhimyotis:0002 48146308100036
Skipped: DigiCert:Baltimore:CyberTrust
Skipped: DigiCert:Cybertrust, Inc:
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:DigiCert Inc:www.digicert.com
Skipped: DigiCert:GeoTrust Inc.:
Skipped: DigiCert:GeoTrust Inc.:
Skipped: DigiCert:GeoTrust Inc.:(c) 2007 GeoTrust Inc. - For authorized use only
Skipped: DigiCert:GeoTrust Inc.:(c) 2008 GeoTrust Inc. - For authorized use only
Skipped: DigiCert:GeoTrust Inc.:
Skipped: DigiCert:GeoTrust Inc.:
Skipped: DigiCert:Symantec Corporation:Symantec Trust Network
Skipped: DigiCert:Symantec Corporation:Symantec Trust Network
Skipped: DigiCert:thawte, Inc.:Certification Services Division, (c) 2006 thawte, Inc. - For authorized use only
Skipped: DigiCert:thawte, Inc.:(c) 2007 thawte, Inc. - For authorized use only
Skipped: DigiCert:thawte, Inc.:Certification Services Division, (c) 2008 thawte, Inc. - For authorized use only
Skipped: DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 1999 VeriSign, Inc. - For authorized use only
Skipped: DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 1999 VeriSign, Inc. - For authorized use only
Skipped: DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 2007 VeriSign, Inc. - For authorized use only
Skipped: DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 2006 VeriSign, Inc. - For authorized use only
Skipped: DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 2008 VeriSign, Inc. - For authorized use only
Skipped: Disig, a.s.:Disig a.s.:
Skipped: E-Tugra:E-Tura EBG Biliim Teknolojileri ve Hizmetleri A..:E-Tugra Sertifikasyon Merkezi
Skipped: eMudhra Technologies Limited:eMudhra Inc:emSign PKI
Skipped: eMudhra Technologies Limited:eMudhra Technologies Limited:emSign PKI
Skipped: eMudhra Technologies Limited:eMudhra Inc:emSign PKI
Skipped: eMudhra Technologies Limited:eMudhra Technologies Limited:emSign PKI
Skipped: Entrust:AffirmTrust:
Skipped: Entrust:AffirmTrust:
Skipped: Entrust:AffirmTrust:
Skipped: Entrust:AffirmTrust:
Skipped: Entrust:Entrust, Inc.:www.entrust.net/CPS is incorporated by reference, (c) 2006 Entrust, Inc.
Skipped: Entrust:Entrust, Inc.:See www.entrust.net/legal-terms, (c) 2012 Entrust, Inc. - for authorized use only
Skipped: Entrust:Entrust, Inc.:See www.entrust.net/legal-terms, (c) 2009 Entrust, Inc. - for authorized use only
Skipped: Entrust:Entrust, Inc.:See www.entrust.net/legal-terms, (c) 2015 Entrust, Inc. - for authorized use only
Skipped: Entrust:Entrust.net:www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), (c) 1999 Entrust.net Limited
Skipped: Global Digital Cybersecurity Authority Co., Ltd. (Formerly Guang Dong Certificate Authority (GDCA)):GUANG DONG CERTIFICATE AUTHORITY CO.,LTD.:
Skipped: GlobalSign nv-sa:GlobalSign:GlobalSign Root CA - R3
Skipped: GlobalSign nv-sa:GlobalSign:GlobalSign Root CA - R6
Skipped: GlobalSign nv-sa:GlobalSign:GlobalSign ECC Root CA - R5
Skipped: GlobalSign nv-sa:GlobalSign nv-sa:Root CA
Skipped: GoDaddy:The Go Daddy Group, Inc.:Go Daddy Class 2 Certification Authority
Skipped: GoDaddy:GoDaddy.com, Inc.:
Skipped: GoDaddy:Starfield Technologies, Inc.:Starfield Class 2 Certification Authority
Skipped: GoDaddy:Starfield Technologies, Inc.:
**Added: Google Trust Services LLC (GTS):GlobalSign:GlobalSign Root CA - R2
PermissionError: [WinError 5] Access is denied:
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 178:
    env.SConscript(item, exports="env")
  File "C:\Users\Claudio\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Claudio\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "D:\IOT PlatformIO\esp8266-iot-framework\scripts\preBuild.py", line 49:
    preBuildCertificatesFun(domains)
  File "D:\IOT PlatformIO\esp8266-iot-framework\scripts\preBuildCertificates.py", line 122:
    ssl = Popen([openssl,'x509','-inform','PEM','-outform','DER','-out', certName + '.der'], shell = False, stdin = PIPE)**
  File "C:\Users\Claudio\.platformio\python3\lib\subprocess.py", line 800:
    restore_signals, start_new_session)
  File "C:\Users\Claudio\.platformio\python3\lib\subprocess.py", line 1207:
    startupinfo)

DNS not saved?

I found that after a power cycle the set DNS (with static IP) is not saved in EEPROM. In WiFiManager there is no mention of dns in storeToEEPROM, but adding configManager.internal.dns = dns.v4(); does not solve my issue.
I added a line to configManager::begin to print the contents of the EEPROM to the console and that indeed shows the content of dns as '0'.
How to solve this?

preBuildCertificates.py error

Hi,

I am now starting to look at your solution to TLS (which I find interesting), but I ran into an issue right at the beginning.

When I run the script I get the following errors:

2037.09.30 -> ca_000.der
unable to load certificate
2038.07.31 -> ca_000.der
9340:error:0909006C:PEM routines:get_name:no start line:..\crypto\pem\pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
unable to load certificate
2037.09.30 -> ca_000.der
2636:error:0909006C:PEM routines:get_name:no start line:..\crypto\pem\pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
unable to load certificate
2038.07.31 -> ca_000.der
16864:error:0909006C:PEM routines:get_name:no start line:..\crypto\pem\pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
unable to load certificate
.
.
.

Also, the generated certificates.h file is "empty", as expected:

#ifndef CERT_H
#define CERT_H

#include <Arduino.h>

//2037.09.30 AC Camerfirma, S.A.:AC Camerfirma SA CIF A82743287:http://www.chambersign.org
//2038.07.31 AC Camerfirma, S.A.:AC Camerfirma S.A.:
//2037.09.30 AC Camerfirma, S.A.:AC Camerfirma SA CIF A82743287:http://www.chambersign.org
//2038.07.31 AC Camerfirma, S.A.:AC Camerfirma S.A.:
//2030.09.22 Actalis:Actalis S.p.A./03358520967:
//2038.01.17 Amazon Trust Services:Amazon:
//2040.05.26 Amazon Trust Services:Amazon:
//2040.05.26 Amazon Trust Services:Amazon:
//2040.05.26 Amazon Trust Services:Amazon:
//2037.12.31 Amazon Trust Services:Starfield Technologies, Inc.:
//2027.06.11 Asseco Data Systems S.A. (previously Unizeto Certum):Unizeto Sp. z o.o.:
//2029.12.31 Asseco Data Systems S.A. (previously Unizeto Certum):Unizeto Technologies S.A.:Certum Certification Authority
//2046.10.06 Asseco Data Systems S.A. (previously Unizeto Certum):Unizeto Technologies S.A.:Certum Certification Authority
//2030.12.31 Atos:Atos:
//2030.12.31 Autoridad de Certificacion Firmaprofesional::
//2040.10.26 Buypass:Buypass AS-983163327:
//2040.10.26 Buypass:Buypass AS-983163327:
//2031.07.04 certSIGN:certSIGN:certSIGN ROOT CA
//2042.02.06 certSIGN:CERTSIGN SA:certSIGN ROOT CA G2
//2029.12.31 China Financial Certification Authority (CFCA):China Financial Certification Authority:
//2034.12.20 Chunghwa Telecom:Chunghwa Telecom Co., Ltd.:ePKI Root Certification Authority
//2031.01.07 Consorci Administració Oberta de Catalunya (Consorci AOC, CATCert):Agencia Catalana de Certificacio (NIF Q-0801176-I):Serveis Publics de Certificacio, Vegeu https://www.catcert.net/verarrel (c)03, Jerarquia Entitats de Certificacio Catalanes
//2029.04.08 Cybertrust Japan / JCSI:Japan Certification Services, Inc.:
//2028.09.20 D-TRUST:D-Trust GmbH:
//2029.11.05 D-TRUST:D-Trust GmbH:
//2029.11.05 D-TRUST:D-Trust GmbH:
//2033.10.01 Deutsche Telekom Security GmbH:T-Systems Enterprise Services GmbH:T-Systems Trust Center
//2033.10.01 Deutsche Telekom Security GmbH:T-Systems Enterprise Services GmbH:T-Systems Trust Center
//2027.06.29 Dhimyotis / Certigna:Dhimyotis:
//2033.10.01 Dhimyotis / Certigna:Dhimyotis:0002 48146308100036
//2025.05.12 DigiCert:Baltimore:CyberTrust
//2021.12.15 DigiCert:Cybertrust, Inc:
//2031.11.10 DigiCert:DigiCert Inc:www.digicert.com
//2038.01.15 DigiCert:DigiCert Inc:www.digicert.com
//2038.01.15 DigiCert:DigiCert Inc:www.digicert.com
//2031.11.10 DigiCert:DigiCert Inc:www.digicert.com
//2038.01.15 DigiCert:DigiCert Inc:www.digicert.com
//2038.01.15 DigiCert:DigiCert Inc:www.digicert.com
//2031.11.10 DigiCert:DigiCert Inc:www.digicert.com
//2038.01.15 DigiCert:DigiCert Inc:www.digicert.com
//2022.05.21 DigiCert:GeoTrust Inc.:
//2036.07.16 DigiCert:GeoTrust Inc.:
//2038.01.18 DigiCert:GeoTrust Inc.:(c) 2007 GeoTrust Inc. - For authorized use only
//2037.12.01 DigiCert:GeoTrust Inc.:(c) 2008 GeoTrust Inc. - For authorized use only
//2029.03.04 DigiCert:GeoTrust Inc.:
//2029.03.04 DigiCert:GeoTrust Inc.:
//2037.12.01 DigiCert:Symantec Corporation:Symantec Trust Network
//2037.12.01 DigiCert:Symantec Corporation:Symantec Trust Network
//2036.07.16 DigiCert:thawte, Inc.:Certification Services Division, (c) 2006 thawte, Inc. - For authorized use only
//2038.01.18 DigiCert:thawte, Inc.:(c) 2007 thawte, Inc. - For authorized use only
//2037.12.01 DigiCert:thawte, Inc.:Certification Services Division, (c) 2008 thawte, Inc. - For authorized use only
//2036.07.16 DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 1999 VeriSign, Inc. - For authorized use only
//2036.07.16 DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 1999 VeriSign, Inc. - For authorized use only
//2038.01.18 DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 2007 VeriSign, Inc. - For authorized use only
//2036.07.16 DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 2006 VeriSign, Inc. - For authorized use only
//2037.12.01 DigiCert:VeriSign, Inc.:VeriSign Trust Network, (c) 2008 VeriSign, Inc. - For authorized use only
//2042.07.19 Disig, a.s.:Disig a.s.:
//2023.03.03 E-Tugra:E-Tuğra EBG Bilişim Teknolojileri ve Hizmetleri A.Ş.:E-Tugra Sertifikasyon Merkezi
//2043.02.18 eMudhra Technologies Limited:eMudhra Inc:emSign PKI
//2043.02.18 eMudhra Technologies Limited:eMudhra Technologies Limited:emSign PKI
//2043.02.18 eMudhra Technologies Limited:eMudhra Inc:emSign PKI
//2043.02.18 eMudhra Technologies Limited:eMudhra Technologies Limited:emSign PKI
//2030.12.31 Entrust:AffirmTrust:
//2030.12.31 Entrust:AffirmTrust:
//2040.12.31 Entrust:AffirmTrust:
//2040.12.31 Entrust:AffirmTrust:
//2026.11.27 Entrust:Entrust, Inc.:www.entrust.net/CPS is incorporated by reference, (c) 2006 Entrust, Inc.
//2037.12.18 Entrust:Entrust, Inc.:See www.entrust.net/legal-terms, (c) 2012 Entrust, Inc. - for authorized use only
//2030.12.07 Entrust:Entrust, Inc.:See www.entrust.net/legal-terms, (c) 2009 Entrust, Inc. - for authorized use only
//2037.12.27 Entrust:Entrust, Inc.:See www.entrust.net/legal-terms, (c) 2015 Entrust, Inc. - for authorized use only
//2029.07.24 Entrust:Entrust.net:www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), (c) 1999 Entrust.net Limited
//2040.12.31 Global Digital Cybersecurity Authority Co., Ltd. (Formerly Guang Dong Certificate Authority (GDCA)):GUANG DONG CERTIFICATE AUTHORITY CO.,LTD.:
//2029.03.18 GlobalSign nv-sa:GlobalSign:GlobalSign Root CA - R3
//2034.12.10 GlobalSign nv-sa:GlobalSign:GlobalSign Root CA - R6
//2038.01.19 GlobalSign nv-sa:GlobalSign:GlobalSign ECC Root CA - R5
//2028.01.28 GlobalSign nv-sa:GlobalSign nv-sa:Root CA
//2034.06.29 GoDaddy:The Go Daddy Group, Inc.:Go Daddy Class 2 Certification Authority
//2037.12.31 GoDaddy:GoDaddy.com, Inc.:
//2034.06.29 GoDaddy:Starfield Technologies, Inc.:Starfield Class 2 Certification Authority
//2037.12.31 GoDaddy:Starfield Technologies, Inc.:
//2021.12.15 Google Trust Services LLC (GTS):GlobalSign:GlobalSign Root CA - R2
//2038.01.19 Google Trust Services LLC (GTS):GlobalSign:GlobalSign ECC Root CA - R4
//2036.06.22 Google Trust Services LLC (GTS):Google Trust Services LLC:
//2036.06.22 Google Trust Services LLC (GTS):Google Trust Services LLC:
//2036.06.22 Google Trust Services LLC (GTS):Google Trust Services LLC:
//2036.06.22 Google Trust Services LLC (GTS):Google Trust Services LLC:
//2023.05.15 Government of Hong Kong (SAR), Hongkong Post, Certizen:Hongkong Post:
//2042.06.03 Government of Hong Kong (SAR), Hongkong Post, Certizen:Hongkong Post:
//2030.12.31 Government of Spain, Autoritat de Certificació de la Comunitat Valenciana (ACCV):ACCV:PKIACCV
//2030.01.01 Government of Spain, Fábrica Nacional de Moneda y Timbre (FNMT):FNMT-RCM:AC RAIZ FNMT-RCM
//2022.12.08 Government of The Netherlands, PKIoverheid (Logius):Staat der Nederlanden:
//2028.11.13 Government of The Netherlands, PKIoverheid (Logius):Staat der Nederlanden:
//2043.10.25 Government of Turkey, Kamu Sertifikasyon Merkezi (Kamu SM):Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK:Kamu Sertifikasyon Merkezi - Kamu SM
//2040.06.30 HARICA:Hellenic Academic and Research Institutions Cert. Authority:
//2031.12.01 HARICA:Hellenic Academic and Research Institutions Cert. Authority:
//2040.06.30 HARICA:Hellenic Academic and Research Institutions Cert. Authority:
//2021.09.30 IdenTrust Services, LLC:Digital Signature Trust Co.:
//2034.01.16 IdenTrust Services, LLC:IdenTrust:
//2034.01.16 IdenTrust Services, LLC:IdenTrust:
//2035.06.04 Internet Security Research Group (ISRG):Internet Security Research Group:
//2037.12.13 Izenpe S.A.:IZENPE S.A.:
//2035.10.19 Krajowa Izba Rozliczeniowa S.A. (KIR):Krajowa Izba Rozliczeniowa S.A.:
//2042.08.22 Microsec Ltd.:Microsec Ltd.:
//2029.12.30 Microsec Ltd.:Microsec Ltd.:
//2042.07.18 Microsoft Corporation:Microsoft Corporation:
//2042.07.18 Microsoft Corporation:Microsoft Corporation:
//2028.12.06 NETLOCK Kft.:NetLock Kft.:Tanúsítványkiadók (Certification Services)
//2037.12.11 OISTE:WISeKey:Copyright (c) 2005, OISTE Foundation Endorsed
//2039.12.01 OISTE:WISeKey:OISTE Foundation Endorsed
//2042.05.09 OISTE:WISeKey:OISTE Foundation Endorsed
//2042.01.12 QuoVadis:QuoVadis Limited:
//2031.11.24 QuoVadis:QuoVadis Limited:
//2042.01.12 QuoVadis:QuoVadis Limited:
//2031.11.24 QuoVadis:QuoVadis Limited:
//2042.01.12 QuoVadis:QuoVadis Limited:
//2021.03.17 QuoVadis:QuoVadis Limited:Root Certification Authority
//2023.09.30 SECOM Trust Systems CO., LTD.:SECOM Trust.net:Security Communication RootCA1
//2029.05.29 SECOM Trust Systems CO., LTD.:SECOM Trust Systems CO.,LTD.:Security Communication RootCA2
//2028.12.31 Sectigo:Comodo CA Limited:
//2029.12.31 Sectigo:COMODO CA Limited:
//2038.01.18 Sectigo:COMODO CA Limited:
//2038.01.18 Sectigo:COMODO CA Limited:
//2038.01.18 Sectigo:The USERTRUST Network:
//2038.01.18 Sectigo:The USERTRUST Network:
//2029.12.31 SecureTrust:SecureTrust Corporation:
//2029.12.31 SecureTrust:SecureTrust Corporation:
//2042.08.23 SecureTrust:Trustwave Holdings, Inc.:
//2042.08.23 SecureTrust:Trustwave Holdings, Inc.:
//2042.08.23 SecureTrust:Trustwave Holdings, Inc.:
//2035.01.01 SecureTrust:XRamp Security Services Inc:www.xrampsecurity.com
//2038.12.31 Shanghai Electronic Certification Authority Co., Ltd.  (SHECA):UniTrust:
//2040.12.31 Shanghai Electronic Certification Authority Co., Ltd.  (SHECA):UniTrust:
//2041.02.12 SSL.com:SSL Corporation:
//2042.05.30 SSL.com:SSL Corporation:
//2041.02.12 SSL.com:SSL Corporation:
//2041.02.12 SSL.com:SSL Corporation:
//2036.10.25 SwissSign AG:SwissSign AG:
//2036.10.25 SwissSign AG:SwissSign AG:
//2036.10.25 SwissSign AG:SwissSign AG:
//2030.12.31 Taiwan-CA Inc. (TWCA):TAIWAN-CA:Root CA
//2030.12.31 Taiwan-CA Inc. (TWCA):TAIWAN-CA:Root CA
//2021.04.06 Telia Company (formerly TeliaSonera):Sonera:
//2032.10.18 Telia Company (formerly TeliaSonera):TeliaSonera:
//2029.12.31 TrustCor Systems:TrustCor Systems S. de R.L.:TrustCor Certificate Authority
//2029.12.31 TrustCor Systems:TrustCor Systems S. de R.L.:TrustCor Certificate Authority
//2034.12.31 TrustCor Systems:TrustCor Systems S. de R.L.:TrustCor Certificate Authority
//2024.01.21 Trustis:Trustis Limited:Trustis FPS Root CA
//2029.12.31 Web.com:Network Solutions L.L.C.:
//global variables for certificates using 0 bytes
const uint16_t numberOfCertificates PROGMEM = 0;

const uint16_t certSizes[] PROGMEM = {};

const uint8_t* const certificates[] PROGMEM = {};

const uint8_t* const indices[] PROGMEM = {};

#endif

My environment is Visual Studio Code with PlatformIO on a Windows Pro 64 box with OpenSSL extracted from this file on a local folder.

Most likely it is an installation issue, but, since I haven't worked with openssl before, I don't know how to go on...

Thanks for any pointers!

preBuildCertificates.py SyntaxError: invalid syntax

I don't do python or any other language named after a snake. I've hacked some .py a few times, though.
I can't even tell by inspection if it's python 2 or python 3, so I tried both.

jed@servpi1:~ $ python --version
Python 2.7.13
jed@servpi1:~ $ python preBuildCertificates.py
File "preBuildCertificates.py", line 94
print('Added: ' + re.sub(f'[^{re.escape(string.printable)}]', '', names[i]), flush=True)
^
SyntaxError: invalid syntax
( actually, arrow is under last character (') of printable)}]' )

How about python3?
jed@servpi1:~ $ python3 --version
Python 3.5.3
jed@servpi1:~ $ python3 preBuildCertificates.py
File "preBuildCertificates.py", line 94
print('Added: ' + re.sub(f'[^{re.escape(string.printable)}]', '', names[i]), flush=True)
^
SyntaxError: invalid syntax

Exactly the same error.

All the parentheses, brackets, and quotes match. This is beyond my poor ability in this language.
If only it were Fortran...

Just FYI:
jed@servpi1:~ $ uname -a
Linux servpi1 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
jed@servpi1:~ $ cat /proc/device-tree/model
Raspberry Pi 3 Model B Plus Rev 1.3

Serial output on Dashboard page ?

Hi,
it would be fantastic send to dashboard via websocket the serial.println for debug and information messages ...
Thanks maakbaas

Modify Webpage or add a button with Link

Great Framework!
Is it possible to create a button as weblink in Dashboard?
<a href="https://www.google.de" target="new">Open Goolge</a>
E.g. Open Goolge
I tried that in dashboard but don´t get a link.
I need such solution to provide the user a Link.
Any example is welcome.
@maakbaas

Cannot build the project

Hi, Im trying to build and upload one of examples of this project, but without success. I made gif with the steps I did, maybe I did something wrong. Thanks for any advice.
Webp net-gifmaker

Multiple language support

hello, I don't know if this is planned, but I would love to see a web app with multiple language support

POST request Stops after a short time of operation

Hello Maakbaas. Thank you for the great work you have done on the esp8266-iot-framework. Please i keep experiencing the esp8266 stops to post or get request after a very short period of time. The serial monitor i use for debuging will suddenly stop printing https response. To get it to work, i have to reboot the esp8266. Have you experienced this before? Please help. Thanks for your quick response in anticipation.
lylasolar247.

Only include certificates for URLs used in the application

You might want to consider a future enhancement to tailor the generation of certificates.h to only the certs needed for the specific application program to greatly reduce the amount of program memory used for cert storage. For many applications it is likely not an issue, but for those that hit a memory constraint then it would be helpful if certificates.h could be generated based on a data file that specifies the set of URLs needed for application connections.

Prebuild html error

I Have this error, trying to enable -DREBUILD_HTML flag.

import os
^^^^^^

SyntaxError: Cannot use import statement outside a module

does not compile after changes

does not execute changes to html build files, I am translating the web server for my language and ends up not copying

Log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]prebuild: [email protected]
6 info lifecycle [email protected]
build: [email protected]
7 verbose lifecycle [email protected]build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\pcps2\OneDrive\Documentos\PlatformIO\Projects\Modulo_Central_V2.0.0.pio\libdeps\esp07\ESP8266 IoT Framework\node_modules.bin;C:\Users\pcps2.platformio\packages\toolchain-xtensa\bin;C:\Users\pcps2.platformio\packages\tool-esptool;C:\Users\pcps2.platformio\packages\tool-mkspiffs;C:\Users\pcps2.platformio\packages\tool-esptoolpy;C:\Users\pcps2.platformio\penv\Scripts;C:\Users\pcps2.platformio\penv;C:\Python27;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\pcps2\AppData\Local\Microsoft\WindowsApps;C:\Users\pcps2\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\pcps2\AppData\Roaming\npm
9 verbose lifecycle [email protected]build: CWD: C:\Users\pcps2\OneDrive\Documentos\PlatformIO\Projects\Modulo_Central_V2.0.0.pio\libdeps\esp07\ESP8266 IoT Framework
10 silly lifecycle [email protected]
build: Args: [ '/d /s /c', 'webpack --mode=production' ]
11 silly lifecycle [email protected]build: Returned: code: 1 signal: null
12 info lifecycle [email protected]
build: Failed to exec build script
13 verbose stack Error: [email protected] build: webpack --mode=production
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\pcps2\OneDrive\Documentos\PlatformIO\Projects\Modulo_Central_V2.0.0.pio\libdeps\esp07\ESP8266 IoT Framework\build
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
18 verbose node v12.18.3
19 verbose npm v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: webpack --mode=production
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Adding new API Methods?

Hi, I have more of a question than an issue -- apologies if this is not the right forum.

What's the best way to add additional web API methods? It looks like the webserver server object is private, so I don't see an easy way of adding additional methods. Perhaps making it protected so that "bindall()" could be overridden? Or is there a method that I'm missing?

thanks for working on the framework!

Setting Up fixed IP Address

Hi,
reading documentation is not clear how to setup a fixed IP address, from the code or from web interface. Is ti possible to do?

Thanks

Cannot install it correctly on macOS Big Sur

After installing the library via PlatfromIO on Visual Studio Code and when I try to build the project I get:

ModuleNotFoundError: No module named 'asn1crypto':
  File "/Users/home/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 170:
    env.SConscript("$BUILD_SCRIPT")
  File "/Users/home/.platformio/packages/tool-scons/scons-local-4.0.1/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)

I have already installed asn1crypto globally, but it's strange that this is a some other environment. My Python is 3.9, not 3.8.
Is it possible this library to auto-install asn1crypto where is needed during installation process in Visual Studio Code?

Feature - Realtime display/polling of Config data

Any plans for displaying data in the UI as it arrives?

Had a look at running a websocket server, but ran into issues (I think my device (NodeMCU) is running out of RAM)

In case you're interested, this is what I tried (see commented out lines)

// main.cpp

#include <Arduino.h>
#include "LittleFS.h"
// #include <WebSocketsServer.h>
#include "WiFiManager.h"
#include "webServer.h"
#include "updater.h"
#include "fetch.h"
#include "configManager.h"
#include "timeSync.h"

struct task
{
    unsigned long rate;
    unsigned long previous;
};

task taskA = {.rate = 5000, .previous = 0};
static String lastColor = "#ffffff";

WebSocketsServer webSocket = WebSocketsServer(81);

void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) { // When a WebSocket message is received
    Serial.printf("[%u] get Text: %s\n", num, payload);
}

// void startWebSocket() { // Start a WebSocket server
//   webSocket.begin();                          // start the websocket server
//   webSocket.onEvent(webSocketEvent);          // if there's an incomming websocket message, go to function 'webSocketEvent'
//   Serial.println("WebSocket server started.");
// }

void setup()
{
    Serial.begin(115200);

    LittleFS.begin();
    GUI.begin();
    configManager.begin();
    WiFiManager.begin(configManager.data.projectName);
    timeSync.begin();
    // startWebSocket();

    // webSocket.begin();
    // webSocket.onEvent(webSocketEvent);
}

void loop()
{
    //software interrupts
    WiFiManager.loop();
    updater.loop();
    
    // webSocket.loop();
    
    //task A
    if (taskA.previous == 0 || (millis() - taskA.previous > taskA.rate))
    {
        taskA.previous = millis();

        //do task
        // Serial.println(ESP.getFreeHeap());

        fetch.GET("http://api.thingspeak.com/channels/1417/field/2/last.txt");

        while (fetch.busy())
        {
            if (fetch.available())
            {
                String color = fetch.readString();

                // Update dummyColor only when color changes
                if (color != lastColor)
                {
                    lastColor = color;
                    Serial.println(color); // #FF0000
                    strncpy(configManager.data.dummyColor, color.c_str(), 32);
                    configManager.save();
                }
            }
        } 

        fetch.clean();
    }
}
// index.js

// ...

import io from 'socket.io-client';

https://socket.io/docs/client-api/
const socket = io(`ws://192.168.1.13:81/`, ['arduino']);

socket.onopen = function () {
    socket.send('Message from Browser to ESP8266 yay its Working!! ' + new Date());
    socket.send('ping');

    setInterval(function () {
        connection.send('Time: ' + new Date());
    }, 20);

    socket.send('Time: ' + new Date());
};

// ...

Error Compiling Trying to include MQTT library

Hi,
I am trying to develop my IOT node. I would like to use this powerful framework, and MQTT.
Just adding PubSubClient.h to projet, I got this compiling:

Linking .pio\build\esp12e\firmware.elf c:/users/administrator/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp12e\lib9d4\libESP Async WebServer.a(WebRequest.cpp.o):(.text._ZN21AsyncWebServerRequest21requestAuthenticationEPKcb+0x10): undefined reference to requestDigestAuthentication(char const*)'
c:/users/administrator/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp12e\lib9d4\libESP Async WebServer.a(WebRequest.cpp.o): in
function AsyncWebServerRequest::requestAuthentication(char const*, bool)': WebRequest.cpp:(.text._ZN21AsyncWebServerRequest21requestAuthenticationEPKcb+0xa8): undefined reference to requestDigestAuthentication(char const*)'
c:/users/administrator/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp12e\lib9d4\libESP Async WebServer.a(WebRequest.cpp.o):(.text._ZN21AsyncWebServerRequest12authenticateEPKcS1_S1_b+0x0): undefined reference to checkDigestAuthentication(char const*, char const*, char const*, char const*, char const*, bool, char const*, char const*, char const*)' c:/users/administrator/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp12e\lib9d4\libESP Async WebServer.a(WebRequest.cpp.o):(.text._ZN21AsyncWebServerRequest12authenticateEPKcS1_S1_b+0x4): undefined reference to checkBasicAuthentication(char const*, char const*, char const*)'
c:/users/administrator/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp12e\lib9d4\libESP Async WebServer.a(WebRequest.cpp.o): in
function AsyncWebServerRequest::authenticate(char const*, char const*, char const*, bool)': WebRequest.cpp:(.text._ZN21AsyncWebServerRequest12authenticateEPKcS1_S1_b+0x5a): undefined reference to checkDigestAuthentication(char const*, char const*, char const*, char const*, char const*, bool, char const*, char const*, char const*)'
c:/users/administrator/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: WebRequest.cpp:(.text._ZN21AsyncWebServerRequest12authenticateEPKcS1_S1_b+0x72): undefined reference to checkBasicAuthentication(char const*, char const*, char const*)' collect2.exe: error: ld returned 1 exit status *** [.pio\build\esp12e\firmware.elf] Error 1

It is very frustrating, because I love this framewort and have the Web Portal to update firmware and WiFi connection very simple, but if is not possible to use MQTT this would be a problem for iot-framework.
I am not skilled to fix this issue, can anyone helpme on how to fix?

Thanks

Enable OTA from a separate http server (over your https implementation)

This IoT framework is pretty much exactly what I need for a few of my upcoming projects. It rolls all the different things I need into one coherent package, and I love it.

The only thing I'm missing (and the thing that lead me to your blog post on https) is a reliable (no fingerprints) way to implement OTA from a https server.

I have a server set up behind some http_basic auth, severed over ssl, that complies with the built in OTA implementation: https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#http-server

I am currently behind on some responsibilities in life, so will have to prioritize those, but looking at your OTA class it seems to be fairly easy to implement a version compatible with the one in the core.

When I get some more time I'll try to implement this and do a PR if it works :)
It seems the general steps to get this to work would be:

  1. Compute/add the same headers as the core class. As there's no official server implementation for this, supporting all headers would be best, but most likely not actually required.
    In any case, if the default headers can be populated I'd imagine something like below (with dynamic values changed to the appropriate function calls)
  2. Send get request to server with/without auth
  3. Read http code to determine if an update is available
  4. If available, stream binary file to littlefs
  5. initate ota update with framework requestStart()

Dirty back-of-the napkin example:

// ESP core has a more extensive typedef in the http client: https://github.com/esp8266/Arduino/blob/70e4457041eeb723033fc8011f3d724245d004ae/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h#L65
// Codes used for this example have been put here
typedef enum {
    HTTP_CODE_OK = 200,
    HTTP_CODE_NOT_MODIFIED = 304,
    HTTP_CODE_UNAUTHORIZED = 401,
    HTTP_CODE_FORBIDDEN = 403,
    HTTP_CODE_NOT_FOUND = 404, 
} t_http_codes;

// if password is left empty, then user is treated as a base64 auth string
int update(String url, String user="", String pass="", String version="")
{
    fetch.begin(url)
    add_headers(version);

    if (user != "")
    {
        if (pass != "")
        {
            fetch.setAuthorization(user.c_str(), pass.c_str());
        }
        else
        {
            fetch.setAuthorization(user.c_str());
        }
    }

    int response = fetch.GET();

    switch(response)
    {
        case HTTP_CODE_OK:
            if (get_binary())
            {
                updater.requestStart('IoTF_otafirmware');
                while(updater.getStatus() != > 1)
                {
                    yield();
                    updater.loop();
                }
                return updater.getStatus();
            }
            break;

        case HTTP_CODE_NOT_MODIFIED:
            // No update needed (current version)
            break;
        
        case HTTP_CODE_UNAUTHORIZED:
            // No auth provided
            break;
        
        case HTTP_CODE_FORBIDDEN:
            // Provided auth was denied
            break;
        
        case HTTP_CODE_NOT_FOUND:
            // Give me the right URL you dumb human
            break;
        
        default:
            // Well shit
            break;
    }
}


// This should be replaced with something that actually gets the correct values
void add_headers(String version)
{
    const uint8_t HEADER_COUNT = 9;

    String http_update_headers [header_cnt][2] = {
        {"HTTP_USER_AGENT", "ESP8266-http-Update"},
        {"HTTP_X_ESP8266_STA_MAC", "00:00:00:00:00:01"},
        {"HTTP_X_ESP8266_AP_MAC", "00:00:00:00:00:10"},
        {"HTTP_X_ESP8266_FREE_SPACE", "10"},
        {"HTTP_X_ESP8266_SKETCH_SIZE", "15"},
        {"HTTP_X_ESP8266_SKETCH_MD5", "feedbeefeatbee5"},
        {"HTTP_X_ESP8266_CHIP_SIZE", "42"},
        {"HTTP_X_ESP8266_SDK_VERSION", "1.3.0"},
        {"HTTP_X_ESP8266_VERSION", version}
    };

    fetch.begin(url, true);

    for (i=0; i<HEADER_COUNT; i++)
    {
        fetch.addHeader(http_update_headers[i][0], http_update_headers[i][1]);
    }
}

bool get_binary()
{
    File f = LittleFS.open('IoTF_otafirmware', w);

    while(fetch.busy())
    {
        if (fetch.available())
        {
            f.write(fetch.read());
        }
    }
    f.close();
    fetch.clean();

    return true;
}

Okay, me from further ahead in time. Still a dirty "kinda like this" example, but not quite napkin grade :P

I think ultimately I'd implement this as a separate class, and it definitely needs more error checking, but that's the idea :)

npm ERROR!

Hi, Im trying to build Dashboard example and Im getting these errors although it compiles fine. But with these errors dashboard doesnt work. Any advice?

[webpack-cli] Error: Cannot find module 'html-webpack-plugin'
Require stack:

  • C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object. (C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js:1:89)
    at Module._compile (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2\.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] build: webpack --mode=production
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the [email protected] build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_08_26_277Z-debug.log
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 1.6.1
| |-- 1.2.3
| | |-- 1.2.2
| | | |-- 1.0
| | |-- 1.0
| | |-- 1.0
| | |-- 6.17.2
| |-- 6.17.2
| |-- 1.0
| |-- 1.2
| | |-- 1.0
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| |-- <LittleFS(esp8266)> 0.1.0
|-- 1.2.3
| |-- 1.2.2
| | |-- 1.0
| |-- 1.0
| |-- 1.0
| |-- 6.17.2
|-- 6.17.2
|-- <LittleFS(esp8266)> 0.1.0
Building in release mode
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_08_28_874Z-debug.log
Retrieving maximum program size .pio\build\esp12e\firmware.elf
Checking size .pio\build\esp12e\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [===== ] 45.9% (used 37640 bytes from 81920 bytes)
Flash: [====== ] 57.2% (used 597060 bytes from 1044464 bytes)
==================================================================== [SUCCESS] Took 7.51 seconds ====================================================================
Terminal will be reused by tasks, press any key to close it.

Executing task in folder CleanProject2: C:\Users\shalk.platformio\penv\Scripts\pio.exe run <

Processing esp12e (platform: espressif8266; board: esp12e; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp12e.html
PLATFORM: Espressif 8266 (2.6.2) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 3.20704.0 (2.7.4)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.20800.0 (2.8.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft

[email protected] build C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework
webpack --mode=production

[webpack-cli] Error: Cannot find module 'html-webpack-plugin'
Require stack:

  • C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object. (C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js:1:89)
    at Module._compile (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2\.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] build: webpack --mode=production
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the [email protected] build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_10_13_246Z-debug.log
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 1.6.1
| |-- 1.2.3
| | |-- 1.2.2
| | | |-- 1.0
| | |-- 1.0
| | |-- 1.0
| | |-- 6.17.2
| |-- 6.17.2
| |-- 1.0
| |-- 1.2
| | |-- 1.0
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| |-- <LittleFS(esp8266)> 0.1.0
|-- 1.2.3
| |-- 1.2.2
| | |-- 1.0
| |-- 1.0
| |-- 1.0
| |-- 6.17.2
|-- 6.17.2
|-- <LittleFS(esp8266)> 0.1.0
Building in release mode
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_10_15_765Z-debug.log
Retrieving maximum program size .pio\build\esp12e\firmware.elf
Checking size .pio\build\esp12e\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [===== ] 45.9% (used 37640 bytes from 81920 bytes)
Flash: [====== ] 57.2% (used 597060 bytes from 1044464 bytes)
==================================================================== [SUCCESS] Took 7.41 seconds ====================================================================
Terminal will be reused by tasks, press any key to close it.

Executing task in folder CleanProject2: C:\Users\shalk.platformio\penv\Scripts\pio.exe run <

Processing esp12e (platform: espressif8266; board: esp12e; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp12e.html
PLATFORM: Espressif 8266 (2.6.2) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 3.20704.0 (2.7.4)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.20800.0 (2.8.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft

[email protected] build C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework
webpack --mode=production

[webpack-cli] Error: Cannot find module 'html-webpack-plugin'
Require stack:

  • C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object. (C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js:1:89)
    at Module._compile (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2\.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] build: webpack --mode=production
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the [email protected] build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_14_57_650Z-debug.log
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 1.6.1
| |-- 1.2.3
| | |-- 1.2.2
| | | |-- 1.0
| | |-- 1.0
| | |-- 1.0
| | |-- 6.17.2
| |-- 6.17.2
| |-- 1.0
| |-- 1.2
| | |-- 1.0
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| |-- <LittleFS(esp8266)> 0.1.0
|-- 1.2.3
| |-- 1.2.2
| | |-- 1.0
| |-- 1.0
| |-- 1.0
| |-- 6.17.2
|-- 6.17.2
|-- <LittleFS(esp8266)> 0.1.0
Building in release mode
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_15_00_109Z-debug.log
Retrieving maximum program size .pio\build\esp12e\firmware.elf
Checking size .pio\build\esp12e\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [===== ] 45.9% (used 37640 bytes from 81920 bytes)
Flash: [====== ] 57.2% (used 597060 bytes from 1044464 bytes)
==================================================================== [SUCCESS] Took 7.10 seconds ====================================================================
Terminal will be reused by tasks, press any key to close it.

Executing task in folder CleanProject2: C:\Users\shalk.platformio\penv\Scripts\pio.exe run <

Processing esp12e (platform: espressif8266; board: esp12e; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp12e.html
PLATFORM: Espressif 8266 (2.6.2) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 3.20704.0 (2.7.4)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.20800.0 (2.8.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft

[email protected] build C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework
webpack --mode=production

[webpack-cli] Error: Cannot find module 'html-webpack-plugin'
Require stack:

  • C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js
  • C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object. (C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js:1:89)
    at Module._compile (C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\shalk\Documents\PlatformIO\Projects\CleanProject2\.pio\libdeps\esp12e\ESP8266 IoT Framework\webpack.config.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\groups\resolveConfig.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\shalk\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] build: webpack --mode=production
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the [email protected] build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_18_22_676Z-debug.log
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 1.6.1
| |-- 1.2.3
| | |-- 1.2.2
| | | |-- 1.0
| | |-- 1.0
| | |-- 1.0
| | |-- 6.17.2
| |-- 6.17.2
| |-- 1.0
| |-- 1.2
| | |-- 1.0
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| |-- <LittleFS(esp8266)> 0.1.0
|-- 1.2.3
| |-- 1.2.2
| | |-- 1.0
| |-- 1.0
| |-- 1.0
| |-- 6.17.2
|-- 6.17.2
|-- <LittleFS(esp8266)> 0.1.0
Building in release mode
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalk\AppData\Roaming\npm-cache_logs\2020-12-18T11_18_24_985Z-debug.log
Retrieving maximum program size .pio\build\esp12e\firmware.elf
Checking size .pio\build\esp12e\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [===== ] 45.9% (used 37640 bytes from 81920 bytes)
Flash: [====== ] 57.2% (used 597060 bytes from 1044464 bytes)
==================================================================== [SUCCESS] Took 7.18 seconds ====================================================================
Terminal will be reused by tasks, press any key to close it.

How to store a String as char[32] in configManager

e.g.

But for char[32]

Tried my best to figure this out, but totally stuck (I don't know C++) I know this isn't really the right place to ask, but after 2 hours not sure where else to look - this is the closest I've gotten.

void loop()
{
    //software interrupts
    WiFiManager.loop();
    updater.loop();

    //task A
    if (taskA.previous==0 || (millis() - taskA.previous > taskA.rate ))
    {
        taskA.previous = millis();

        //do task
        // Serial.println(ESP.getFreeHeap());
                
        fetch.GET("http://api.thingspeak.com/channels/1417/field/2/last.txt");

        while (fetch.busy())
        {
            if (fetch.available())
            {
                String s;

                String color = fetch.readString();   
                Serial.println(color); // #FF0000

                char c[32];

                s.toCharArray(c, sizeof(c));

                // Error: expression must be a modifiable lvalue
                configManager.data.dummyColor = s;

                configManager.save();     
            }
        }
            
        fetch.clean();
    }
}

Strange dummy float bug

Hi Maakbaas,

I have applied your default config for testing.
Specifying a field as dummyFloat 1-2, I can correctly insert values as: 1, 2 NOT 5.
But I would insert 1.3. The result is 1.29999....
or 1.2 the result is 1.20000.....
esp8266-iotf-dummyfloat-bug

Starting Using Configuration Manager

Ciao,
I am a new developer and I am not skilled on this kind of stuff. I have created my basic node using WiFi Manager, and now I would like to move to next level. I would like to use configuration manager and my config parameters and read them from my code.
I have not yet undestood how start with it, edit out of the box filed and add some new parameter.
Can you give me some suggestion on this side?

Thanks
Marco

Can't build (custom) web interface

I've followed the instructions closely. I'm building on a Mac fwiw (I had to fix some paths to work in the unixy way, no biggie), and a fresh repo builds fine. I think this is a really exciting project, with the potential to be a fantastic time saver.

The trouble comes when I try to npm run build -- I get errors regarding

[webpack-cli] Error: ENOENT: no such file or directory, open './dist/index.html.gz'

This seems to be a failure of webpack.config.js assuming this file exists; I'm no npm expert and I can't see how/where index.html.gz might be generated.

Manually creating a file with a copy of the standard index.html doesn't help - it resolves the error only to fail later with:

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.

... and I am at a loss as to how to resolve this (believe me, I've tried!) because I'm unfamiliar with npm and friends.

Building from command line or with -D options both give similar results.

Any ideas, please?

HTTPS not working when using the framework as a PlatformIO library

The reason is that the framework overrides one header file from the Arduino libraries related to the certificate store. This works fine when these files are in the src folder, but I guess the priority is different when the framework is included as a PlatformIO library.

The workaround is to copy the two files below to your src folder:

https://github.com/maakbaas/esp8266-iot-framework/blob/master/src/certStore.cpp
https://github.com/maakbaas/esp8266-iot-framework/blob/master/src/certStore.h

fetch.read() to String

Hi.
Your example show´s how to get your fetch to a serial.write output. Is there an example to get the response to a string value or are you able to give me a hint to get the Serial.write to String?
My target is to serialize.json the response of a https get. I don´t get the String from Serial.write(fetch.read()); to a string variable.

` Serial.println(ESP.getFreeHeap());

    fetch.GET("https://www.google.com");

    while (fetch.busy())
    {
        if (fetch.available())
        {
            Serial.write(fetch.read());           
        }
    }
    
    fetch.clean();`

DashBoard


22790e7f-7440-4d8b-ab73-09f70bb4d659

the dashboard does not work on mobile devices

Build fails with various "No such file or directory errors"

Hello,

I tried using the framework, but failed pretty soon. I made a very small demo, it's just a plain platformio project with the library added.

My platformio.ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino

monitor_speed = 115200

lib_deps = ESP8266 IoT Framework

My main.cpp

#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Here is the error message I'm getting upon executing build.

platformio build output
> Executing task: platformio run --environment nodemcuv2 <

Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (2.6.2) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
- framework-arduinoespressif8266 3.20704.0 (2.7.4) 
- tool-esptool 1.413.0 (4.13) 
- tool-esptoolpy 1.20800.0 (2.8.0) 
- toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft

warning: Calling missing SConscript without error is deprecated.
Transition by adding must_exist=0 to SConscript calls.
Missing SConscript '.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/build/preBuild.py'
File "/home/mario/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 280, in process_extra_options
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266 IoT Framework> 1.3.2
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <Hash> 1.0
|   |   |-- <ArduinoJson> 6.17.1
|   |-- <ArduinoJson> 6.17.1
Building in release mode
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/WiFiManager.cpp.o
.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/WiFiManager.cpp:5:25: fatal error: ESP8266WiFi.h: No such file or directory

*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESP8266WiFi.h"
* Web  > https://platformio.org/lib/search?query=header:ESP8266WiFi.h
*
*********************************************************************

#include <ESP8266WiFi.h>
                       ^
compilation terminated.
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/certStore.cpp.o
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/configManager.cpp.o
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/fetch.cpp.o
.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/configManager.cpp:1:20: fatal error: EEPROM.h: No such file or directory

****************************************************************
* Looking for EEPROM.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:EEPROM.h"
* Web  > https://platformio.org/lib/search?query=header:EEPROM.h
*
****************************************************************

#include <EEPROM.h>
                  ^
compilation terminated.
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/generated/config.cpp.o
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/timeSync.cpp.o
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/updater.cpp.o
In file included from .pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/certStore.cpp:1:0:
.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/certStore.h:9:28: fatal error: BearSSLHelpers.h: No such file or directory

************************************************************************
* Looking for BearSSLHelpers.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:BearSSLHelpers.h"
* Web  > https://platformio.org/lib/search?query=header:BearSSLHelpers.h
*
************************************************************************

#include <BearSSLHelpers.h>
                          ^
compilation terminated.
In file included from .pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/fetch.cpp:1:0:
.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/fetch.h:5:31: fatal error: ESP8266HTTPClient.h: No such file or directory

***************************************************************************
* Looking for ESP8266HTTPClient.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESP8266HTTPClient.h"
* Web  > https://platformio.org/lib/search?query=header:ESP8266HTTPClient.h
*
***************************************************************************

#include <ESP8266HTTPClient.h>
                             ^
compilation terminated.
.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/updater.cpp:3:22: fatal error: LittleFS.h: No such file or directory

******************************************************************
* Looking for LittleFS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:LittleFS.h"
* Web  > https://platformio.org/lib/search?query=header:LittleFS.h
*
******************************************************************

#include "LittleFS.h"
                    ^
compilation terminated.
Compiling .pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/webServer.cpp.o
Compiling .pio/build/nodemcuv2/src/main.cpp.o
Generating LD script .pio/build/nodemcuv2/ld/local.eagle.app.v6.common.ld
Compiling .pio/build/nodemcuv2/lib5b9/ESPAsyncTCP/AsyncPrinter.cpp.o
In file included from .pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/webServer.h:4:0,
               from .pio/libdeps/nodemcuv2/ESP8266 IoT Framework/src/webServer.cpp:1:
.pio/libdeps/nodemcuv2/ESP Async WebServer/src/ESPAsyncWebServer.h:35:25: fatal error: ESP8266WiFi.h: No such file or directory

*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESP8266WiFi.h"
* Web  > https://platformio.org/lib/search?query=header:ESP8266WiFi.h
*
*********************************************************************

#include <ESP8266WiFi.h>
                       ^
compilation terminated.
*** [.pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/WiFiManager.cpp.o] Error 1
*** [.pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/configManager.cpp.o] Error 1
*** [.pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/certStore.cpp.o] Error 1
*** [.pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/fetch.cpp.o] Error 1
*** [.pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/updater.cpp.o] Error 1
Compiling .pio/build/nodemcuv2/lib5b9/ESPAsyncTCP/ESPAsyncTCP.cpp.o
*** [.pio/build/nodemcuv2/lib94a/ESP8266 IoT Framework/webServer.cpp.o] Error 1
================================================================================= [FAILED] Took 1.27 seconds =================================================================================
The terminal process "platformio 'run', '--environment', 'nodemcuv2'" terminated with exit code: 1.

Do you have any tip how to resolve this issue?

Btw iI'm new to platformio so I might have missed something there, though I wouldn't know what.

Using the web interface at runtime once WiFi configuration is complete

What a wonderful project.
This is what I've been looking for for months and I never knew it existed. Thank you for all your hard work.

As far as I understand, packages like WiFiManager allow a user to configure their device with their SSID and password, and then the interface/AP goes away. Is it possible to still run the AP (to change settings) even though the WiFi credentials have been added? I have checked the docs but maybe I missed something.

Here's what I'm trying to achieve with your framework:

The idea is that a user can connect to their device's AP via WiFi, it reboots (as normal), and then they can still access the AP in order to configure the toy.

cheerbird

I've achieved this (in a pretty clunky way!) for now using my own setup, but I'd love to switch over to this project if I can achieve this! (nothing stopping me using it for other projects however 😉)

Thanks again @maakbaas

Is't ESP01 compatible ?

Greetings,
First, thanks for this great repo.
I'm trying to use ESP01 for some HTTPS requests , and i came across this platform , after wraping all , i got this issue with the HelloWorld example :
Found 33 compatible libraries Scanning dependencies... Dependency Graph |-- <ESP8266 IoT Framework> 1.3.2 | |-- <ESP Async WebServer> 1.2.3 | | |-- <ESPAsyncTCP> 1.2.2 | | | |-- <ESP8266WiFi> 1.0 | | |-- <Hash> 1.0 | | |-- <ESP8266WiFi> 1.0 | | |-- <ArduinoJson> 6.17.1 | |-- <ArduinoJson> 6.17.1 | |-- <ESP8266WiFi> 1.0 | |-- <EEPROM> 1.0 | |-- <ESP8266HTTPClient> 1.2 | | |-- <ESP8266WiFi> 1.0 | |-- <LittleFS(esp8266)> 0.1.0 | |-- <DNSServer> 1.1.1 | | |-- <ESP8266WiFi> 1.0 |-- <LittleFS(esp8266)> 0.1.0 Building in release mode Linking .pio\build\esp01\firmware.elf c:/users/mtrd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\firmware.elf section .irom0.text' will not fit in region `irom0_0_seg'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp01\firmware.elf] Error 1
=============================================================================== [FAILED] Took 5.01 seconds ===============================================================================
The terminal process "C:\Users\mtrd.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.`
It seems like a memory leak issue , is that an expected behaviour ?

Regards,
Mohammed

configuration won't 'stick'

This might be clearly a beginners question, but when I run 'configManagerExample' from the examples folder it compiles fine and I get the values from the given configuration.json file. But when I change values in this file they don't show in the rendered page. That is some changes do and some don't.
When I change the labels names I see the changes. These are hard-coded in the generated html file, so no surprise.
But when I change the values (like the project name) both Safari and Chrome show the 'old' values. But it gets stranger...
When I first erase the esp before uploading the new binary it shows up as an AP with the name I put in the json. But when I go to the page it show my given values during the rendering of the page (fraction of a second, but clearly there) and then all values revert to the values in the original configuration.json. Except for the value of "Dummy Int', that keeps the value I give it before building the project.
config.cpp (in the generated folder inside .pio/.../src) show my values. I emptied caches, tried different computers, all do the same thing so it is not likely to be a cache problem.
(Also I am not abel to compile the dashboard example. Only mention that because it might be related, but if I'm still not able to compile after a couple of days more Googling and hair-pulling I'll open a different issue for that.)

This is my platformio.ini:
[env:nodemcuv2] platform = espressif8266 board = nodemcuv2 framework = arduino upload_speed = 230400 monitor_speed = 115200 lib_deps = ESP8266 IoT Framework build_flags = -DCONFIG_PATH=configuration.json -DREBUILD_CONFIG -DREBUILD_HTML

Let me know if there is any information you need from me.

Adding a getter for the WiFiClientSecure object

Hey there. I'm looking at making some MQTT based IoT nodes, and really really really want to use an external MQTT service. Because of this I really want to use SSL, and this framework is so far the only proper SSL implementation for ESP8266s

I was wondering if it'd be feasible to add a getter for the WiFiClientSecure object https://github.com/maakbaas/esp8266-iot-framework/blob/master/src/fetch.cpp#L11-L20 that could be acquired for use with other libraries. In my case the Adafruit MQTT library.

I'll give this a whirl tomorrow, but just wanted to leave an issue here so I don't forget about it (it's 3am :S)
basically I'd move the https setup linked above to a separate public function, and then just call that from begin. That'd allow people to call that separately if they wanted, and just get the WiFiClientSecure object, to hand off to other libraries.

How to intercept the save config ?

Hi maakbaas,

this is not a bug, it is a request info.

On the normal running of your code, I would change a value on config.
I will go on the config settings page and I change one value, then press Save. The new value is saved into EEPROM.
It's good.

But how to get on the "loop" the config change event ? Because I would restart the esp to running with the new values.

Thanks for this code.

Failed to build

Thanks for the great work
I have tried to build using PlatformIO but have the following errors
webServer.cpp
'updater' was not declared in this scope [91,9]
'updater' was not declared in this scope [100,32]
Also a warning in multiple places about SPIFFS is deprecated
Any assistance is appreciated
Darryl

configurationManager improvements

  • Change the saveRaw function to directly take a configData pointer instead of a uint8_t array
  • Clarify documentation on regenerating the web interface after updating the JSON file

Add callback to config save

Not an issue, but I'm not an experienced Github user, so I don't know where to put this. Maybe it is a pull-request, but I don't know how that works...
I needed a way to know if any of the config values has changed, so i can combine that with my MQTT calls. So I added a function to configManager.
My configManager.cpp now looks like this:

#include <EEPROM.h>
#include <Arduino.h>

#include "configManager.h"

//class functions
bool config::begin(int numBytes)
{
    EEPROM.begin(numBytes);

    uint32_t storedVersion;
    uint8_t checksumData = 0;
    uint8_t checksumInternal = 0;

    EEPROM.get(0, internal);
    EEPROM.get(SIZE_INTERNAL, checksumInternal);
    EEPROM.get(SIZE_INTERNAL + 1, storedVersion);
    EEPROM.get(SIZE_INTERNAL + 5, data);
    EEPROM.get(SIZE_INTERNAL + 5 + sizeof(data), checksumData);        

    bool returnValue = true;

    //reset configuration data if checksum mismatch
    if (checksumData != checksum(reinterpret_cast<uint8_t*>(&data), sizeof(data)) || storedVersion != configVersion)
    {
        Serial.println(PSTR("Config data checksum mismatch"));
        reset();
        returnValue = false;
    }

    //reset internal data if checksum mismatch
    if (checksumInternal != checksum(reinterpret_cast<uint8_t*>(&internal), sizeof(internal)))
    {
        Serial.println(PSTR("Internal data checksum mismatch"));
        internal = internalData();
        save();
        returnValue = false;
    }

    return returnValue;        
}

void config::reset()
{
    memcpy_P(&data, &defaults, sizeof(data));
    save();
}

void config::saveRaw(uint8_t bytes[])
{
    memcpy(&data,bytes,sizeof(data));
    save();
}

void config::saveExternal(configData *extData)
{
    memcpy(&data, extData, sizeof(data));
    save();
}

void config::setConfigSaveCallback( std::function<void()> func ) {
  _configsavecallback = func;
}


void config::save()
{
    EEPROM.put(0, internal);

    //save checksum for internal data
    EEPROM.put(SIZE_INTERNAL, checksum(reinterpret_cast<uint8_t*>(&internal), sizeof(internal)));

    EEPROM.put(SIZE_INTERNAL + 1, configVersion);
    EEPROM.put(SIZE_INTERNAL + 5, data);

    //save checksum for configuration data
    EEPROM.put(SIZE_INTERNAL + 5 + sizeof(data), checksum(reinterpret_cast<uint8_t*>(&data), sizeof(data)));
    
    EEPROM.commit();
    
    if ( _configsavecallback != NULL) {
        _configsavecallback();
    }
}

uint8_t config::checksum(uint8_t *byteArray, unsigned long length)
{
    uint8_t value = 0;
    unsigned long counter;

    for (counter=0; counter<length; counter++)
    {
        value += *byteArray;
        byteArray++;
    }

    return (uint8_t)(256-value);

}

config configManager;

And my configManager.h:

#ifndef CONFIGMGR_H
#define CONFIGMGR_H

#include "IPAddress.h"
#include "generated/config.h"

//data that needs to be persisted for other parts of the framework

#define SIZE_INTERNAL 32 //allocate 32 bytes to have room for future expansion

struct internalData
{
	uint32_t ip;
	uint32_t gw;
	uint32_t sub;
	uint32_t dns;
};

class config
{

public:
	configData data;
	internalData internal;
	bool begin(int numBytes = 512);
	void saveRaw(uint8_t bytes[]);
	void saveExternal(configData *extData);
	void save();
	void reset();
	void setConfigSaveCallback( std::function<void()> func );

private:
	uint8_t checksum(uint8_t *byteArray, unsigned long length);
	std::function<void()> _configsavecallback;
};

extern config configManager;

#endif

So now you can define a function to be called in setup() when the 'Save' button is clicked:

configManager.setConfigSaveCallback(saveCallback);

Option to add headers to fetches

Feature Request:

Some platforms require authenticated headers in their HTTP requests.

The fetch interface currently doesn't support custom HTTP headers.

`forget` (and probably other destructive requests) should be `POST`

I noticed this after I connected to the device dashboard, and noticed that the captive portal was started in the device serial monitor. I think what happened is that the browser either replayed a previous "forget" action, or prefected the "forget" request on the wifi settings page.

Either way, this could be solved with a post (or possibly delete) request instead. It's a common web design principle to only use get requests for safe, non-destructive operations (source).

I can open a PR for this unless you/someone else does first; I'm just making a note here right after I noticed it, to revisit later.

Decide how to integrate the framework in new projects

What would be the best way for you to start a new project based on this framework?

As raised by @factormystic in #7:

I think another part of it is, what is the expectation for how this project should be used? There's a few ways to think about it. For example, people who want to build apps on this framework might clone/fork and start editing/customizing whatever they want. Of course that's allowed, but it might not be helpful especially if people want to incorporate core changes into their projects later on. I'm still figuring that out myself.

One idea I had is to have people start a fresh repo for their own projects instead of fork, but then add this code as a git submodule. To reference an inspiration, this is how themes for the static blogging program Hugo typically work (explanation). The obvious problem is that's a pure web project whereas this is a compiled IoT project so I actually don't know if it can work, but conceptually I like the idea of pulling this project in as a dependency somehow, then in my own repo I have only my own configuration.json, main.cpp, etc, and can easily pull in updates.

Another suggestion could be to make it into a PlatformIO library so that you can include it into your project in that way.

I guess for convenience for users, cloning or forking the project to get started is the easiest, but I also see the drawbacks in that. At the same time, when making the project into for instance a PlatformIO library, it is less straightforward to make modifications to the web interface or other parts of the framework to tailor towards your specific application, or is this mainly a good thing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.