Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for WT32_ETH01 boards using LAN8720 Ethernet. 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 and supports WebServer serving from LittleFS/SPIFFS. Now supporting ESP32 core v2.0.0+
Please have a look at HOWTO Fix Multiple Definitions
Linker Error
ESP32 Core v2.0.0+
introduces new enum breaking almost all WT32_ETH01
codes written for core v1.0.6-
.
It's really strange to define a breaking enum arduino_event_id_t
in WiFiGeneric.h#L36-L78, compared to the old system_event_id_t
, now placed in esp_event_legacy.h#L29-L63
It's better to preserve the old enum order and just adding new items to do no harm to pre-2.0.0 codes
v1.2.0-
to be used for ESP32 core v1.0.6-
onlyv1.3.0
can be used for either ESP32 core v2.0.0+
or v1.0.6-
. Default is using core v2.0.0+
To use with core v1.0.6-, just define in your sketch
#define USING_CORE_ESP32_CORE_V200_PLUS false
v1.4.0+
can be used for either ESP32 core v2.0.0+
or v1.0.6-
. Autodetect core
This WebServer_WT32_ETH01 library is a simple yet complete WebServer wrapper library for ESP32-based WT32_ETH01 boards using LAN8720 Ethernet. The functions are similar and compatible to those of ESP32 WebServer
and ESP8266WebServer
libraries to make life much easier to port sketches from ESP8266/ESP32.
This WebServer_WT32_ETH01 library also provides high-level HTTP(S), MQTT(S) and WebSockets Client by using the functions from ESP32's HTTPClient Library
The library provides these features:
Library is just a wrapper for:
This WebServer_WT32_ETH01 library currently supports these following boards:
Arduino IDE 1.8.19+
for Arduino.
ESP32 Core 2.0.5+
for ESP32-based WT32_ETH01 boards using release v1.3.0+
.
ESP32 Core 1.0.6-
for ESP32-based WT32_ETH01 boards using release v1.2.0-
The best and easiest way is to use Arduino Library Manager
. Search for WebServer_WT32_ETH01
, then select / install the latest version.
You can also use this link for more detailed instructions.
WebServer_WT32_ETH01-main.zip
.WebServer_WT32_ETH01-main
directoryWebServer_WT32_ETH01-main
folder to Arduino libraries' directory such as ~/Arduino/libraries/
.To fix ESP32 compile error
, just copy the following file into the ESP32
cores/esp32 directory (e.g. ./arduino-1.8.16/hardware/espressif/cores/esp32) to overwrite the old file:
Multiple Definitions
Linker ErrorThe current library implementation, using xyz-Impl.h
instead of standard xyz.cpp
, possibly creates certain Multiple 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_WT32_ETH01.hpp" //https://github.com/khoih-prog/WebServer_WT32_ETH01
in many files. But be sure to use the following .h
file in just 1 .h
, .cpp
or .ino
file, which must not be included in any other file, to avoid Multiple Definitions
Linker Error
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "WebServer_WT32_ETH01.h" //https://github.com/khoih-prog/WebServer_WT32_ETH01
Check the new multiFileProject example for a HOWTO
demo.
Please have a look at ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to have more detailed description and solution of the issue.
Look in file adc_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 guarantee all 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.
WebServer server(80);
Creates the WebServer_WT32_ETH01 class object.
Parameters:
host port number: int port
(default is the standard HTTP port 80)
Starting the server
void begin();
Handling incoming client requests
void handleClient();
Disabling the server
void close();
void stop();
Both methods function the same
Client request handlers
void on();
void addHandler();
void onNotFound();
void onFileUpload();
Example:
server.on("/", handlerFunction);
server.onNotFound(handlerFunction); // called when handler is not assigned
server.onFileUpload(handlerFunction); // handle file uploads
Sending responses to the client
void send();
void send_P();
Parameters:
code
- HTTP response code, can be 200
or 404
, etc.
content_type
- HTTP content type, like "text/plain"
or "image/png"
, etc.
content
- actual content body
Getting information about request arguments
const String & arg();
const String & argName();
int args();
bool hasArg();
Function usage:
arg
- get request argument value, use arg("plain")
to get POST body
argName
- get request argument name
args
- get arguments count
hasArg
- check if argument exist
Getting information about request headers
const String & header();
const String & headerName();
const String & hostHeader();
int headers();
bool hasHeader();
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
Authentication
bool authenticate();
void requestAuthentication();
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 uri
HTTPMethod method(); // get the current method
WiFiClient client(); // get the current client
HTTPUpload & upload(); // get the current upload
void setContentLength(); // set content length
void sendHeader(); // send HTTP header
void sendContent(); // send content
void sendContent_P();
void collectHeaders(); // set the request headers to collect
void serveStatic();
size_t streamFile();
The following are debug terminal output and screen shot when running example AdvancedWebServer on ESP32_DEV with ETH_PHY_LAN8720 (WT32_ETH01)
Starting AdvancedWebServer on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH Started
ETH Connected
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.127, FULL_DUPLEX, 100Mbps
HTTP EthernetWebServer is @ IP : 192.168.2.127
..
The terminal output of WT32_ETH01 running ESP32_FS_EthernetWebServer
Starting ESP32_FS_EthernetWebServer on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH Started
ETH Connected
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.127, FULL_DUPLEX, 100Mbps
/home/kh/Arduino/libraries/LITTLEFS-master/src/lfs.c:1003:error: Corrupted dir pair at {0x0, 0x1}
E (4029) esp_littlefs: mount failed, (-84)
E (4033) esp_littlefs: Failed to initialize LittleFS
HTTP server started @192.168.2.127
Open http://192.168.2.127/edit to see the file browser
handleFileRead: /
handleFileUpload Name: /CanadaFlag_1.png
handleFileUpload Size: 41214
handleFileUpload Name: /CanadaFlag_2.png
handleFileUpload Size: 8311
handleFileUpload Name: /CanadaFlag_3.jpg
handleFileUpload Size: 11156
handleFileUpload Name: /edit.htm.gz
handleFileUpload Size: 4116
handleFileUpload Name: /favicon.ico
handleFileUpload Size: 1150
handleFileUpload Name: /graphs.js.gz
handleFileUpload Size: 1971
handleFileUpload Name: /index.htm
handleFileUpload Size: 3721
handleFileRead: /
handleFileRead: /graphs.js
handleFileRead: /edit.htm
handleFileRead: /index.htm
handleFileList: /
handleFileList: [{"type":"file","name":"CanadaFlag_1.png"},{"type":"file","name":"CanadaFlag_2.png"},{"type":"file","name":"CanadaFlag_3.jpg"},{"type":"file","name":"edit.htm.gz"},{"type":"file","name":"favicon.ico"},{"type":"file","name":"graphs.js.gz"},{"type":"file","name":"index.htm"}]
handleFileRead: /CanadaFlag_1.png
and the screen shot of the WebServer
The terminal output of WT32_ETH01 running MQTT_ThingStream example
Starting MQTT_ThingStream on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
***************************************
esp32-sniffer/12345678/ble
***************************************
Attempting MQTT connection to mqtt.thingstream.io
...connected
Published connection message successfully!
Subscribed to: esp32-sniffer/12345678/ble
MQTT Message Send : esp32-sniffer/12345678/ble => Hello from MQTT_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
MQTT Message receive [esp32-sniffer/12345678/ble] Hello from MQTT_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
MQTT Message Send : esp32-sniffer/12345678/ble => Hello from MQTT_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
MQTT Message receive [esp32-sniffer/12345678/ble] Hello from MQTT_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
The terminal output of WT32_ETH01 running MQTTClient_Auth example
Starting MQTTClient_Auth on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Attempting MQTT connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on WT32-ETH01 with ETH_PHY_LAN8720
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on WT32-ETH01 with ETH_PHY_LAN8720
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on WT32-ETH01 with ETH_PHY_LAN8720
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on WT32-ETH01 with ETH_PHY_LAN8720
The terminal output of WT32_ETH01 running MQTTClient_Basic example
Starting MQTTClient_Basic on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Attempting MQTT connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
Message Send : MQTT_Pub => Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
Message Send : MQTT_Pub => Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
The terminal output of WT32_ETH01 running WebClient example
Starting WebClient on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Starting connection to server...
Connected to server
HTTP/1.1 200 OK
Server: nginx/1.4.2
Date: Tue, 06 Jul 2021 04:36:48 GMT
Content-Type: text/plain
Content-Length: 2263
Last-Modified: Wed, 02 Oct 2013 13:46:47 GMT
Connection: close
Vary: Accept-Encoding
ETag: "524c23c7-8d7"
Accept-Ranges: bytes
`:;;;,` .:;;:.
.;;;;;;;;;;;` :;;;;;;;;;;: TM
`;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;;
:;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;;
;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;;
.;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;;
;;;;;; ;;;;;;; ;;;;;;, ;;;;;;.
,;;;;; ;;;;;;.;;;;;;` ;;;;;;
;;;;;. ;;;;;;;;;;;` ``` ;;;;;`
;;;;; ;;;;;;;;;, ;;; .;;;;;
`;;;;: `;;;;;;;; ;;; ;;;;;
,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;
:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;
:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;
.;;;;. ;;;;;;;. ;;; ;;;;;
;;;;; ;;;;;;;;; ;;; ;;;;;
;;;;; .;;;;;;;;;; ;;; ;;;;;,
;;;;;; `;;;;;;;;;;;; ;;;;;
`;;;;;, .;;;;;; ;;;;;;; ;;;;;;
;;;;;;: :;;;;;;. ;;;;;;; ;;;;;;
;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;:
;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;;
`;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;:
,;;;;;;;;;;;;;, ;;;;;;;;;;;;;;
.;;;;;;;;;` ,;;;;;;;;:
;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;;
;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;;
,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;;
;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;.
;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;`
,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;;
;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;;
;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
Disconnecting from server...
The terminal output of WT32_ETH01 running UdpNTPClient example
Starting UdpNTPClient on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH Started
ETH Connected
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.95
FULL_DUPLEX, 100Mbps
UDP Packet received, size 48
From 132.163.96.4, port 123
Seconds since Jan 1 1900 = 3847154050
Unix time = 1638165250
The UTC time is 5:54:10
UDP Packet received, size 48
From 132.163.96.4, port 123
Seconds since Jan 1 1900 = 3847154062
Unix time = 1638165262
The UTC time is 5:54:22
UDP Packet received, size 48
From 132.163.96.4, port 123
Seconds since Jan 1 1900 = 3847154074
Unix time = 1638165274
The UTC time is 5:54:34
UDP Packet received, size 48
From 132.163.96.4, port 123
Seconds since Jan 1 1900 = 3847154086
Unix time = 1638165286
The UTC time is 5:54:46
The terminal output of WT32_ETH01 running BasicHttpClient example
Starting BasicHttpClient on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
[HTTP] begin...
[HTTP] GET...
[HTTP] GET... code: 200
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
The terminal output of WT32_ETH01 running BasicHttpsClient example
Starting BasicHttpsClient on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Waiting for NTP time sync: .
Current time: Tue Jul 6 05:29:39 2021
[HTTPS] begin...
[HTTPS] GET...
[HTTPS] GET... code: 200
<HTML>
<HEAD>
<!-- Created with AOLpress/2.0 -->
<TITLE>Connection Header</TITLE>
</HEAD>
<BODY>
<P>
<IMG ALT="Jigsaw" BORDER="0" WIDTH="212" HEIGHT="49" SRC="/icons/jigsaw">
<H1>
The <I>Connection</I> header
</H1>
<P>
This page will be served to you with the following headers:
<P>
<CODE>ExtensionHeader: ExtensionValue<BR>
Connection: ExtensionHeader</CODE>
<P>
If you're getting this page through a proxy, you should <I>not</I> see the
<I>ExtensionHeader</I> !
<P>
<HR>
<BR>
<A HREF="mailto:[email protected]">[email protected]</A>
</BODY></HTML>
Waiting 10s before the next round...
The terminal output of WT32_ETH01 running WebClientMulti_SSL example
Starting WebClientMulti_SSL on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Waiting for NTP time sync: .
Current time: Tue Jul 6 19:58:27 2021
Connecting to www.arduino.cc...
Took: 2312
HTTP/1.1 200 OK
Date: Tue, 06 Jul 2021 19:58:31 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: close
Last-Modified: Wed, 02 Oct 2013 13:46:47 GMT
Vary: Accept-Encoding
Strict-Transport-Security: max-age=500; includeSubDomains
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 66ab6888bbc63fd9-YYZ
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
8d7
`:;;;,` .:;;:.
.;;;;;;;;;;;` :;;;;;;;;;;: TM
`;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;;
:;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;;
;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;;
.;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;;
;;;;;; ;;;;;;; ;;;;;;, ;;;;;;.
,;;;;; ;;;;;;.;;;;;;` ;;;;;;
;;;;;. ;;;;;;;;;;;` ``` ;;;;;`
;;;;; ;;;;;;;;;, ;;; .;;;;;
`;;;;: `;;;;;;;; ;;; ;;;;;
,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;
:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;
:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;
.;;;;. ;;;;;;;. ;;; ;;;;;
;;;;; ;;;;;;;;; ;;; ;;;;;
;;;;; .;;;;;;;;;; ;;; ;;;;;,
;;;;;; `;;;;;;;;;;;; ;;;;;
`;;;;;, .;;;;;; ;;;;;;; ;;;;;;
;;;;;;: :;;;;;;. ;;;;;;; ;;;;;;
;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;:
;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;;
`;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;:
,;;;;;;;;;;;;;, ;;;;;;;;;;;;;;
.;;;;;;;;;` ,;;;;;;;;:
;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;;
;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;;
,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;;
;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;.
;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;`
,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;;
;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;;
;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
0
LoopCount 1, Received 2876 bytes
Disconnecting.
Connecting to www.cloudflare.com...
Took: 2249
HTTP/1.1 200 OK
Date: Tue, 06 Jul 2021 19:58:54 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: close
Access-Control-Allow-Origin: *
Server: cloudflare
CF-RAY: 66ab6913cedb3ff1-YYZ
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Cache-Control: no-cache
ba
fl=29f93
h=www.cloudflare.com
ip=45.72.193.56
ts=1625601534.066
visit_scheme=https
uag=SSLClientOverEthernet
colo=YYZ
http=http/1.1
loc=CA
tls=TLSv1.2
sni=plaintext
warp=off
gateway=off
0
LoopCount 2, Received 529 bytes
Disconnecting.
The terminal output of WT32_ETH01 running MQTTClient_SSL_Complex example
Starting MQTTClient_SSL_Complex on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Waiting for NTP time sync: .
Current time: Tue Jul 6 18:14:02 2021
Attempting MQTT connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Complex on WT32-ETH01, millis = 5718
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Complex on WT32-ETH01, millis = 5718
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Complex on WT32-ETH01, millis = 10719
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Complex on WT32-ETH01, millis = 10719
The terminal output of WT32_ETH01 running MQTTS_ThingStream example
Starting MQTTS_ThingStream on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Waiting for NTP time sync: .
Current time: Tue Jul 6 18:38:22 2021
***************************************
esp32-sniffer/12345678/ble
***************************************
Attempting MQTT connection to mqtt.thingstream.io
...connected
Published connection message successfully!
Subscribed to: esp32-sniffer/12345678/ble
MQTT Message Send : esp32-sniffer/12345678/ble => Hello from MQTTS_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
MQTT Message receive [esp32-sniffer/12345678/ble] Hello from MQTTS_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
MQTT Message Send : esp32-sniffer/12345678/ble => Hello from MQTTS_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
MQTT Message receive [esp32-sniffer/12345678/ble] Hello from MQTTS_ThingStream on WT32-ETH01 with ETH_PHY_LAN8720
The terminal output of WT32_ETH01 running MQTTClient_SSL example
Starting MQTTClient_SSL on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Waiting for NTP time sync: .
Current time: Tue Jul 6 17:11:00 2021
Attempting MQTTS connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_SSL on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL on WT32-ETH01
The terminal output of WT32_ETH01 running MQTTClient_SSL_Auth example
Starting MQTTClient_SSL_Auth on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
Waiting for NTP time sync: .
Current time: Tue Jul 6 18:05:14 2021
Attempting MQTTS connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message Send : MQTT_Pub => Hello from MQTTClient_SSL_Auth on WT32-ETH01
Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Auth on WT32-ETH01
Debug is enabled by default on Serial. Debug Level from 0 to 4. To disable, change the ETHERNET_WEBSERVER_LOGLEVEL to 0
// Use this to output debug msgs to Serial
#define DEBUG_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_WT32_ETH01 issues
multiple-definitions
linker error.Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.
⭐️ Ivan Grokhotkov |
Sardar Azari |
DSikes |
If you want to contribute to this project:
Copyright (c) 2021- Khoi Hoang