- Notifications
You must be signed in to change notification settings - Fork1
Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for ESP32S2/S3/C3 boards using LwIP W6100 Ethernet library. The WebServer supports HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time. It provides HTTP(S), MQTT(S) Client, supports WebServer serving from LittleFS/SPIFFS
License
khoih-prog/WebServer_ESP32_SC_W6100
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
- Why do we need this WebServer_ESP32_SC_W6100 library
- Changelog
- Prerequisites
- Installation
- Libraries' Patches
- HOWTO Fix
Multiple DefinitionsLinker Error - HOWTO Use analogRead() with ESP32 running WiFi and/or BlueTooth (BT/BLE)
- Usage
- How to connect W6100 to ESP32_S2/S3/C3
- Examples
- Example AdvancedWebServer
- Debug Terminal Output Samples
- 1. AdvancedWebServer on ESP32S3_DEV with ESP32_S3_W6100
- 2. MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_W6100
- 3. MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100
- 4. MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W6100
- 5. WebClient on ESP32S3_DEV with ESP32_S3_W6100
- 6. UDPSendReceive on ESP32S2_DEV with ESP32_S2_W6100
- 7. AdvancedWebServer on ESP32S2_DEV with ESP32_S2_W6100
- 8. AdvancedWebServer on ESP32C3_DEV with ESP32_C3_W6100
- Debug
- Troubleshooting
- Releases
- Issues
- TO DO
- DONE
- Contributions and Thanks
- Contributing
- License
- Copyright
Why do we need thisWebServer_ESP32_SC_W6100 library
ThisWebServer_ESP32_SC_W6100 library is a simple yet complete WebServer wrapper library forESP32_S2/S3/C3-based boards usingLwIP W6100 Ethernet. The functions are similar and compatible to those ofESP32 WebServer andESP8266WebServer libraries to make life much easier to port sketches from ESP8266/ESP32.
ThisWebServer_ESP32_SC_W6100 library also provides high-levelHTTP(S), MQTT(S) and WebSockets Client by using the functions from ESP32'sHTTPClient Library
The library provides these features:
- TCP Server and Client
- UDP Server and Client
- HTTP(S) Server and Client
- HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time.
- High-level HTTP(S) (GET, POST, PUT, PATCH, DELETE), MQTT(S) and WebSocket Client.
Library is providing similar functions to:
Please also check these sibling libraries
- WebServer_WT32_ETH01 for ESP32-based
WT32_ETH01usingLwIP LAN8720 - WebServer_ESP32_ENC for ESP32-boards using
LwIP ENC28J60 - WebServer_ESP32_W5500 for ESP32-boards using
LwIP W5500 - WebServer_ESP32_W6100 for ESP32-boards using
LwIP W6100 - WebServer_ESP32_SC_ENC for ESP32_S3-boards using
LwIP ENC28J60 - WebServer_ESP32_SC_W5500 for ESP32_S3-boards using
LwIP W5500 - WebServer_ESP32_SC_W6100 for ESP32_S3-boards using
LwIP W6100
and more complex libraries for ESP32-based usingLwIP Ethernet
- ESP32_ENC_Manager
- ESP32_W5500_Manager
- ESP32_Ethernet_Manager
- ESP32_SC_ENC_Manager
- ESP32_SC_W5500_Manager
- ESP32_SC_Ethernet_Manager
- AsyncESP32_ENC_Manager
- AsyncESP32_W5500_Manager
- AsyncESP32_Ethernet_Manager
- AsyncESP32_SC_ENC_Manager
- AsyncESP32_SC_W5500_Manager
- AsyncESP32_SC_Ethernet_Manager
- AsyncUDP_ESP32_ENC
- AsyncUDP_ESP32_W5500
- AsyncUDP_ESP32_W6100
- AsyncUDP_ESP32_Ethernet
- AsyncUDP_ESP32_SC_ENC
- AsyncUDP_ESP32_SC_W5500
- AsyncUDP_ESP32_SC_W6100
- AsyncUDP_ESP32_SC_Ethernet
- AsyncDNSServer_ESP32_ENC
- AsyncDNSServer_ESP32_W5500
- AsyncDNSServer_ESP32_W6100
- AsyncDNSServer_ESP32_Ethernet
ThisWebServer_ESP32_SC_W6100 library currently supports these following boards:
- ESP32_S3 boards using
LwIP W6100 Ethernet - ESP32_S2 boards using
LwIP W6100 Ethernet - ESP32_C3 boards using
LwIP W6100 Ethernet
Arduino IDE 1.8.19+for Arduino.ESP32 Core 2.0.6+for ESP32-based ESP32S2/S3/C3_DEV with W6100 boards.
The best and easiest way is to useArduino Library Manager. Search forWebServer_ESP32_SC_W6100, then select / install the latest version.You can also use this link for more detailed instructions.
- Navigate toWebServer_ESP32_SC_W6100 page.
- Download the latest release
WebServer_ESP32_SC_W6100-main.zip. - Extract the zip file to
WebServer_ESP32_SC_W6100-maindirectory - Copy the whole
WebServer_ESP32_SC_W6100-mainfolder to Arduino libraries' directory such as~/Arduino/libraries/.
- InstallVS Code
- InstallPlatformIO
- InstallWebServer_ESP32_SC_W6100 library by usingLibrary Manager. Search for WebServer_ESP32_SC_W6100 inPlatform.io Author's Libraries
- Use includedplatformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples atProject Configuration File
To fixESP32 compile error, just copy the following file into theESP32 cores/esp32 directory (e.g. ./arduino-1.8.19/hardware/espressif/cores/esp32) to overwrite the old file:
The current library implementation, usingxyz-Impl.h instead of standardxyz.cpp, possibly creates certainMultiple Definitions Linker error in certain use cases.
You can include this.hpp file
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error#include"WebServer_ESP32_SC_W6100.hpp"//https://github.com/khoih-prog/WebServer_ESP32_SC_W6100
in many files. But be sure to use the following.h filein just 1.h,.cpp or.ino file, which mustnot be included in any other file, to avoidMultiple Definitions Linker Error
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error#include"WebServer_ESP32_SC_W6100.h"//https://github.com/khoih-prog/WebServer_ESP32_SC_W6100
Check the newmultiFileProject example for aHOWTO demo.
Please have a look atESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to have more detailed description and solution of the issue.
ADC1controls ADC function for pinsGPIO32-GPIO39ADC2controls ADC function for pinsGPIO0, 2, 4, 12-15, 25-27
Look in fileadc_common.c
In ADC2, there're two locks used for different cases:
lock shared with app and Wi-Fi:ESP32:When Wi-Fi using the ADC2, we assume it will never stop, so app checks the lock and returns immediately if failed.ESP32S2:The controller's control over the ADC is determined by the arbiter. There is no need to control by lock.
lock shared between tasks:when several tasks sharing the ADC2, we want to guaranteeall the requests will be handled.Since conversions are short (about 31us), app returns the lock very soon,we use a spinlock to stand there waiting to do conversions one by one.
adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.
- In order to use
ADC2for other functions, we have toacquire complicated firmware locks and very difficult to do - So, it's not advisable to use
ADC2with WiFi/BlueTooth (BT/BLE). - Use
ADC1, and pins GPIO32-GPIO39 - If somehow it's a must to use those pins serviced by
ADC2(GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27), use thefix mentioned at the end ofESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to work with ESP32 WiFi/BlueTooth (BT/BLE).
WebServerserver(80);
Creates theWebServer_ESP32_SC_W6100 class object.
Parameters:
host port number:int port (default is the standard HTTP port 80)
voidbegin();
voidhandleClient();
voidclose();voidstop();
Both methods function the same
voidon();voidaddHandler();voidonNotFound();voidonFileUpload();
Example:
server.on("/", handlerFunction);server.onNotFound(handlerFunction);// called when handler is not assignedserver.onFileUpload(handlerFunction);// handle file uploads
voidsend();voidsend_P();
Parameters:
code - HTTP response code, can be200 or404, etc.
content_type - HTTP content type, like"text/plain" or"image/png", etc.
content - actual content body
const String &arg();const String &argName();intargs();boolhasArg();
Function usage:
arg - get request argument value, usearg("plain") to get POST body
argName - get request argument name
args - get arguments count
hasArg - check if argument exist
const String &header();const String &headerName();const String &hostHeader();intheaders();boolhasHeader();
Function usage:
header - get request header value
headerName - get request header name
hostHeader - get request host header if available, else empty string
headers - get header count
hasHeader - check if header exist
boolauthenticate();voidrequestAuthentication();
Function usage:
authenticate - server authentication, returns true if client is authenticated else false
requestAuthentication - sends authentication failure response to the client
Example Usage:
if(!server.authenticate(username, password)){ server.requestAuthentication();}
const String &uri();// get the current uriHTTPMethodmethod();// get the current methodWiFiClientclient();// get the current clientHTTPUpload &upload();// get the current uploadvoidsetContentLength();// set content lengthvoidsendHeader();// send HTTP headervoidsendContent();// send contentvoidsendContent_P();voidcollectHeaders();// set the request headers to collectvoidserveStatic();size_tstreamFile();
You can change theINT pin to another one. Default isGPIO4
// Must connect INT to GPIOxx or not working#defineINT_GPIO4
| W6100 | <---> | ESP32_S3 |
|---|---|---|
| MOSI | <---> | GPIO11 |
| MISO | <---> | GPIO13 |
| SCK | <---> | GPIO12 |
| SS | <---> | GPIO10 |
| INT | <---> | GPIO4 |
| RST | <---> | RST |
| GND | <---> | GND |
| 3.3V | <---> | 3.3V |
| W6100 | <---> | ESP32_S2 |
|---|---|---|
| MOSI | <---> | GPIO35 |
| MISO | <---> | GPIO37 |
| SCK | <---> | GPIO36 |
| SS | <---> | GPIO34 |
| INT | <---> | GPIO4 |
| RST | <---> | RST |
| GND | <---> | GND |
| 3.3V | <---> | 3.3V |
| W6100 | <---> | ESP32_C3 |
|---|---|---|
| MOSI | <---> | GPIO6 |
| MISO | <---> | GPIO5 |
| SCK | <---> | GPIO4 |
| SS | <---> | GPIO7 |
| INT | <---> | GPIO10 |
| RST | <---> | RST |
| GND | <---> | GND |
| 3.3V | <---> | 3.3V |
- AdvancedWebServer
- HelloServer
- HelloServer2
- HttpBasicAuth
- MQTTClient_Auth
- MQTTClient_Basic
- MQTT_ThingStream
- PostServer
- SimpleAuthentication
- UdpNTPClient
- UdpSendReceive
- WebClient
- WebClientRepeating
- WebServer
- multiFileProject
ExampleAdvancedWebServer
| #if !( defined(ESP32) ) | |
| #error This code is designed for (SP32_S2/3, ESP32_C3 + W6100) to run on ESP32 platform! Please check your Tools->Board setting. | |
| #endif | |
| #defineDEBUG_ETHERNET_WEBSERVER_PORT Serial | |
| // Debug Level from 0 to 4 | |
| #define_ETHERNET_WEBSERVER_LOGLEVEL_3 | |
| ////////////////////////////////////////////////////////// | |
| // Optional values to override default settings | |
| // Don't change unless you know what you're doing | |
| //#define ETH_SPI_HOST SPI3_HOST | |
| //#define SPI_CLOCK_MHZ 25 | |
| // Must connect INT to GPIOxx or not working | |
| //#define INT_GPIO 4 | |
| //#define MISO_GPIO 13 | |
| //#define MOSI_GPIO 11 | |
| //#define SCK_GPIO 12 | |
| //#define CS_GPIO 10 | |
| // For ESP32_C3 | |
| // Optional values to override default settings | |
| // Don't change unless you know what you're doing | |
| //#define ETH_SPI_HOST SPI2_HOST | |
| //#define SPI_CLOCK_MHZ 25 | |
| // Must connect INT to GPIOxx or not working | |
| //#define INT_GPIO 10 | |
| //#define MISO_GPIO 5 | |
| //#define MOSI_GPIO 6 | |
| //#define SCK_GPIO 4 | |
| //#define CS_GPIO 7 | |
| ////////////////////////////////////////////////////////// | |
| #include<WebServer_ESP32_SC_W6100.h> | |
| WebServerserver(80); | |
| // Enter a MAC address and IP address for your controller below. | |
| #defineNUMBER_OF_MAC20 | |
| byte mac[][NUMBER_OF_MAC] = | |
| { | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x01 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x02 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x03 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x04 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x05 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x06 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x07 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x08 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x09 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x0A }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x0B }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x0C }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x0D }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x0E }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x0F }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x10 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x11 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x12 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xFE,0x13 }, | |
| {0xDE,0xAD,0xBE,0xEF,0xBE,0x14 }, | |
| }; | |
| // Select the IP address according to your local network | |
| IPAddressmyIP(192,168,2,232); | |
| IPAddressmyGW(192,168,2,1); | |
| IPAddressmySN(255,255,255,0); | |
| // Google DNS Server IP | |
| IPAddressmyDNS(8,8,8,8); | |
| int reqCount =0;// number of requests received | |
| voidhandleRoot() | |
| { | |
| #defineBUFFER_SIZE400 | |
| char temp[BUFFER_SIZE]; | |
| int sec =millis() /1000; | |
| int min = sec /60; | |
| int hr = min /60; | |
| int day = hr /24; | |
| hr = hr %24; | |
| snprintf(temp, BUFFER_SIZE -1, | |
| "<html>\ | |
| <head>\ | |
| <meta http-equiv='refresh' content='5'/>\ | |
| <title>AdvancedWebServer %s</title>\ | |
| <style>\ | |
| body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\ | |
| </style>\ | |
| </head>\ | |
| <body>\ | |
| <h2>Hi from WebServer_ESP32_SC_W6100!</h2>\ | |
| <h3>on %s</h3>\ | |
| <p>Uptime: %d d %02d:%02d:%02d</p>\ | |
| <img src=\"/test.svg\" />\ | |
| </body>\ | |
| </html>", BOARD_NAME, BOARD_NAME, day, hr %24, min %60, sec %60); | |
| server.send(200,F("text/html"), temp); | |
| } | |
| voidhandleNotFound() | |
| { | |
| String message =F("File Not Found\n\n"); | |
| message +=F("URI:"); | |
| message += server.uri(); | |
| message +=F("\nMethod:"); | |
| message += (server.method() == HTTP_GET) ?F("GET") :F("POST"); | |
| message +=F("\nArguments:"); | |
| message += server.args(); | |
| message +=F("\n"); | |
| for (uint8_t i =0; i < server.args(); i++) | |
| { | |
| message +="" + server.argName(i) +":" + server.arg(i) +"\n"; | |
| } | |
| server.send(404,F("text/plain"), message); | |
| } | |
| voiddrawGraph() | |
| { | |
| String out; | |
| out.reserve(3000); | |
| char temp[70]; | |
| out +=F("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"310\" height=\"150\">\n"); | |
| out +=F("<rect width=\"310\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"2\" stroke=\"rgb(0, 0, 0)\" />\n"); | |
| out +=F("<g stroke=\"blue\">\n"); | |
| int y =rand() %130; | |
| for (int x =10; x <300; x +=10) | |
| { | |
| int y2 =rand() %130; | |
| sprintf(temp,"<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"2\" />\n", x,140 - y, x +10,140 - y2); | |
| out += temp; | |
| y = y2; | |
| } | |
| out +=F("</g>\n</svg>\n"); | |
| server.send(200,F("image/svg+xml"), out); | |
| } | |
| voidsetup() | |
| { | |
| Serial.begin(115200); | |
| while (!Serial && (millis() <5000)); | |
| delay(500); | |
| Serial.print(F("\nStart AdvancedWebServer on")); | |
| Serial.print(ARDUINO_BOARD); | |
| Serial.print(F(" with")); | |
| Serial.println(SHIELD_TYPE); | |
| Serial.println(WEBSERVER_ESP32_SC_W6100_VERSION); | |
| ET_LOGWARN(F("Default SPI pinout:")); | |
| ET_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); | |
| ET_LOGWARN1(F("MOSI:"), MOSI_GPIO); | |
| ET_LOGWARN1(F("MISO:"), MISO_GPIO); | |
| ET_LOGWARN1(F("SCK:"), SCK_GPIO); | |
| ET_LOGWARN1(F("CS:"), CS_GPIO); | |
| ET_LOGWARN1(F("INT:"), INT_GPIO); | |
| ET_LOGWARN1(F("SPI Clock (MHz):"), SPI_CLOCK_MHZ); | |
| ET_LOGWARN(F("=========================")); | |
| /////////////////////////////////// | |
| // To be called before ETH.begin() | |
| ESP32_W6100_onEvent(); | |
| // start the ethernet connection and the server: | |
| // Use DHCP dynamic IP and random mac | |
| //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, | |
| // int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac); | |
| ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); | |
| //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] ); | |
| // Static IP, leave without this line to get IP via DHCP | |
| //bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0); | |
| //ETH.config(myIP, myGW, mySN, myDNS); | |
| ESP32_W6100_waitForConnect(); | |
| /////////////////////////////////// | |
| server.on(F("/"), handleRoot); | |
| server.on(F("/test.svg"), drawGraph); | |
| server.on(F("/inline"), []() | |
| { | |
| server.send(200,F("text/plain"),F("This works as well")); | |
| }); | |
| server.onNotFound(handleNotFound); | |
| server.begin(); | |
| Serial.print(F("HTTP EthernetWebServer is @ IP :")); | |
| Serial.println(ETH.localIP()); | |
| } | |
| voidheartBeatPrint() | |
| { | |
| staticint num =1; | |
| Serial.print(F(".")); | |
| if (num ==80) | |
| { | |
| Serial.println(); | |
| num =1; | |
| } | |
| elseif (num++ %10 ==0) | |
| { | |
| Serial.print(F("")); | |
| } | |
| } | |
| voidcheck_status() | |
| { | |
| staticunsignedlong checkstatus_timeout =0; | |
| #defineSTATUS_CHECK_INTERVAL10000L | |
| // Send status report every STATUS_REPORT_INTERVAL (60) seconds: we don't need to send updates frequently if there is no status change. | |
| if ((millis() > checkstatus_timeout) || (checkstatus_timeout ==0)) | |
| { | |
| heartBeatPrint(); | |
| checkstatus_timeout =millis() + STATUS_CHECK_INTERVAL; | |
| } | |
| } | |
| voidloop() | |
| { | |
| server.handleClient(); | |
| check_status(); | |
| } |
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onESP32S3_DEV withESP32_S3_W6100
Start AdvancedWebServer on ESP32S3_DEV with ESP32_S3_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:11[EWS] MISO:13[EWS] SCK:12[EWS] CS:10[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: FE:ED:DE:AD:BE:EF, IPv4: 192.168.2.92FULL_DUPLEX, 100MbpsHTTP EthernetWebServer is @ IP : 192.168.2.92.......... ..........
The terminal output ofESP32S3_DEV with W6100 runningMQTT_ThingStream example
Start MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:11[EWS] MISO:13[EWS] SCK:12[EWS] CS:10[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: FE:ED:DE:AD:BE:EF, IPv4: 192.168.2.92FULL_DUPLEX, 100Mbps***************************************ESP32_Pub***************************************MQTT Message Send : ESP32_Pub => Hello from MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_W6100MQTT Message receive [ESP32_Pub] Hello from MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_W6100MQTT Message Send : ESP32_Pub => Hello from MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_W6100MQTT Message receive [ESP32_Pub] Hello from MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_W6100
The terminal output ofESP32S3_DEV with W6100 runningMQTTClient_Auth example
Start MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:11[EWS] MISO:13[EWS] SCK:12[EWS] CS:10[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: FE:ED:DE:AD:BE:EF, IPv4: 192.168.2.92FULL_DUPLEX, 100MbpsMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100Message Send : MQTT_Pub => Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100Message Send : MQTT_Pub => Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_W6100
The terminal output ofESP32S3_DEV with W6100 runningMQTTClient_Basic example
Start MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:11[EWS] MISO:13[EWS] SCK:12[EWS] CS:10[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: FE:ED:DE:AD:BE:EF, IPv4: 192.168.2.92FULL_DUPLEX, 100MbpsMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W6100Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W6100Message Send : MQTT_Pub => Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W6100Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W6100
The terminal output ofESP32S3_DEV with W6100 runningWebClient example
Start WebClient on ESP32S3_DEV with ESP32_S3_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:11[EWS] MISO:13[EWS] SCK:12[EWS] CS:10[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: FE:ED:DE:AD:BE:EF, IPv4: 192.168.2.92FULL_DUPLEX, 100MbpsStarting connection to server...Connected to serverHTTP/1.1 200 OKDate: Mon, 09 Jan 2023 01:21:45 GMTContent-Type: text/plainContent-Length: 2263Connection: closex-amz-id-2: EKWOQIV3OtqyCUd533QWXOYGvF2DD51u23rQuLBaJt6v4E0hVOt49GRgOUiM5i2TP9yxxPLa2RQ=x-amz-request-id: 4VCH7764PHR2CRJ2Last-Modified: Wed, 23 Feb 2022 14:56:42 GMTETag: "667cf48afcc12c38c8c1637947a04224"CF-Cache-Status: DYNAMICReport-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=navtEfOiCL7xNT8qGTiEZ1UZ9kvlNaljPm1tjQoPiZFJVefodYpvh8UcMH2AXQrjxgoYeHcRMvymGTVRtOD7hAAieYvu15WUu8WvUy5lTeifuNhfzMc5fqGSjjbewvQ%3D"}],"group":"cf-nel","max_age":604800}NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}Server: cloudflareCF-RAY: 78695b9cd964e6b0-EWRalt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400 `:;;;,` .:;;:. .;;;;;;;;;;;` :;;;;;;;;;;: TM `;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;; ;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;; .;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;; ;;;;;; ;;;;;;; ;;;;;;, ;;;;;;. ,;;;;; ;;;;;;.;;;;;;` ;;;;;; ;;;;;. ;;;;;;;;;;;` ``` ;;;;;` ;;;;; ;;;;;;;;;, ;;; .;;;;;`;;;;: `;;;;;;;; ;;; ;;;;;,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;.;;;;. ;;;;;;;. ;;; ;;;;; ;;;;; ;;;;;;;;; ;;; ;;;;; ;;;;; .;;;;;;;;;; ;;; ;;;;;, ;;;;;; `;;;;;;;;;;;; ;;;;; `;;;;;, .;;;;;; ;;;;;;; ;;;;;; ;;;;;;: :;;;;;;. ;;;;;;; ;;;;;; ;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;: ;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;; `;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;: ,;;;;;;;;;;;;;, ;;;;;;;;;;;;;; .;;;;;;;;;` ,;;;;;;;;: ;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;; ;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;; ,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;; ;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;. ;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;` ,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;; ;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;; ;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;; Disconnecting from server...
The terminal output ofESP32S2_DEV with W6100 runningUDPSendReceive example
Start UDPSendReceive on ESP32S2_DEV with ESP32_S2_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:35[EWS] MISO:37[EWS] SCK:36[EWS] CS:34[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: 7E:DF:A1:08:64:27, IPv4: 192.168.2.132FULL_DUPLEX, 100MbpsStarting connection to server...Listening on port 2390UDP Packet received, size 48From 132.163.97.6, port 123Seconds since Jan 1 1900 = 3882217033Unix time = 1673228233The UTC time is 1:37:13
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onESP32S2_DEV withESP32_S2_W6100. Thebuilt-in MAC address is used now instead of user-defined one.
Start AdvancedWebServer on ESP32S2_DEV with ESP32_S2_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:2[EWS] MOSI:35[EWS] MISO:37[EWS] SCK:36[EWS] CS:34[EWS] INT:4[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: 7E:DF:A1:08:64:27, IPv4: 192.168.2.132FULL_DUPLEX, 100MbpsHTTP EthernetWebServer is @ IP : 192.168.2.132...
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onESP32C3_DEV withESP32_C3_W6100. Thebuilt-in MAC address is used now instead of user-defined one.
Start AdvancedWebServer on ESP32C3_DEV with ESP32_C3_W6100WebServer_ESP32_SC_W6100 v1.2.1for core v2.0.0+[EWS] Default SPI pinout:[EWS] SPI_HOST:1[EWS] MOSI:6[EWS] MISO:5[EWS] SCK:4[EWS] CS:7[EWS] INT:10[EWS] SPIClock (MHz): 25[EWS] =========================ETH StartedETH ConnectedETH MAC: 7C:DF:A1:DA:68:BF, IPv4: 192.168.2.159FULL_DUPLEX, 100MbpsHTTP EthernetWebServer is @ IP : 192.168.2.159...
Debug is enabled by default on Serial. Debug Level from 0 to 4. To disable, change theETHERNET_WEBSERVER_LOGLEVEL to 0
// Use this to output debug msgs to Serial#defineDEBUG_ETHERNET_WEBSERVER_PORT Serial// Use this to disable all output debug msgs// Debug Level from 0 to 4#define_ETHERNET_WEBSERVER_LOGLEVEL_0
If you get compilation errors, more often than not, you may need to install a newer version of the board's core, applying Libraries' Patches, Packages' Patches or this library latest version.
Submit issues to:WebServer_ESP32_SC_W6100 issues
- Bug Searching and Killing
- Add support toESP32_S2/S3C3-based boards using
LwIP W6100 Ethernet - Using
SPI_DMA_CH_AUTOinstead of manually selected - Add examplemultiFileProject
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.
- Based on theIvan Grokhotkov's ESP32 WebServer andHTTPClient Library libraries
![]() ⭐️ Ivan Grokhotkov | ![]() avanderhoest |
If you want to contribute to this project:
- Report bugs and errors
- Ask for enhancements
- Create issues and pull requests
- Tell other people about this library
- The library is licensed underGPLv3
Copyright (c) 2016- Ivan Grokhotkov
Copyright (c) 2022- Khoi Hoang
About
Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for ESP32S2/S3/C3 boards using LwIP W6100 Ethernet library. The WebServer supports HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time. It provides HTTP(S), MQTT(S) Client, supports WebServer serving from LittleFS/SPIFFS
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.









