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

Commit 9e90dc5

Browse files
authored
v1.7.0 to fix ESP32/ESP8266 compile error
### Releases v1.7.0 1. Fix ESP32 compile error. Check [Missing default case in switch causes #10](#10) 2. Change to new [Forked ESPAsyncTCP library](https://github.com/khoih-prog/ESPAsyncTCP) for ESP8266 boards, using WiFi or LwIP Ethernet, with [ESP8266 core v3.0.2+](https://github.com/esp8266/Arduino/releases/tag/3.0.2) or WiFi with [ESP8266 core v2.7.4](https://github.com/esp8266/Arduino/releases/tag/2.7.4) to avoid compile errors
1 parent ef5ea4a commit 9e90dc5

File tree

21 files changed

+131
-62
lines changed

21 files changed

+131
-62
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 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-
* `ESP8266`,`ESP32`, `STM32`, `arduino-pico` or `Teensyduino` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.4, STM32 v2.3.0, arduino-pico v2.4.0 or Teensyduino v1.57)
18+
* `ESP8266`,`ESP32`, `STM32`, `arduino-pico` or `Teensyduino` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.4, STM32 v2.3.0, arduino-pico v2.5.2 or Teensyduino v1.57)
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:
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.19
3030
ESP32 Core Version 2.0.4
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
32+
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
3333
3434
Context:
3535
I encountered an endless loop while trying to connect to Local WiFi.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
portenta_h7_rules () {
4+
echo ""
5+
echo "# Portenta H7 bootloader mode UDEV rules"
6+
echo ""
7+
cat <<EOF
8+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
9+
EOF
10+
}
11+
12+
if [ "$EUID" -ne 0 ]
13+
then echo "Please run as root"
14+
exit
15+
fi
16+
17+
portenta_h7_rules > /etc/udev/rules.d/49-portenta_h7.rules
18+
19+
# reload udev rules
20+
echo "Reload rules..."
21+
udevadm trigger
22+
udevadm control --reload-rules

README.md

Lines changed: 49 additions & 30 deletions
Large diffs are not rendered by default.

changelog.md

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

1313
* [Changelog](#changelog)
14+
* [Releases v1.7.0](#releases-v170)
1415
* [Releases v1.6.1](#releases-v161)
1516
* [Releases v1.6.0](#releases-v160)
1617
* [Releases v1.5.0](#releases-v150)
@@ -27,6 +28,11 @@
2728

2829
## Changelog
2930

31+
### Releases v1.7.0
32+
33+
1. Fix ESP32 compile error. Check [Missing default case in switch causes #10](https://github.com/khoih-prog/AsyncMQTT_Generic/issues/10)
34+
2. Change to new [Forked ESPAsyncTCP library](https://github.com/khoih-prog/ESPAsyncTCP) for ESP8266 boards, using WiFi or LwIP Ethernet, with [ESP8266 core v3.0.2+](https://github.com/esp8266/Arduino/releases/tag/3.0.2) or WiFi with [ESP8266 core v2.7.4](https://github.com/esp8266/Arduino/releases/tag/2.7.4) to avoid compile errors
35+
3036
### Releases v1.6.1
3137

3238
1. Workaround for RP2040W `WiFi.status()` bug using `ping()` to local gateway for example [FullyFeatured_RP2040W](examples/RP2040W/FullyFeatured_RP2040W)

examples/ESP32/FullyFeaturedSSL_ESP32/FullyFeaturedSSL_ESP32.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ extern "C"
4949

5050
#endif
5151

52-
53-
5452
AsyncMqttClient mqttClient;
5553
TimerHandle_t mqttReconnectTimer;
5654
TimerHandle_t wifiReconnectTimer;
@@ -107,6 +105,8 @@ void WiFiEvent(WiFiEvent_t event)
107105
xTimerStart(wifiReconnectTimer, 0);
108106
break;
109107
#endif
108+
default:
109+
break;
110110
}
111111
}
112112

@@ -188,7 +188,7 @@ void onMqttPublish(const uint16_t& packetId)
188188
void setup()
189189
{
190190
Serial.begin(115200);
191-
while (!Serial);
191+
while (!Serial && millis() < 5000);
192192

193193
Serial.print("\nStarting FullyFeatureSSL_ESP32 on "); Serial.println(ARDUINO_BOARD);
194194
Serial.println(ASYNC_MQTT_GENERIC_VERSION);

examples/ESP32/FullyFeatured_ESP32/FullyFeatured_ESP32.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ void WiFiEvent(WiFiEvent_t event)
8686
xTimerStart(wifiReconnectTimer, 0);
8787
break;
8888
#endif
89+
default:
90+
break;
8991
}
9092
}
9193

@@ -167,7 +169,7 @@ void onMqttPublish(const uint16_t& packetId)
167169
void setup()
168170
{
169171
Serial.begin(115200);
170-
while (!Serial);
172+
while (!Serial && millis() < 5000);
171173

172174
Serial.print("\nStarting FullyFeature_ESP32 on "); Serial.println(ARDUINO_BOARD);
173175
Serial.println(ASYNC_MQTT_GENERIC_VERSION);

examples/ESP8266/FullyFeatured_ESP8266/FullyFeatured_ESP8266.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************************************************************
2-
FullyFeatureSSL_ESP8266.ino
2+
FullyFeature_ESP8266.ino
33
44
AsyncMqttClient_Generic is a library for ESP32, ESP8266, Protenta_H7, STM32F7, etc. with current AsyncTCP support
55
@@ -10,6 +10,10 @@
1010
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1111
*****************************************************************************************************************************/
1212

13+
// Use ESP8266 core v2.7.4- for SSL as new cores don't use axtls anymore
14+
// Use core v3.0.2+ for LwIP Ethernet W5500lwIP, W5100lwIP and ENC28J60lwIP libraries
15+
// Must use KH forked ESPAsyncTCP library or compile error
16+
1317
#include "defines.h"
1418

1519
#include <ESP8266WiFi.h>
@@ -137,7 +141,7 @@ void onMqttPublish(const uint16_t& packetId)
137141
void setup()
138142
{
139143
Serial.begin(115200);
140-
while (!Serial);
144+
while (!Serial && millis() < 5000);
141145

142146
delay(300);
143147

examples/ESP8266/FullyFeatured_ESP8266/defines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1010
***************************************************************************************************************************************/
1111

12+
// Use ESP8266 core v2.7.4- for SSL as new cores don't use axtls anymore
13+
// Use core v3.0.2+ for LwIP Ethernet W5500lwIP, W5100lwIP and ENC28J60lwIP libraries
14+
// Must use KH forked ESPAsyncTCP library or compile error
15+
1216
#ifndef defines_h
1317
#define defines_h
1418

examples/ESP8266/FullyFeatured_ESP8266_Ethernet/FullyFeatured_ESP8266_Ethernet.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1111
*****************************************************************************************************************************/
1212

13+
// Use ESP8266 core v2.7.4- for SSL as new cores don't use axtls anymore
14+
// Use core v3.0.2+ for LwIP Ethernet W5500lwIP, W5100lwIP and ENC28J60lwIP libraries
15+
// Must use KH forked ESPAsyncTCP library or compile error
16+
1317
#include "defines.h"
1418

1519
// Check connection every 2s

examples/ESP8266/FullyFeatured_ESP8266_Ethernet/defines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1010
***************************************************************************************************************************************/
1111

12+
// Use ESP8266 core v2.7.4- for SSL as new cores don't use axtls anymore
13+
// Use core v3.0.2+ for LwIP Ethernet W5500lwIP, W5100lwIP and ENC28J60lwIP libraries
14+
// Must use KH forked ESPAsyncTCP library or compile error
15+
1216
#ifndef defines_h
1317
#define defines_h
1418

0 commit comments

Comments
 (0)