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

Commit d58997c

Browse files
authored
Update README.md and use allman astyle
1 parent bec083d commit d58997c

File tree

43 files changed

+554
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+554
-392
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18-
* Board Core Version (e.g. ESP32 core v2.0.4)
18+
* Board Core Version (e.g. ESP32 core v2.0.5)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -28,26 +28,47 @@ Please ensure to specify the following:
2828
```
2929
Arduino IDE version: 1.8.19
3030
WT32_ETH01 board
31-
ESP32 core v2.0.4
31+
ESP32 core v2.0.5
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
36-
I encountered a crash while trying to connect to network.
36+
I encountered a crash while using this library
3737
3838
Steps to reproduce:
3939
1. ...
4040
2. ...
4141
3. ...
4242
4. ...
4343
```
44+
45+
---
46+
4447
### Sending Feature Requests
4548

4649
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
4750

4851
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/WebServer_WT32_ETH01/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
4952

53+
---
54+
5055
### Sending Pull Requests
5156

5257
Pull Requests with changes and fixes are also welcome!
5358

59+
Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)
60+
61+
1. Change directory to the library GitHub
62+
63+
```
64+
xy@xy-Inspiron-3593:~$ cd Arduino/xy/WebServer_WT32_ETH01_GitHub/
65+
xy@xy-Inspiron-3593:~/Arduino/xy/WebServer_WT32_ETH01_GitHub$
66+
```
67+
68+
2. Issue astyle command
69+
70+
```
71+
xy@xy-Inspiron-3593:~/Arduino/xy/WebServer_WT32_ETH01_GitHub$ bash utils/restyle.sh
72+
```
73+
74+

README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
66
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/WebServer_WT32_ETH01.svg)](http://github.com/khoih-prog/WebServer_WT32_ETH01/issues)
77

8+
89
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
910
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
11+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog-WebServer_WT32_ETH01/count.svg" title="WebServer_WT32_ETH01 Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-WebServer_WT32_ETH01/count.svg" style="height: 30px;width: 200px;"></a>
1013

1114
---
1215
---
@@ -113,22 +116,22 @@ Please have a look at [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix
113116

114117
#### Important notes
115118

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

118121
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)
119122

120123
It's better to preserve the old enum order and just adding new items **to do no harm to pre-2.0.0 codes**
121124

122-
- Releases v1.2.0- to be used for ESP32 core v1.0.6- only
123-
- Releases v1.3.0 can be used for either ESP32 core v2.0.0+ or v1.0.6-. **Default is using core v2.0.0+**
125+
- Releases `v1.2.0-` to be used for ESP32 core `v1.0.6-` only
126+
- Releases `v1.3.0` can be used for either ESP32 core `v2.0.0+` or `v1.0.6-`. **Default is using core `v2.0.0+`**
124127

125128
To use with core v1.0.6-, just define in your sketch
126129

127-
```
130+
```cpp
128131
#define USING_CORE_ESP32_CORE_V200_PLUS false
129132
```
130133

131-
- Releases v1.4.0+ can be used for either ESP32 core v2.0.0+ or v1.0.6-. **Autodetect core**
134+
- Releases `v1.4.0+` can be used for either ESP32 core `v2.0.0+` or `v1.0.6-`. **Autodetect core**
132135

133136

134137
#### Features
@@ -164,8 +167,8 @@ This [**WebServer_WT32_ETH01** library](https://github.com/khoih-prog/WebServer_
164167
## Prerequisites
165168

166169
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
167-
2. [`ESP32 Core 2.0.4+`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release v1.3.0+. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
168-
3. [`ESP32 Core 1.0.6-`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release v1.2.0-
170+
2. [`ESP32 Core 2.0.5+`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release `v1.3.0+`. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
171+
3. [`ESP32 Core 1.0.6-`](https://github.com/espressif/arduino-esp32) for ESP32-based WT32_ETH01 boards using release `v1.2.0-`
169172

170173
---
171174
---
@@ -213,14 +216,14 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
213216

214217
You can include this `.hpp` file
215218

216-
```
219+
```cpp
217220
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
218221
#include "WebServer_WT32_ETH01.hpp" //https://github.com/khoih-prog/WebServer_WT32_ETH01
219222
```
220223

221224
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
222225

223-
```
226+
```cpp
224227
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
225228
#include "WebServer_WT32_ETH01.h" //https://github.com/khoih-prog/WebServer_WT32_ETH01
226229
```
@@ -488,10 +491,10 @@ https://github.com/khoih-prog/WebServer_WT32_ETH01/blob/49acabe4762e935fc6c13215
488491
The following are debug terminal output and screen shot when running example [AdvancedWebServer](examples/AdvancedWebServer) on ESP32_DEV with ETH_PHY_LAN8720 (WT32_ETH01)
489492

490493
<p align="center">
491-
<img src="https://github.com/khoih-prog/WebServer_WT32_ETH01/blob/main/pics/AdvancedWebServer.png">
494+
<img src="https://github.com/khoih-prog/WebServer_WT32_ETH01/raw/main/pics/AdvancedWebServer.png">
492495
</p>
493496

494-
```
497+
```cpp
495498
Starting AdvancedWebServer on ESP32_DEV with ETH_PHY_LAN8720
496499
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
497500

@@ -549,7 +552,7 @@ handleFileRead: /CanadaFlag_1.png
549552
and the screen shot of the WebServer
550553
551554
<p align="center">
552-
<img src="https://github.com/khoih-prog/WebServer_WT32_ETH01/blob/main/pics/ESP32_FS_EthernetWebServer.png">
555+
<img src="https://github.com/khoih-prog/WebServer_WT32_ETH01/raw/main/pics/ESP32_FS_EthernetWebServer.png">
553556
</p>
554557
555558
---
@@ -559,7 +562,7 @@ and the screen shot of the WebServer
559562
The terminal output of **WT32_ETH01** running [MQTT_ThingStream example](examples/MQTT_ThingStream)
560563
561564
562-
```
565+
```cpp
563566
Starting MQTT_ThingStream on ESP32_DEV with ETH_PHY_LAN8720
564567
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
565568
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -583,7 +586,7 @@ MQTT Message receive [esp32-sniffer/12345678/ble] Hello from MQTT_ThingStream on
583586
The terminal output of **WT32_ETH01** running [MQTTClient_Auth example](examples/MQTTClient_Auth)
584587

585588

586-
```
589+
```cpp
587590
Starting MQTTClient_Auth on ESP32_DEV with ETH_PHY_LAN8720
588591
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
589592
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -600,7 +603,7 @@ Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on WT32-ETH01 with ETH_PHY
600603

601604
The terminal output of **WT32_ETH01** running [MQTTClient_Basic example](examples/MQTTClient_Basic)
602605

603-
```
606+
```cpp
604607
Starting MQTTClient_Basic on ESP32_DEV with ETH_PHY_LAN8720
605608
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
606609
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -620,7 +623,7 @@ Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on WT32-ETH01 with ETH_PH
620623

621624
The terminal output of **WT32_ETH01** running [WebClient example](examples/WebClient)
622625

623-
```
626+
```cpp
624627
Starting WebClient on ESP32_DEV with ETH_PHY_LAN8720
625628
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
626629
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -688,7 +691,7 @@ Disconnecting from server...
688691

689692
The terminal output of **WT32_ETH01** running [UdpNTPClient example](examples/UdpNTPClient)
690693

691-
```
694+
```cpp
692695
Starting UdpNTPClient on ESP32_DEV with ETH_PHY_LAN8720
693696
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
694697
ETH Started
@@ -726,7 +729,7 @@ The UTC time is 5:54:46
726729
The terminal output of **WT32_ETH01** running [BasicHttpClient example](examples/HTTPClient/BasicHttpClient)
727730

728731

729-
```
732+
```cpp
730733
Starting BasicHttpClient on ESP32_DEV with ETH_PHY_LAN8720
731734
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
732735
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -788,7 +791,7 @@ ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
788791
The terminal output of **WT32_ETH01** running [BasicHttpsClient example](examples/HTTPClient/BasicHttpsClient)
789792
790793
791-
```
794+
```cpp
792795
Starting BasicHttpsClient on ESP32_DEV with ETH_PHY_LAN8720
793796
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
794797
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -833,7 +836,7 @@ Waiting 10s before the next round...
833836
The terminal output of **WT32_ETH01** running [WebClientMulti_SSL example](examples/SSL/WebClientMulti_SSL)
834837

835838

836-
```
839+
```cpp
837840
Starting WebClientMulti_SSL on ESP32_DEV with ETH_PHY_LAN8720
838841
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
839842
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -947,7 +950,7 @@ Disconnecting.
947950
The terminal output of **WT32_ETH01** running [MQTTClient_SSL_Complex example](examples/SSL/MQTTClient_SSL_Complex)
948951

949952

950-
```
953+
```cpp
951954
Starting MQTTClient_SSL_Complex on ESP32_DEV with ETH_PHY_LAN8720
952955
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
953956
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -967,7 +970,7 @@ Message arrived [MQTT_Pub] Hello from MQTTClient_SSL_Complex on WT32-ETH01, mill
967970
The terminal output of **WT32_ETH01** running [MQTTS_ThingStream example](examples/SSL/MQTTS_ThingStream)
968971

969972

970-
```
973+
```cpp
971974
Starting MQTTS_ThingStream on ESP32_DEV with ETH_PHY_LAN8720
972975
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
973976
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -993,7 +996,7 @@ MQTT Message receive [esp32-sniffer/12345678/ble] Hello from MQTTS_ThingStream o
993996
The terminal output of **WT32_ETH01** running [MQTTClient_SSL example](examples/SSL/MQTTClient_SSL)
994997

995998

996-
```
999+
```cpp
9971000
Starting MQTTClient_SSL on ESP32_DEV with ETH_PHY_LAN8720
9981001
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
9991002
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -1018,7 +1021,7 @@ Message arrived [MQTT_Pub] Hello from MQTTClient_SSL on WT32-ETH01
10181021

10191022
The terminal output of **WT32_ETH01** running [MQTTClient_SSL_Auth example](examples/SSL/MQTTClient_SSL_Auth)
10201023

1021-
```
1024+
```cpp
10221025
Starting MQTTClient_SSL_Auth on ESP32_DEV with ETH_PHY_LAN8720
10231026
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
10241027
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
@@ -1126,6 +1129,6 @@ If you want to contribute to this project:
11261129

11271130
## Copyright
11281131

1129-
Copyright 2021- Khoi Hoang
1132+
Copyright (c) 2021- Khoi Hoang
11301133

11311134

changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
## WebServer_WT32_ETH01
1+
## WebServer_WT32_ETH01 Library
22

33
[![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01)
44
[![GitHub release](https://img.shields.io/github/release/khoih-prog/WebServer_WT32_ETH01.svg)](https://github.com/khoih-prog/WebServer_WT32_ETH01/releases)
55
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
66
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/WebServer_WT32_ETH01.svg)](http://github.com/khoih-prog/WebServer_WT32_ETH01/issues)
77

8+
9+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
10+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
11+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog-WebServer_WT32_ETH01/count.svg" title="WebServer_WT32_ETH01 Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-WebServer_WT32_ETH01/count.svg" style="height: 30px;width: 200px;"></a>
13+
814
---
915
---
1016

examples/AdvancedWebServer/AdvancedWebServer.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************************************************************
22
AdvancedWebServer.h - Dead simple web-server for Ethernet shields
3-
3+
44
For Ethernet shields using WT32_ETH01 (ESP32 + LAN8720)
55
66
WebServer_WT32_ETH01 is a library for the Ethernet LAN8720 in WT32_ETH01 to run WebServer
@@ -127,6 +127,7 @@ void drawGraph()
127127
out += temp;
128128
y = y2;
129129
}
130+
130131
out += F("</g>\n</svg>\n");
131132

132133
server.send(200, F("image/svg+xml"), out);
@@ -135,6 +136,7 @@ void drawGraph()
135136
void setup()
136137
{
137138
Serial.begin(115200);
139+
138140
while (!Serial);
139141

140142
// Using this if Serial debugging is not necessary or not using Serial port
@@ -147,7 +149,7 @@ void setup()
147149
// To be called before ETH.begin()
148150
WT32_ETH01_onEvent();
149151

150-
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
152+
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
151153
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
152154
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
153155
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);

0 commit comments

Comments
 (0)