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

Commit 569da2d

Browse files
authored
v1.4.1 to auto detect ESP32 core
#### Releases v1.4.1 ##### Warning: Releases v1.4.1+ can be used and autodetect ESP32 core v2.0.0+ or v1.0.6- for WT32_ETH01 1. Auto detect ESP32 core to use for WT32_ETH01 2. Fix bug in WT32_ETH01 examples to reduce connection time
1 parent 6a9797e commit 569da2d

22 files changed

+90
-150
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ This library is based on, modified from:
158158
8. [`STM32Ethernet library v1.2.0+`](https://github.com/stm32duino/STM32Ethernet) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [![GitHub release](https://img.shields.io/github/release/stm32duino/STM32Ethernet.svg)](https://github.com/stm32duino/STM32Ethernet/releases/latest)
159159
9. [`LwIP library v2.1.2+`](https://github.com/stm32duino/LwIP) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [![GitHub release](https://img.shields.io/github/release/stm32duino/LwIP.svg)](https://github.com/stm32duino/LwIP/releases/latest)
160160
10. [`STM32AsyncTCP library v1.0.1+`](https://github.com/khoih-prog/STM32AsyncTCP) for built-in Ethernet on (Nucleo-144, Discovery). To install manually for Arduino IDE.
161-
11. [`ESPAsync_WiFiManager library v1.9.4+`](https://github.com/khoih-prog/ESPAsync_WiFiManager) for ESP32/ESP8266 using some examples. [![GitHub release](https://img.shields.io/github/release/khoih-prog/ESPAsync_WiFiManager.svg)](https://github.com/khoih-prog/ESPAsync_WiFiManager/releases)
161+
11. [`ESPAsync_WiFiManager library v1.9.6+`](https://github.com/khoih-prog/ESPAsync_WiFiManager) for ESP32/ESP8266 using some examples. [![GitHub release](https://img.shields.io/github/release/khoih-prog/ESPAsync_WiFiManager.svg)](https://github.com/khoih-prog/ESPAsync_WiFiManager/releases)
162162
12. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32).
163-
13. [`WebServer_WT32_ETH01 library v1.3.0+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01)
163+
13. [`WebServer_WT32_ETH01 library v1.4.1+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01)
164164

165165
---
166166

@@ -649,7 +649,7 @@ IPAddress ip(192, 168, 2, 232);
649649

650650
```
651651
Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
652-
AsyncHTTPRequest_Generic v1.4.0
652+
AsyncHTTPRequest_Generic v1.4.1
653653
AsyncHTTPRequest @ IP : 192.168.2.72
654654
655655
**************************************
@@ -694,7 +694,7 @@ week_number: 37
694694

695695
```
696696
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
697-
AsyncHTTPRequest_Generic v1.4.0
697+
AsyncHTTPRequest_Generic v1.4.1
698698
Stored: SSID = HueNet1, Pass = 12345678
699699
Got stored Credentials. Timeout 120s
700700
ConnectMultiWiFi in setup
@@ -727,7 +727,7 @@ HHHHHH
727727

728728
```
729729
Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
730-
AsyncHTTPRequest_Generic v1.4.0
730+
AsyncHTTPRequest_Generic v1.4.1
731731
Stored: SSID = HueNet1, Pass = 12345678
732732
Got stored Credentials. Timeout 120s
733733
ConnectMultiWiFi in setup
@@ -778,7 +778,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
778778

779779
```
780780
Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
781-
AsyncHTTPRequest_Generic v1.4.0
781+
AsyncHTTPRequest_Generic v1.4.1
782782
Connecting to WiFi SSID: HueNet1
783783
...........
784784
HTTP WebServer is @ IP : 192.168.2.81
@@ -810,7 +810,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
810810

811811
```
812812
Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
813-
AsyncHTTPRequest_Generic v1.4.0
813+
AsyncHTTPRequest_Generic v1.4.1
814814
AsyncHTTPRequest @ IP : 192.168.2.72
815815
816816
**************************************
@@ -865,7 +865,7 @@ AsyncHTTPRequest @ IP : 192.168.2.72
865865

866866
```
867867
Start AsyncWebClientRepeating_STM32_LAN8720 on BLACK_F407VE
868-
AsyncHTTPRequest_Generic v1.4.0
868+
AsyncHTTPRequest_Generic v1.4.1
869869
AsyncHTTPRequest @ IP : 192.168.2.150
870870
871871
@@ -920,8 +920,8 @@ AsyncHTTPRequest @ IP : 192.168.2.150
920920

921921
```
922922
Starting AsyncHTTPRequest_WT32_ETH01 on ESP32_DEV with ETH_PHY_LAN8720
923-
WebServer_WT32_ETH01 v1.3.0
924-
AsyncHTTPRequest_Generic v1.4.0
923+
WebServer_WT32_ETH01 v1.4.1
924+
AsyncHTTPRequest_Generic v1.4.1
925925
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
926926
AsyncHTTPRequest @ IP : 192.168.2.232
927927
@@ -946,8 +946,8 @@ H
946946

947947
```
948948
Starting AsyncHTTPRequest_WT32_ETH01 on ESP32_DEV with ETH_PHY_LAN8720
949-
WebServer_WT32_ETH01 v1.3.0
950-
AsyncHTTPRequest_Generic v1.4.0
949+
WebServer_WT32_ETH01 v1.4.1
950+
AsyncHTTPRequest_Generic v1.4.1
951951
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
952952
AsyncHTTPRequest @ IP : 192.168.2.232
953953
@@ -1019,6 +1019,8 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
10191019
4. Add PUT, PATCH, DELETE and HEAD besides GET and POST.
10201020
5. Add support to **Ethernet LAN8720** using [STM32Ethernet library](https://github.com/stm32duino/STM32Ethernet), for boards such as **Nucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG), Discovery (DISCO_F746NG)** and **STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)**
10211021
6. Add support to **WT32_ETH01** using ESP32-based boards and LAN8720 Ethernet
1022+
7. Auto detect ESP32 core to use for WT32_ETH01
1023+
8. Fix bug in WT32_ETH01 examples to reduce connection time
10221024

10231025
---
10241026
---

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.4.1](#releases-v141)
1516
* [Releases v1.4.0](#releases-v140)
1617
* [Releases v1.3.1](#releases-v131)
1718
* [Releases v1.3.0](#releases-v130)
@@ -31,6 +32,13 @@
3132

3233
## Changelog
3334

35+
#### Releases v1.4.1
36+
37+
##### Warning: Releases v1.4.1+ can be used and autodetect ESP32 core v2.0.0+ or v1.0.6- for WT32_ETH01
38+
39+
1. Auto detect ESP32 core to use for WT32_ETH01
40+
2. Fix bug in WT32_ETH01 examples to reduce connection time
41+
3442
### Releases v1.4.0
3543

3644
1. Fix crashing bug when request a non-existing IP. Check [Http GET polling causes crash when host disconnected #22](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/22)

examples/WT32_ETH01/AsyncHTTPMultiRequests_WT32_ETH01/AsyncHTTPMultiRequests_WT32_ETH01.ino

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
#endif
4646

4747
// Level from 0-4
48-
#define ASYNC_HTTP_DEBUG_PORT Serial
49-
#define _ASYNC_HTTP_LOGLEVEL_ 1
48+
#define ASYNC_HTTP_DEBUG_PORT Serial
49+
#define _ASYNC_HTTP_LOGLEVEL_ 1
50+
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 1
5051

5152
// 300s = 5 minutes to not flooding
5253
#define HTTP_REQUEST_INTERVAL 60 //300
@@ -167,54 +168,6 @@ void requestCB(void* optParm, AsyncHTTPRequest* request, int readyState)
167168
}
168169
}
169170

170-
void WiFiEvent(WiFiEvent_t event)
171-
{
172-
switch (event)
173-
{
174-
case SYSTEM_EVENT_ETH_START:
175-
Serial.println("\nETH Started");
176-
//set eth hostname here
177-
ETH.setHostname("WT32-ETH01");
178-
break;
179-
case SYSTEM_EVENT_ETH_CONNECTED:
180-
Serial.println("ETH Connected");
181-
break;
182-
183-
case SYSTEM_EVENT_ETH_GOT_IP:
184-
if (!eth_connected)
185-
{
186-
Serial.print("ETH MAC: ");
187-
Serial.print(ETH.macAddress());
188-
Serial.print(", IPv4: ");
189-
Serial.print(ETH.localIP());
190-
191-
if (ETH.fullDuplex())
192-
{
193-
Serial.print(", FULL_DUPLEX");
194-
}
195-
196-
Serial.print(", ");
197-
Serial.print(ETH.linkSpeed());
198-
Serial.println("Mbps");
199-
eth_connected = true;
200-
}
201-
202-
break;
203-
204-
case SYSTEM_EVENT_ETH_DISCONNECTED:
205-
Serial.println("ETH Disconnected");
206-
eth_connected = false;
207-
break;
208-
209-
case SYSTEM_EVENT_ETH_STOP:
210-
Serial.println("\nETH Stopped");
211-
eth_connected = false;
212-
break;
213-
214-
default:
215-
break;
216-
}
217-
}
218171

219172
void setup()
220173
{
@@ -231,6 +184,9 @@ void setup()
231184

232185
Serial.setDebugOutput(true);
233186

187+
// To be called before ETH.begin()
188+
WT32_ETH01_onEvent();
189+
234190
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
235191
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
236192
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
@@ -240,10 +196,7 @@ void setup()
240196
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
241197
ETH.config(myIP, myGW, mySN, myDNS);
242198

243-
WiFi.onEvent(WiFiEvent);
244-
245-
while (!eth_connected)
246-
delay(100);
199+
WT32_ETH01_waitForConnect();
247200

248201
Serial.print(F("AsyncHTTPRequest @ IP : "));
249202
Serial.println(ETH.localIP());

examples/WT32_ETH01/AsyncHTTPRequest_WT32_ETH01/AsyncHTTPRequest_WT32_ETH01.ino

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
#endif
4646

4747
// Level from 0-4
48-
#define ASYNC_HTTP_DEBUG_PORT Serial
49-
#define _ASYNC_HTTP_LOGLEVEL_ 1
48+
#define ASYNC_HTTP_DEBUG_PORT Serial
49+
#define _ASYNC_HTTP_LOGLEVEL_ 1
50+
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 1
5051

5152
// 300s = 5 minutes to not flooding
5253
#define HTTP_REQUEST_INTERVAL 60 //300
@@ -136,55 +137,6 @@ void requestCB(void* optParm, AsyncHTTPRequest* request, int readyState)
136137
}
137138
}
138139

139-
void WiFiEvent(WiFiEvent_t event)
140-
{
141-
switch (event)
142-
{
143-
case SYSTEM_EVENT_ETH_START:
144-
Serial.println("\nETH Started");
145-
//set eth hostname here
146-
ETH.setHostname("WT32-ETH01");
147-
break;
148-
case SYSTEM_EVENT_ETH_CONNECTED:
149-
Serial.println("ETH Connected");
150-
break;
151-
152-
case SYSTEM_EVENT_ETH_GOT_IP:
153-
if (!eth_connected)
154-
{
155-
Serial.print("ETH MAC: ");
156-
Serial.print(ETH.macAddress());
157-
Serial.print(", IPv4: ");
158-
Serial.print(ETH.localIP());
159-
160-
if (ETH.fullDuplex())
161-
{
162-
Serial.print(", FULL_DUPLEX");
163-
}
164-
165-
Serial.print(", ");
166-
Serial.print(ETH.linkSpeed());
167-
Serial.println("Mbps");
168-
eth_connected = true;
169-
}
170-
171-
break;
172-
173-
case SYSTEM_EVENT_ETH_DISCONNECTED:
174-
Serial.println("ETH Disconnected");
175-
eth_connected = false;
176-
break;
177-
178-
case SYSTEM_EVENT_ETH_STOP:
179-
Serial.println("\nETH Stopped");
180-
eth_connected = false;
181-
break;
182-
183-
default:
184-
break;
185-
}
186-
}
187-
188140
void setup()
189141
{
190142
// put your setup code here, to run once:
@@ -198,6 +150,9 @@ void setup()
198150

199151
Serial.setDebugOutput(true);
200152

153+
// To be called before ETH.begin()
154+
WT32_ETH01_onEvent();
155+
201156
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
202157
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
203158
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
@@ -207,10 +162,7 @@ void setup()
207162
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
208163
ETH.config(myIP, myGW, mySN, myDNS);
209164

210-
WiFi.onEvent(WiFiEvent);
211-
212-
while (!eth_connected)
213-
delay(100);
165+
WT32_ETH01_waitForConnect();
214166

215167
Serial.print(F("\nHTTP WebClient is @ IP : "));
216168
Serial.println(ETH.localIP());

library.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncHTTPRequest_Generic",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32-S2), WT32_ETH01 (ESP32 + LAN8720), ESP8266 and currently STM32 with LAN8720 or built-in LAN8742A Ethernet.",
55
"keywords":"communication, async, tcp, http, ESP8266, ESP32, ESP32-S2, wt32-eth01, ESPAsyncTCP, AsyncTCP, stm32, ethernet, wifi, lan8742a, lan8720, f407ve, nucleo, nucleo-144, stm32f7, stm32f4",
66
"authors": [
@@ -20,8 +20,14 @@
2020
"type": "git",
2121
"url": "https://github.com/khoih-prog/AsyncHTTPRequest_Generic"
2222
},
23-
"license": "MIT",
24-
"frameworks": "arduino",
23+
"homepage": "https://github.com/khoih-prog/AsyncHTTPRequest_Generic",
24+
"export": {
25+
"exclude": [
26+
"linux",
27+
"extras",
28+
"tests"
29+
]
30+
},
2531
"dependencies":
2632
[
2733
{
@@ -39,7 +45,7 @@
3945
{
4046
"owner": "khoih-prog",
4147
"name": "ESPAsync_WiFiManager",
42-
"version": ">=1.9.4",
48+
"version": ">=1.9.6",
4349
"platforms": ["espressif8266", "espressif32"]
4450
},
4551
{
@@ -63,13 +69,17 @@
6369
{
6470
"owner": "khoih-prog",
6571
"name": "WebServer_WT32_ETH01",
66-
"version": ">=1.2.1",
72+
"version": ">=1.4.1",
6773
"platforms": ["espressif32"]
6874
},
6975
{
7076
"name": "STM32AsyncTCP",
7177
"version": "https://github.com/khoih-prog/STM32AsyncTCP"
7278
}
7379
],
74-
"platforms": ["espressif8266", "espressif32", "ststm32"]
80+
"license": "LGPL-3.0",
81+
"frameworks": "arduino",
82+
"platforms": ["espressif8266", "espressif32", "ststm32"],
83+
"examples": "examples/*/*/*.ino",
84+
"headers": "AsyncHTTPRequest_Generic.h"
7585
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncHTTPRequest_Generic
2-
version=1.4.0
2+
version=1.4.1
33
author=Bob Lemaire,Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
license=MIT

platformio/platformio.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ lib_deps =
4343
; https://github.com/khoih-prog/STM32AsyncTCP.git
4444
; STM32duino LwIP@>=2.1.2
4545
; STM32duino STM32Ethernet@>=1.2.0
46-
; ESPAsync_WiFiManager@>=1.9.3
46+
; ESPAsync_WiFiManager@>=1.9.6
4747
; LittleFS_esp32@>=1.0.6
48-
; WebServer_WT32_ETH01@>=1.2.1
48+
; WebServer_WT32_ETH01@>=1.4.1
4949
; PlatformIO 5.x
5050
me-no-dev/AsyncTCP@>=1.1.1
5151
me-no-dev/ESPAsyncTCP@>=1.2.2
5252
; philbowles/STM32AsyncTCP
5353
; https://github.com/khoih-prog/STM32AsyncTCP.git
5454
; stm32duino/STM32duino LwIP@>=2.1.2
5555
; stm32duino/STM32duino STM32Ethernet@>=1.2.0
56-
khoih-prog/ESPAsync_WiFiManager@>=1.9.3
56+
khoih-prog/ESPAsync_WiFiManager@>=1.9.6
5757
lorol/LittleFS_esp32@>=1.0.6
58-
; khoih-prog/WebServer_WT32_ETH01@>=1.2.1
58+
; khoih-prog/WebServer_WT32_ETH01@>=1.4.1
5959

6060
build_flags =
6161
; set your debug output (default=Serial)

src/AsyncHTTPRequest_Debug_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.4.0
20+
Version: 1.4.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.3.0 K Hoang 09/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720) boards
3535
1.3.1 K Hoang 09/10/2021 Update `platform.ini` and `library.json`
3636
1.4.0 K Hoang 23/11/2021 Fix crashing bug when request a non-existing IP
37+
1.4.1 K Hoang 29/11/2021 Auto detect ESP32 core version and improve connection time for WT32_ETH01
3738
*****************************************************************************************************************************/
3839

3940
#pragma once

0 commit comments

Comments
 (0)