/esp_wifi_template

ESP32 and ESP8266 Arduino wifi template

Primary LanguageC++

ESP wifi template

ESP32 and ESP8266 Arduino wifi template

Features

Popular

  • WiFI AP mode
  • WiFI STA mode
  • ETH mode
  • DNS server for AP mode
  • Async DDNS client
  • mDNS service for WiFI STA mode
  • NBNS service for WiFI STA mode
  • OTA Arduino with PIN option
  • Web update application
  • Web update spiffs/littleFS
  • Web monitor system params
  • Web configure WiFi AP and STA mode
  • SNTP run Async or impl by system
  • SPIFFS/LittleFS web Editor
  • SD Card web Editor
  • System params configure loaded from SPIFFS/LittleFS
  • LED display WiFi/ETH status
  • Button set factory default system params
  • Log File operating system into SPIFFS/LittleFS

Ethernet IC supported

  • ENC28J60
  • W5100
  • w5500
  • LAN8720A only for ESP32
  • TLK110 only for ESP32

File system handle

  • SPIFFS
  • LittleFS
  • SD card with SPI or SDMMC(only ESP32) interface

Async WebServer

  • Websocket
  • Event Source
  • File system editor
  • Updater application
  • Updater file system

THIoT_ESPConfig.h

Define Description
ETH_ENABLE Enable/disable Ethernet
SD_CARD_ENABLE Enable/disable SD card
SD_SPI_INTERFACE SPI/MMC interface
USE_NAND_FS_SYSTEM SPIFFS/LittleFS/FATFS system
... Some another configures

THIoT_ESPBoard.h

Define Description
LED_STATUS_GPIO LED Pin
FACTORY_INPUT_PIN Factory button (hold 2s)
ETH_GPIO_ENABLE Input select WIFI/ETH mode
... Some another configures

Libraries

HttpServer page

Link Description
/wifi.htm setting wifi access point and station
/index.htm Monitor some information system as Heap memory, temperature
/edit web editor internal file system
/edit_sdfs web editor SD card file system
Authorize default pass: admin, user" admin
Pin default 1234

Http request API

Link Description
/get?param_wifi=restart Restart ESP
/get?param_wifi=fw_version Firmware version

Usage API file system editor

Request to download file from sd card (method GET)

  • /edit_sdfs?download=/file.txt
  • /edit_sdfs?download=/file.txt&filename=newName.txt

Request to edit file from sd card (method GET)

  • /edit_sdfs?edit=/file.txt

Request to delete file from sd card (method DELETE)

  • /edit_sdfs , path=/file.txt

Request to download file from spiffs/LittleFS (method GET)

  • /edit?download=/file.txt
  • /edit?download=/file.txt&filename=newName.txt

Request to edit file from spiffs/LittleFS (method GET)

  • /edit?edit=/file.txt

Request to delete file from spiffs/LittleFS (method DELETE)

  • /edit , path=/file.txt

Usage ESP8266 Sketch Data Upload

1. Download ESP8266LittleFS-2.6.0.zip

Usage ESP32 Sketch Data Upload

1. Download esp32fs.zip

2. Download x86_64-w64-mingw32-mklittlefs-295fe9b.zip

3. Download mkfatfs

4. mkspiffs.exe is already in directory

  • C:\Users\PC-NAME\Documents\Arduino\hardware\espressif\esp32\tools\mkspiffs\mkspiffs.exe

5. Install LITTLEFS

Sketch Data Upload

  • Restart Arduino IDE after any steps above
  • Tools --> ESP32 Sketch Data Upload --> [LITTLEFS, SPIFFS, FATFS, Erase Flash]
  • Tools --> ESP8266 LittleFS Data Upload
  • Tools --> ESP8266 Sketch Data Upload

Update latest BLE Client Library to allow change MTU size (Option)

Tools using convert gzip

Tools usage json

Some update ESPAsyncWebserver library to handle new port

Some update AsyncTCP library to handle new port for ESP32