Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

paclema/iot_button

Repository files navigation

iot_button

WARNING: Repository Discontinued

This repository is now archived and further development is not expected. The repository was initially created as a proof of concept to develop a firmware for ESP8266 and ESP32 devices capable of running a web server stored into the flash memory next to Arduino based firmware code to handle easily internal configurations such as WiFI credentials and connection settings, MQTT, OTA and more services configurations or user custom class configurations.

This repository has been archived as a result of the creation of the Platformio WebConfigServer library.

Features:

Web application:

  • Angular 10 and Bootstrap 4 web application to configure the device and visualize data.
  • Nebular UI Angular lib.
  • ng2-charts to visualize WS data graphs on dashboard web server endpoint.
  • Gzipped compression to store and serve the Webapp.

Firmware:

  • ESP32 support.
  • Improved platformio targets and ESP partitions for Wemos D1 mini and Lolin D32 pro and OTA updates.
  • Store configs as JSON and certs on SPI Flash File System (SPIFFS).
  • AP+STA wifi mode with wifimulti and mDNS support
  • FTP server to easily modify files stored on SPIFFS.
  • WrapperOTA class to handle OTA updates.
  • WrapperWebSockets class to handle WS communication between device and webserver dashboard endpoint.
  • MQTT client as QoS2 to detect disconnection and enabled connection using user&pass and/or certificates.
  • Added configurable DeepSleep modes for ESP8266.
  • Webserver or AsyncWebserver support.
  • Enabled lwip NAT features for ESP8266 and ESP32.
  • Added configurable NTP server.

Requirements:

  • Wemos D1 mini (ESP8266) or Lolin D32 pro (ESP32).
  • push button on RST --> this will triger the push action after restart the board.
  • D0 (GPIO16) connected to RST so Deep Sleep can wake up after the sleep time configured.
  • CHPD (or EN) to VCC.
  • Wemos D1 mini can use USB power or 3v3-5v on 5v pin.

Add a new configuration object:

  1. Update the new object in the configuration file /data/config.json
  2. Add the struct object in the configuration class /lib/WebConfigServer/WebConfigServer.h
  3. Update the parse function to link the json object with the class struct in the configuration class /lib/WebConfigServer/WebConfigServer.cpp

Upload /data folder to ESP SPIFFS File System:

Using platformio run the next command: pio run -t uploadfs

Build webserver to /data fodler:

If you can not run angular-cli from platformio PowerShell using windows, activate it with: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Under webserver/ folder:

ng build --prod --optimization=true --outputHashing=none; npm run postbuild

To build and upload SPIFFS

cd ./webserver; ng build --prod --optimization=true --outputHashing=none; npm run postbuild;cd ..; pio run --target uploadfs --environment d1_mini

To build for xammp:

ng build --prod --optimization=true --outputHashing=none --outputPath=C:/xampp/htdocs --deleteOutputPath=false

These build options can be added in angular.json in the future.

Compress /data fodler with gzip:

Under webserver folder:

npm run postbuild

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •