Skip to content

Commit 898d5b2

Browse files
committed
patches: Update for ESP-IDF 5.3 and arduino-esp32 3.1.
Remove patches that were backported to 4.4 or are just not necessary anymore. Update other patches to compile against the new versions. Currently not all patches are applied automatically, for example lib-builder/managed_components/*
1 parent 60ccb35 commit 898d5b2

File tree

32 files changed

+506
-1221
lines changed

32 files changed

+506
-1221
lines changed

software/patches/arduino-esp32/0001-LittleFS-Use-default-implementation-of-exists.patch

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
From 0cd6d432a38a5ff1a89f34778fec9df78236fd08 Mon Sep 17 00:00:00 2001
1+
From 2b8d6d219b740426a957a525ea43392fefc5fd7b Mon Sep 17 00:00:00 2001
22
From: Erik Fleckstein <[email protected]>
3-
Date: Fri, 3 Dec 2021 14:02:41 +0100
3+
Date: Wed, 16 Oct 2024 10:41:08 +0200
44
Subject: [PATCH] ETH: Make eth_handle public.
55

66
---
77
libraries/Ethernet/src/ETH.h | 2 +-
88
1 file changed, 1 insertion(+), 1 deletion(-)
99

1010
diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h
11-
index 918cd357..824b066d 100644
11+
index 14d2d042..10ab283b 100644
1212
--- a/libraries/Ethernet/src/ETH.h
1313
+++ b/libraries/Ethernet/src/ETH.h
14-
@@ -57,7 +57,7 @@ typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848
15-
#define ETH_PHY_IP101 ETH_PHY_TLK110
14+
@@ -182,8 +182,8 @@ protected:
15+
public:
16+
void _onEthEvent(int32_t event_id, void *event_data);
1617

17-
class ETHClass {
18-
- private:
19-
+ public:
20-
bool initialized;
21-
bool staticIP;
22-
#if ESP_IDF_VERSION_MAJOR > 3
18+
-private:
19+
esp_eth_handle_t _eth_handle;
20+
+private:
21+
uint8_t _eth_index;
22+
eth_phy_type_t _phy_type;
23+
esp_eth_netif_glue_handle_t _glue_handle;
2324
--
24-
2.33.1
25+
2.47.0
2526

software/patches/arduino-esp32/0003-WiFiGeneric-Add-ETH_LOST_IP-event.patch

Lines changed: 0 additions & 40 deletions
This file was deleted.

software/patches/arduino-esp32/0004-Disable-WiFiClientSecure-esp_crt_bundle-re-implement.patch

Lines changed: 0 additions & 19 deletions
This file was deleted.

software/patches/arduino-esp32/0005-WiFi-Increase-scan-timeout.patch

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
1-
From bd8c0377eac15db67cac1746bebc411aeed94933 Mon Sep 17 00:00:00 2001
1+
From 84d66d04511edab3be8c2f62f982f342326522e4 Mon Sep 17 00:00:00 2001
22
From: Erik Fleckstein <[email protected]>
3-
Date: Mon, 13 Nov 2023 13:09:19 +0100
3+
Date: Wed, 16 Oct 2024 10:49:53 +0200
44
Subject: [PATCH] Remove automatic reconnect if first connect after startup
55
fails.
66

77
---
8-
libraries/WiFi/src/WiFiGeneric.cpp | 9 +--------
9-
1 file changed, 1 insertion(+), 8 deletions(-)
8+
libraries/WiFi/src/STA.cpp | 7 +------
9+
1 file changed, 1 insertion(+), 6 deletions(-)
1010

11-
diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp
12-
index 3760285d..d182adc6 100644
13-
--- a/libraries/WiFi/src/WiFiGeneric.cpp
14-
+++ b/libraries/WiFi/src/WiFiGeneric.cpp
15-
@@ -1036,8 +1036,6 @@ void WiFiGenericClass::removeEvent(wifi_event_id_t id)
16-
*/
17-
esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
18-
{
19-
- static bool first_connect = true;
20-
-
21-
if(!event) return ESP_OK; //Null would crash this function
11+
diff --git a/libraries/WiFi/src/STA.cpp b/libraries/WiFi/src/STA.cpp
12+
index 443d2621..582d5c52 100644
13+
--- a/libraries/WiFi/src/STA.cpp
14+
+++ b/libraries/WiFi/src/STA.cpp
15+
@@ -106,7 +106,6 @@ static void _onStaArduinoEvent(arduino_event_t *ev) {
16+
if (_sta_network_if == NULL || ev->event_id < ARDUINO_EVENT_WIFI_STA_START || ev->event_id > ARDUINO_EVENT_WIFI_STA_LOST_IP) {
17+
return;
18+
}
19+
- static bool first_connect = true;
20+
log_v("Arduino STA Event: %d - %s", ev->event_id, Network.eventName(ev->event_id));
2221

23-
log_d("Arduino Event: %d - %s", event->event_id, WiFi.eventName(event->event_id));
24-
@@ -1065,7 +1063,7 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
25-
log_w("Reason: %u - %s", reason, WiFi.disconnectReasonName((wifi_err_reason_t)reason));
26-
if(reason == WIFI_REASON_NO_AP_FOUND) {
27-
WiFiSTAClass::_setStatus(WL_NO_SSID_AVAIL);
28-
- } else if((reason == WIFI_REASON_AUTH_FAIL) && !first_connect){
29-
+ } else if((reason == WIFI_REASON_AUTH_FAIL)){
30-
WiFiSTAClass::_setStatus(WL_CONNECT_FAILED);
31-
} else if(reason == WIFI_REASON_BEACON_TIMEOUT || reason == WIFI_REASON_HANDSHAKE_TIMEOUT) {
32-
WiFiSTAClass::_setStatus(WL_CONNECTION_LOST);
33-
@@ -1079,11 +1077,6 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
34-
bool DoReconnect = false;
35-
if(reason == WIFI_REASON_ASSOC_LEAVE) { //Voluntarily disconnected. Don't reconnect!
36-
}
37-
- else if(first_connect) { //Retry once for all failure reasons
38-
- first_connect = false;
39-
- DoReconnect = true;
40-
- log_d("WiFi Reconnect Running");
41-
- }
42-
else if(WiFi.getAutoReconnect() && _isReconnectableReason(reason)) {
43-
DoReconnect = true;
44-
log_d("WiFi AutoReconnect Running");
22+
if (ev->event_id == ARDUINO_EVENT_WIFI_STA_START) {
23+
@@ -135,7 +134,7 @@ static void _onStaArduinoEvent(arduino_event_t *ev) {
24+
log_w("Reason: %u - %s", reason, WiFi.STA.disconnectReasonName((wifi_err_reason_t)reason));
25+
if (reason == WIFI_REASON_NO_AP_FOUND) {
26+
_sta_network_if->_setStatus(WL_NO_SSID_AVAIL);
27+
- } else if ((reason == WIFI_REASON_AUTH_FAIL) && !first_connect) {
28+
+ } else if ((reason == WIFI_REASON_AUTH_FAIL)) {
29+
_sta_network_if->_setStatus(WL_CONNECT_FAILED);
30+
} else if (reason == WIFI_REASON_BEACON_TIMEOUT || reason == WIFI_REASON_HANDSHAKE_TIMEOUT) {
31+
_sta_network_if->_setStatus(WL_CONNECTION_LOST);
32+
@@ -147,10 +146,6 @@ static void _onStaArduinoEvent(arduino_event_t *ev) {
33+
34+
bool DoReconnect = false;
35+
if (reason == WIFI_REASON_ASSOC_LEAVE) { //Voluntarily disconnected. Don't reconnect!
36+
- } else if (first_connect) { //Retry once for all failure reasons
37+
- first_connect = false;
38+
- DoReconnect = true;
39+
- log_d("WiFi Reconnect Running");
40+
} else if (_sta_network_if->getAutoReconnect() && _is_staReconnectableReason(reason)) {
41+
DoReconnect = true;
42+
log_d("WiFi AutoReconnect Running");
4543
--
46-
2.42.0
44+
2.47.0
4745

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
From ae2270cb8d16c9cb3b63707ef67b03255943d160 Mon Sep 17 00:00:00 2001
2-
From: =?UTF-8?q?Mattias=20Sch=C3=A4ffersmann?= <mattias@tinkerforge.com>
3-
Date: Thu, 23 May 2024 17:13:04 +0200
1+
From e9f4396e362918b8fe535c764b222dcec941f8e2 Mon Sep 17 00:00:00 2001
2+
From: Erik Fleckstein <erik@tinkerforge.com>
3+
Date: Wed, 16 Oct 2024 10:54:17 +0200
44
Subject: [PATCH] WiFi: Disable 11b rates
55

66
802.11b has been obsolete for about 20 years. Keeping compatibility around
77
slows down devices not 20 years old.
88
---
9-
libraries/WiFi/src/WiFiGeneric.cpp | 15 +++++++++++++++
9+
libraries/WiFi/src/WiFiGeneric.cpp | 16 ++++++++++++++++
1010
libraries/WiFi/src/WiFiGeneric.h | 2 ++
11-
2 files changed, 17 insertions(+)
11+
2 files changed, 18 insertions(+)
1212

1313
diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp
14-
index 98fb6e60..d7328f8d 100644
14+
index ccc95181..2f363389 100644
1515
--- a/libraries/WiFi/src/WiFiGeneric.cpp
1616
+++ b/libraries/WiFi/src/WiFiGeneric.cpp
17-
@@ -766,6 +766,7 @@ static std::vector<WiFiEventCbList_t> cbEventList;
17+
@@ -333,6 +333,7 @@ static bool espWiFiStop() {
1818

1919
bool WiFiGenericClass::_persistent = true;
2020
bool WiFiGenericClass::_long_range = false;
2121
+bool WiFiGenericClass::_disable_sta_11b = true;
2222
wifi_mode_t WiFiGenericClass::_forceSleepLastMode = WIFI_MODE_NULL;
2323
#if CONFIG_IDF_TARGET_ESP32S2
2424
wifi_ps_type_t WiFiGenericClass::_sleepEnabled = WIFI_PS_NONE;
25-
@@ -1238,6 +1239,14 @@ void WiFiGenericClass::enableLongRange(bool enable)
26-
_long_range = enable;
25+
@@ -444,6 +445,15 @@ void WiFiGenericClass::enableLongRange(bool enable) {
26+
_long_range = enable;
2727
}
2828

2929
+/**
@@ -34,42 +34,43 @@ index 98fb6e60..d7328f8d 100644
3434
+{
3535
+ _disable_sta_11b = disable;
3636
+}
37-
37+
+
3838
/**
3939
* set new mode
40-
@@ -1286,6 +1295,12 @@ bool WiFiGenericClass::mode(wifi_mode_t m)
41-
}
42-
}
40+
* @param m WiFiMode_t
41+
@@ -526,6 +536,12 @@ bool WiFiGenericClass::mode(wifi_mode_t m) {
42+
}
4343
}
44-
+ // 11b is long obsolete. true = disable. Don't care if it can't be disabled.
45-
+ // Disable both because neither can be changed when trying to switch mode later.
46-
+ // Always disable 11b on AP because beacons are sent at minimum rate.
47-
+ esp_wifi_config_11b_rate(WIFI_IF_STA, _disable_sta_11b);
48-
+ esp_wifi_config_11b_rate(WIFI_IF_AP, true);
44+
}
45+
+ // 11b is long obsolete. true = disable. Don't care if it can't be disabled.
46+
+ // Disable both because neither can be changed when trying to switch mode later.
47+
+ // Always disable 11b on AP because beacons are sent at minimum rate.
48+
+ esp_wifi_config_11b_rate(WIFI_IF_STA, _disable_sta_11b);
49+
+ esp_wifi_config_11b_rate(WIFI_IF_AP, true);
4950
+
50-
if(!espWiFiStart()){
51-
return false;
52-
}
51+
if (!espWiFiStart()) {
52+
return false;
53+
}
5354
diff --git a/libraries/WiFi/src/WiFiGeneric.h b/libraries/WiFi/src/WiFiGeneric.h
54-
index 894c1346..e5d04100 100644
55+
index 2a5ca812..1886b95b 100644
5556
--- a/libraries/WiFi/src/WiFiGeneric.h
5657
+++ b/libraries/WiFi/src/WiFiGeneric.h
57-
@@ -173,6 +173,7 @@ class WiFiGenericClass
58+
@@ -92,6 +92,7 @@ public:
5859

59-
void persistent(bool persistent);
60-
void enableLongRange(bool enable);
61-
+ void disableSTA11b(bool disable);
60+
void persistent(bool persistent);
61+
void enableLongRange(bool enable);
62+
+ void disableSTA11b(bool disable);
6263

63-
static bool mode(wifi_mode_t);
64-
static wifi_mode_t getMode();
65-
@@ -205,6 +206,7 @@ class WiFiGenericClass
66-
protected:
67-
static bool _persistent;
68-
static bool _long_range;
69-
+ static bool _disable_sta_11b;
70-
static wifi_mode_t _forceSleepLastMode;
71-
static wifi_ps_type_t _sleepEnabled;
72-
static bool _wifiUseStaticBuffers;
64+
static bool mode(wifi_mode_t);
65+
static wifi_mode_t getMode();
66+
@@ -133,6 +134,7 @@ public:
67+
protected:
68+
static bool _persistent;
69+
static bool _long_range;
70+
+ static bool _disable_sta_11b;
71+
static wifi_mode_t _forceSleepLastMode;
72+
static wifi_ps_type_t _sleepEnabled;
73+
static bool _wifiUseStaticBuffers;
7374
--
74-
2.39.2
75+
2.47.0
7576

0 commit comments

Comments
 (0)