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

Commit 89913af

Browse files
authored
v1.2.0 to add support to LAN8720 for STM32
### Releases v1.2.0 1. Add support to **LAN8720** Ethernet for many **STM32F4** (F407xx, NUCLEO_F429ZI) and **STM32F7** (DISCO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG) boards. 2. Add LAN8720 examples 3. Add Packages' Patches for STM32 to use LAN8720 with STM32Ethernet and LwIP libraries 4. Update ESP_WiFiManager-related example to fix multiWiFi timings to work better with latest esp32 core v1.0.6
1 parent f9045d4 commit 89913af

File tree

49 files changed

+2073
-94
lines changed

Some content is hidden

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

49 files changed

+2073
-94
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 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.13) or Platform.io version
18-
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v2.7.4, ESP32 v1.0.5 or STM32 v1.9.0)
18+
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v2.7.4, ESP32 v1.0.6 or STM32 v1.9.0)
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:
@@ -27,9 +27,9 @@ Please ensure to specify the following:
2727

2828
```
2929
Arduino IDE version: 1.8.13
30-
ESP32 Core Version 1.0.5
30+
ESP32 Core Version 1.0.6
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered an endless loop while trying to connect to Local WiFi.

Images/STM32F407VET6.png

569 KB
Loading

README.md

Lines changed: 215 additions & 21 deletions
Large diffs are not rendered by default.

examples/AsyncCustomHeader_STM32/AsyncCustomHeader_STM32.ino

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.1.5
20+
Version: 1.2.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
3131
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
3232
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
33+
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
3334
*****************************************************************************************************************************/
3435

3536
#include "defines.h"

examples/AsyncDweetGet_STM32/AsyncDweetGet_STM32.ino

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.1.5
20+
Version: 1.2.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
3131
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
3232
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
33+
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
3334
*****************************************************************************************************************************/
3435

3536
/**

examples/AsyncDweetPost_STM32/AsyncDweetPost_STM32.ino

Lines changed: 5 additions & 4 deletions
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.1.5
20+
Version: 1.2.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
3131
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
3232
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
33+
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
3334
*****************************************************************************************************************************/
3435

3536
// Dweet.io POST client. Connects to dweet.io once every ten seconds, sends a POST request and a request body.
@@ -44,7 +45,7 @@ const char POST_ServerAddress[] = "dweet.io";
4445
String dweetName = "/dweet/for/pinA0-Read?";
4546

4647
// 60s = 60 seconds to not flooding the server
47-
#define HTTP_REQUEST_INTERVAL_MS 60000
48+
#define HTTP_REQUEST_INTERVAL_MS 10000
4849

4950
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
5051

@@ -67,14 +68,14 @@ void sendRequest(void)
6768
postData += analogRead(A0);
6869

6970
Serial.println("\nMaking new POST request");
70-
71+
7172
requestOpenResult = request.open("POST", (POST_ServerAddress + dweetName + postData).c_str() );
7273

7374
if (requestOpenResult)
7475
{
7576
// Only send() if open() returns true, or crash
7677
request.send();
77-
}
78+
}
7879
else
7980
{
8081
Serial.println("Can't send bad request");

examples/AsyncDweetPost_STM32/defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define ASYNC_HTTP_DEBUG_PORT Serial
4343

4444
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
45-
#define _ASYNC_HTTP_LOGLEVEL_ 1
45+
#define _ASYNC_HTTP_LOGLEVEL_ 4
4646

4747

4848
#if defined(STM32F0)

examples/AsyncHTTPMultiRequests_ESP/AsyncHTTPMultiRequests_ESP.ino

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.1.5
20+
Version: 1.2.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
3131
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
3232
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
33+
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
3334
*****************************************************************************************************************************/
3435
//************************************************************************************************************
3536
//

examples/AsyncHTTPRequest_ESP/AsyncHTTPRequest_ESP.ino

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.1.5
20+
Version: 1.2.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
3131
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
3232
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
33+
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
3334
*****************************************************************************************************************************/
3435
//************************************************************************************************************
3536
//

examples/AsyncHTTPRequest_ESP_WiFiManager/AsyncHTTPRequest_ESP_WiFiManager.ino

Lines changed: 16 additions & 6 deletions
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.1.5
20+
Version: 1.2.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
3131
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
3232
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
33+
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
3334
*****************************************************************************************************************************/
3435
//************************************************************************************************************
3536
//
@@ -62,7 +63,9 @@
6263

6364
// Level from 0-4
6465
#define ASYNC_HTTP_DEBUG_PORT Serial
65-
#define _ASYNC_HTTP_LOGLEVEL_ 1
66+
67+
#define _ASYNC_HTTP_LOGLEVEL_ 1
68+
#define _WIFIMGR_LOGLEVEL_ 1
6669

6770
// 300s = 5 minutes to not flooding, 60s in testing
6871
#define HTTP_REQUEST_INTERVAL 60 //300
@@ -331,14 +334,20 @@ void configWiFi(WiFi_STA_IPConfig in_WM_STA_IPconfig)
331334
uint8_t connectMultiWiFi()
332335
{
333336
#if ESP32
334-
// For ESP32, this better be 0 to shorten the connect time
335-
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 0
337+
// For ESP32, this better be 0 to shorten the connect time.
338+
// For ESP32-S2, must be > 500
339+
#if ( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_PROS2 || ARDUINO_MICROS2 )
340+
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 500L
341+
#else
342+
// For ESP32 core v1.0.6, must be >= 500
343+
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 800L
344+
#endif
336345
#else
337346
// For ESP8266, this better be 2200 to enable connect the 1st time
338-
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 2200L
347+
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 2200L
339348
#endif
340349

341-
#define WIFI_MULTI_CONNECT_WAITING_MS 100L
350+
#define WIFI_MULTI_CONNECT_WAITING_MS 100L
342351

343352
uint8_t status;
344353

@@ -370,6 +379,7 @@ uint8_t connectMultiWiFi()
370379

371380
int i = 0;
372381
status = wifiMulti.run();
382+
373383
delay(WIFI_MULTI_1ST_CONNECT_WAITING_MS);
374384

375385
while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) )

0 commit comments

Comments
 (0)