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

Commit dccec6b

Browse files
authored
v1.4.1 to fix examples' bug
#### Releases v1.4.1 1. Fix bug in examples to reduce connection time
1 parent 360f2e5 commit dccec6b

File tree

31 files changed

+120
-139
lines changed

31 files changed

+120
-139
lines changed

README.md

Lines changed: 20 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100

101101
#### Important notes
102102

103-
ESP32 Core v2.0.0 introduces new enum breaking almost all `WT32_ETH01` codes written for core v1.0.6-.
103+
ESP32 Core v2.0.0+ introduces new enum breaking almost all `WT32_ETH01` codes written for core v1.0.6-.
104104

105105
It's really strange to define a breaking enum `arduino_event_id_t` in [**WiFiGeneric.h**#L36-L78](https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiGeneric.h#L36-L78), compared to the old `system_event_id_t`, now placed in [**esp_event_legacy.h**#L29-L63](https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/esp32/include/esp_event/include/esp_event_legacy.h#L29-L63)
106106

@@ -115,7 +115,7 @@ To use with core v1.0.6-, just define in your sketch
115115
#define USING_CORE_ESP32_CORE_V200_PLUS false
116116
```
117117

118-
- Releases v1.4.0 can be used for either ESP32 core v2.0.0+ or v1.0.6-. **Autodetect core**
118+
- Releases v1.4.0+ can be used for either ESP32 core v2.0.0+ or v1.0.6-. **Autodetect core**
119119

120120

121121
#### Features
@@ -453,8 +453,6 @@ IPAddress mySN(255, 255, 255, 0);
453453
// Google DNS Server IP
454454
IPAddress myDNS(8, 8, 8, 8);
455455

456-
bool eth_connected = false;
457-
458456
int reqCount = 0; // number of requests received
459457

460458
void handleRoot()
@@ -532,55 +530,6 @@ void drawGraph()
532530
server.send(200, F("image/svg+xml"), out);
533531
}
534532

535-
void WiFiEvent(WiFiEvent_t event)
536-
{
537-
switch (event)
538-
{
539-
case SYSTEM_EVENT_ETH_START:
540-
Serial.println("\nETH Started");
541-
//set eth hostname here
542-
ETH.setHostname("WT32-ETH01");
543-
break;
544-
case SYSTEM_EVENT_ETH_CONNECTED:
545-
Serial.println("ETH Connected");
546-
break;
547-
548-
case SYSTEM_EVENT_ETH_GOT_IP:
549-
if (!eth_connected)
550-
{
551-
Serial.print("ETH MAC: ");
552-
Serial.print(ETH.macAddress());
553-
Serial.print(", IPv4: ");
554-
Serial.print(ETH.localIP());
555-
556-
if (ETH.fullDuplex())
557-
{
558-
Serial.print(", FULL_DUPLEX");
559-
}
560-
561-
Serial.print(", ");
562-
Serial.print(ETH.linkSpeed());
563-
Serial.println("Mbps");
564-
eth_connected = true;
565-
}
566-
567-
break;
568-
569-
case SYSTEM_EVENT_ETH_DISCONNECTED:
570-
Serial.println("ETH Disconnected");
571-
eth_connected = false;
572-
break;
573-
574-
case SYSTEM_EVENT_ETH_STOP:
575-
Serial.println("\nETH Stopped");
576-
eth_connected = false;
577-
break;
578-
579-
default:
580-
break;
581-
}
582-
}
583-
584533
void setup()
585534
{
586535
Serial.begin(115200);
@@ -593,6 +542,9 @@ void setup()
593542
Serial.println(" with " + String(SHIELD_TYPE));
594543
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
595544

545+
// To be called before ETH.begin()
546+
WT32_ETH01_onEvent();
547+
596548
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
597549
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
598550
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
@@ -602,10 +554,7 @@ void setup()
602554
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
603555
ETH.config(myIP, myGW, mySN, myDNS);
604556

605-
WiFi.onEvent(WiFiEvent);
606-
607-
while (!eth_connected)
608-
delay(100);
557+
WT32_ETH01_waitForConnect();
609558

610559
server.on(F("/"), handleRoot);
611560
server.on(F("/test.svg"), drawGraph);
@@ -674,7 +623,7 @@ The following are debug terminal output and screen shot when running example [Ad
674623
675624
```
676625
Starting AdvancedWebServer on ESP32_DEV with ETH_PHY_LAN8720
677-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
626+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
678627

679628
ETH Started
680629
ETH Connected
@@ -692,7 +641,7 @@ The terminal output of **WT32_ETH01** running [ESP32_FS_EthernetWebServer](examp
692641
693642
```cpp
694643
Starting ESP32_FS_EthernetWebServer on ESP32_DEV with ETH_PHY_LAN8720
695-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
644+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
696645
697646
ETH Started
698647
ETH Connected
@@ -742,7 +691,7 @@ The terminal output of **WT32_ETH01** running [MQTT_ThingStream example](example
742691

743692
```
744693
Starting MQTT_ThingStream on ESP32_DEV with ETH_PHY_LAN8720
745-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
694+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
746695
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
747696
***************************************
748697
esp32-sniffer/12345678/ble
@@ -766,7 +715,7 @@ The terminal output of **WT32_ETH01** running [MQTTClient_Auth example](examples
766715

767716
```
768717
Starting MQTTClient_Auth on ESP32_DEV with ETH_PHY_LAN8720
769-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
718+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
770719
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
771720
Attempting MQTT connection to broker.emqx.io...connected
772721
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on WT32-ETH01 with ETH_PHY_LAN8720
@@ -783,7 +732,7 @@ The terminal output of **WT32_ETH01** running [MQTTClient_Basic example](example
783732

784733
```
785734
Starting MQTTClient_Basic on ESP32_DEV with ETH_PHY_LAN8720
786-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
735+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
787736
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
788737
Attempting MQTT connection to broker.emqx.io...connected
789738
Message Send : MQTT_Pub => Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PHY_LAN8720
@@ -803,7 +752,7 @@ The terminal output of **WT32_ETH01** running [WebClient example](examples/WebCl
803752

804753
```
805754
Starting WebClient on ESP32_DEV with ETH_PHY_LAN8720
806-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
755+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
807756
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
808757
809758
Starting connection to server...
@@ -871,7 +820,7 @@ The terminal output of **WT32_ETH01** running [UdpNTPClient example](examples/Ud
871820

872821
```
873822
Starting UdpNTPClient on ESP32_DEV with ETH_PHY_LAN8720
874-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
823+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
875824
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
876825
UDP Packet received, size 48
877826
From 132.163.97.1, port 123
@@ -900,7 +849,7 @@ The terminal output of **WT32_ETH01** running [BasicHttpClient example](examples
900849

901850
```
902851
Starting BasicHttpClient on ESP32_DEV with ETH_PHY_LAN8720
903-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
852+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
904853
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
905854
[HTTP] begin...
906855
[HTTP] GET...
@@ -962,7 +911,7 @@ The terminal output of **WT32_ETH01** running [BasicHttpsClient example](example
962911

963912
```
964913
Starting BasicHttpsClient on ESP32_DEV with ETH_PHY_LAN8720
965-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
914+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
966915
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
967916
Waiting for NTP time sync: .
968917
Current time: Tue Jul 6 05:29:39 2021
@@ -1007,7 +956,7 @@ The terminal output of **WT32_ETH01** running [WebClientMulti_SSL example](examp
1007956

1008957
```
1009958
Starting WebClientMulti_SSL on ESP32_DEV with ETH_PHY_LAN8720
1010-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
959+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
1011960
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
1012961
Waiting for NTP time sync: .
1013962
Current time: Tue Jul 6 19:58:27 2021
@@ -1121,7 +1070,7 @@ The terminal output of **WT32_ETH01** running [MQTTClient_SSL_Complex example](e
11211070

11221071
```
11231072
Starting MQTTClient_SSL_Complex on ESP32_DEV with ETH_PHY_LAN8720
1124-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
1073+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
11251074
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
11261075
Waiting for NTP time sync: .
11271076
Current time: Tue Jul 6 18:14:02 2021
@@ -1141,7 +1090,7 @@ The terminal output of **WT32_ETH01** running [MQTTS_ThingStream example](exampl
11411090

11421091
```
11431092
Starting MQTTS_ThingStream on ESP32_DEV with ETH_PHY_LAN8720
1144-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
1093+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
11451094
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
11461095
Waiting for NTP time sync: .
11471096
Current time: Tue Jul 6 18:38:22 2021
@@ -1167,7 +1116,7 @@ The terminal output of **WT32_ETH01** running [MQTTClient_SSL example](examples/
11671116

11681117
```
11691118
Starting MQTTClient_SSL on ESP32_DEV with ETH_PHY_LAN8720
1170-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
1119+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
11711120
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
11721121
Waiting for NTP time sync: .
11731122
Current time: Tue Jul 6 17:11:00 2021
@@ -1192,7 +1141,7 @@ The terminal output of **WT32_ETH01** running [MQTTClient_SSL_Auth example](exam
11921141

11931142
```
11941143
Starting MQTTClient_SSL_Auth on ESP32_DEV with ETH_PHY_LAN8720
1195-
WebServer_WT32_ETH01 v1.4.0 for core v2.0.0+
1144+
WebServer_WT32_ETH01 v1.4.1 for core v2.0.0+
11961145
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
11971146
Waiting for NTP time sync: .
11981147
Current time: Tue Jul 6 18:05:14 2021

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.4.1](#releases-v141)
1516
* [Releases v1.4.0](#releases-v140)
1617
* [Releases v1.3.0](#releases-v130)
1718
* [Releases v1.2.0](#releases-v120)
@@ -23,6 +24,10 @@
2324

2425
## Changelog
2526

27+
#### Releases v1.4.1
28+
29+
1. Fix bug in examples to reduce connection time
30+
2631
#### Releases v1.4.0
2732

2833
##### Warning: Releases v1.4.0+ can be used and autodetect ESP32 core v2.0.0+ or v1.0.6-.

examples/AdvancedWebServer/AdvancedWebServer.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ void setup()
144144
Serial.println(" with " + String(SHIELD_TYPE));
145145
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
146146

147+
// To be called before ETH.begin()
148+
WT32_ETH01_onEvent();
149+
147150
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
148151
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
149152
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
@@ -153,8 +156,6 @@ void setup()
153156
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
154157
ETH.config(myIP, myGW, mySN, myDNS);
155158

156-
WT32_ETH01_onEvent();
157-
158159
WT32_ETH01_waitForConnect();
159160

160161
server.on(F("/"), handleRoot);

examples/ESP32_FS_EthernetWebServer/ESP32_FS_EthernetWebServer.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,10 @@ void setup(void)
486486
Serial.println(" with " + String(SHIELD_TYPE));
487487
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
488488

489-
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
489+
// To be called before ETH.begin()
490+
WT32_ETH01_onEvent();
491+
492+
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
490493
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
491494
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
492495
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);
@@ -495,8 +498,6 @@ void setup(void)
495498
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
496499
ETH.config(myIP, myGW, mySN, myDNS);
497500

498-
WT32_ETH01_onEvent();
499-
500501
WT32_ETH01_waitForConnect();
501502

502503
initFS();

examples/HTTPClient/Authorization/Authorization.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ void setup()
3838
Serial.println(" with " + String(SHIELD_TYPE));
3939
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
4040

41-
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
41+
// To be called before ETH.begin()
42+
WT32_ETH01_onEvent();
43+
44+
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
4245
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
4346
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
4447
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);
@@ -47,8 +50,6 @@ void setup()
4750
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
4851
ETH.config(myIP, myGW, mySN, myDNS);
4952

50-
WT32_ETH01_onEvent();
51-
5253
WT32_ETH01_waitForConnect();
5354
}
5455

examples/HTTPClient/BasicHttpClient/BasicHttpClient.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ void setup()
3838
Serial.println(" with " + String(SHIELD_TYPE));
3939
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
4040

41-
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
41+
// To be called before ETH.begin()
42+
WT32_ETH01_onEvent();
43+
44+
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
4245
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
4346
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
4447
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);
@@ -47,8 +50,6 @@ void setup()
4750
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
4851
ETH.config(myIP, myGW, mySN, myDNS);
4952

50-
WT32_ETH01_onEvent();
51-
5253
WT32_ETH01_waitForConnect();
5354
}
5455

examples/HTTPClient/BasicHttpsClient/BasicHttpsClient.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ void setup()
103103
Serial.println(" with " + String(SHIELD_TYPE));
104104
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
105105

106-
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
106+
// To be called before ETH.begin()
107+
WT32_ETH01_onEvent();
108+
109+
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
107110
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
108111
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
109112
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);
@@ -112,8 +115,6 @@ void setup()
112115
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
113116
ETH.config(myIP, myGW, mySN, myDNS);
114117

115-
WT32_ETH01_onEvent();
116-
117118
WT32_ETH01_waitForConnect();
118119

119120
setClock();

examples/HTTPClient/StreamHttpClient/StreamHttpClient.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ void setup()
3838
Serial.println(" with " + String(SHIELD_TYPE));
3939
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
4040

41-
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
41+
// To be called before ETH.begin()
42+
WT32_ETH01_onEvent();
43+
44+
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
4245
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
4346
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
4447
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);
@@ -47,8 +50,6 @@ void setup()
4750
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
4851
ETH.config(myIP, myGW, mySN, myDNS);
4952

50-
WT32_ETH01_onEvent();
51-
5253
WT32_ETH01_waitForConnect();
5354
}
5455

examples/HelloServer/HelloServer.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ void setup(void)
6969
Serial.println(" with " + String(SHIELD_TYPE));
7070
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
7171

72+
// To be called before ETH.begin()
73+
WT32_ETH01_onEvent();
74+
7275
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
7376
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
7477
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
@@ -78,8 +81,6 @@ void setup(void)
7881
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
7982
ETH.config(myIP, myGW, mySN, myDNS);
8083

81-
WT32_ETH01_onEvent();
82-
8384
WT32_ETH01_waitForConnect();
8485

8586
server.on(F("/"), handleRoot);

0 commit comments

Comments
 (0)