paclema / iot-postbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iot_button

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


Languages

Language:HTML 81.6%Language:TypeScript 9.6%Language:C++ 7.0%Language:JavaScript 1.5%Language:SCSS 0.2%Language:CSS 0.0%