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

Commit 55bc76f

Browse files
authored
v1.6.1 : Workaround for WiFi.status() bug
### Releases v1.6.1 1. Workaround for RP2040W `WiFi.status()` bug using `ping()` to local gateway for example [FullyFeatured_RP2040W](examples/RP2040W/FullyFeatured_RP2040W) 2. Use WiFi macAddress for RP2040W `_clientId`
1 parent b79ef78 commit 55bc76f

File tree

8 files changed

+114
-26
lines changed

8 files changed

+114
-26
lines changed

README.md

Lines changed: 86 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
* [11. FullyFeatured_QNEthernet on TEENSY 4.1 using QNEthernet](#11-FullyFeatured_QNEthernet-on-TEENSY-41-using-QNEthernet)
8181
* [12. FullyFeatured_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_ENC28J60 Ethernet](#12-FullyFeatured_ESP8266_Ethernet-on-ESP8266_NODEMCU_ESP12E-using-ESP8266_ENC28J60-Ethernet)
8282
* [13. FullyFeatured_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet](#13-FullyFeatured_ESP8266_Ethernet-on-ESP8266_NODEMCU_ESP12E-using-ESP8266_W5500-Ethernet)
83+
* [14. FullyFeature_RP2040W on RASPBERRY_PI_PICO_W](#14-FullyFeature_RP2040W-on-RASPBERRY_PI_PICO_W)
84+
#### 14. FullyFeature_RP2040W on RASPBERRY_PI_PICO_W
8385
* [Debug](#debug)
8486
* [Troubleshooting](#troubleshooting)
8587
* [Issues](#issues)
@@ -511,7 +513,7 @@ This is terminal debug output when running [FullyFeatured_ESP8266](examples/ESP8
511513

512514
```
513515
Starting FullyFeature_ESP8266 on ESP8266_NODEMCU_ESP12E
514-
AsyncMQTT_Generic v1.6.0 for ESP8266
516+
AsyncMQTT_Generic v1.6.1 for ESP8266
515517
Connecting to Wi-Fi...
516518
Connected to Wi-Fi. IP address: 192.168.2.82
517519
Connecting to MQTT...
@@ -573,7 +575,7 @@ This is terminal debug output when running [FullyFeatured_ESP32](examples/ESP32/
573575

574576
```
575577
Starting FullyFeature_ESP32 on ESP32_DEV
576-
AsyncMQTT_Generic v1.6.0 for ESP32 core v2.0.0+
578+
AsyncMQTT_Generic v1.6.1 for ESP32 core v2.0.0+
577579
Connecting to Wi-Fi...
578580
WiFi ready
579581
WiFi STA starting
@@ -639,7 +641,7 @@ This is terminal debug output when running [FullyFeaturedSSL_ESP32](examples/ESP
639641

640642
```
641643
Starting FullyFeatureSSL_ESP32 on ESP32_DEV
642-
AsyncMQTT_Generic v1.6.0 for ESP32 core v2.0.0+
644+
AsyncMQTT_Generic v1.6.1 for ESP32 core v2.0.0+
643645
Connecting to Wi-Fi...
644646
WiFi ready
645647
WiFi STA starting
@@ -706,7 +708,7 @@ This is terminal debug output when running [FullyFeaturedSSL_ESP32](examples/ESP
706708

707709
```
708710
Starting FullyFeatureSSL_ESP32 on ESP32_DEV
709-
AsyncMQTT_Generic v1.6.0 for ESP32 core v2.0.0+
711+
AsyncMQTT_Generic v1.6.1 for ESP32 core v2.0.0+
710712
Connecting to Wi-Fi...
711713
WiFi ready
712714
WiFi STA starting
@@ -877,7 +879,7 @@ This is terminal debug output when running [FullyFeaturedSSL_WT32_ETH01](example
877879
```
878880
Starting FullyFeatureSSL_WT32_ETH01 on WT32-ETH01 with ETH_PHY_LAN8720
879881
WebServer_WT32_ETH01 v1.5.0 for core v2.0.0+
880-
AsyncMQTT_Generic v1.6.0 for ESP32 core v2.0.0+
882+
AsyncMQTT_Generic v1.6.1 for ESP32 core v2.0.0+
881883
ETH starting
882884
ETH connected
883885
ETH got IP
@@ -934,7 +936,7 @@ This is terminal debug output when running [FullyFeature_STM32](examples/STM32/F
934936

935937
```
936938
Starting FullyFeature_STM32 on NUCLEO_F767ZI
937-
AsyncMQTT_Generic v1.6.0 for STM32
939+
AsyncMQTT_Generic v1.6.1 for STM32
938940
Connected to network. IP = 192.168.2.118
939941
Connecting to MQTT...
940942
Connected to MQTT broker: broker.emqx.io, port: 1883
@@ -1055,7 +1057,7 @@ Publish acknowledged.
10551057

10561058
```
10571059
Starting FullyFeature_STM32 on NUCLEO_F767ZI
1058-
AsyncMQTT_Generic v1.6.0 for STM32
1060+
AsyncMQTT_Generic v1.6.1 for STM32
10591061
Connected to network. IP = 192.168.2.126
10601062
Connecting to MQTT...
10611063
[AMQTT] CONNECTING
@@ -1230,7 +1232,7 @@ This is terminal debug output when running [FullyFeatured_STM32_LAN8720](example
12301232

12311233
```
12321234
Starting FullyFeatured_STM32_LAN8720 on BLACK_F407VE
1233-
AsyncMQTT_Generic v1.6.0 for STM32
1235+
AsyncMQTT_Generic v1.6.1 for STM32
12341236
Connected to network. IP = 192.168.2.132
12351237
Connecting to MQTT...
12361238
Connected to MQTT broker: broker.emqx.io, port: 1883
@@ -1297,7 +1299,7 @@ This is terminal debug output when running [FullyFeatured_PortentaH7_WiFi](examp
12971299

12981300
```
12991301
Starting FullyFeatured_PortentaH7_WiFi on PORTENTA_H7_M7
1300-
AsyncMQTT_Generic v1.6.0 for Portenta_H7_M7
1302+
AsyncMQTT_Generic v1.6.1 for Portenta_H7_M7
13011303
Connecting to SSID: HueNet1
13021304
Connected to SSID: HueNet1
13031305
Local IP Address: 192.168.2.134
@@ -1366,7 +1368,7 @@ This is terminal debug output when running [FullyFeatured_PortentaH7_Ethernet](e
13661368

13671369
```
13681370
Starting FullyFeatured_PortentaH7_Ethernet on PORTENTA_H7_M7
1369-
AsyncMQTT_Generic v1.6.0 for Portenta_H7_M7
1371+
AsyncMQTT_Generic v1.6.1 for Portenta_H7_M7
13701372
Connected to network. IP = 192.168.2.133
13711373
Connecting to MQTT...
13721374
Connected to MQTT broker: broker.emqx.io, port: 1883
@@ -1492,7 +1494,7 @@ This is terminal debug output when running [FullyFeatured_QNEthernet](examples/Q
14921494

14931495
```
14941496
Starting FullyFeatured_QNEthernet on TEENSY 4.1
1495-
AsyncMQTT_Generic v1.6.0 for Teensy 4.1 QNEthernet
1497+
AsyncMQTT_Generic v1.6.1 for Teensy 4.1 QNEthernet
14961498
Initialize Ethernet using static IP => Connected! IP address:192.168.2.222
14971499
Connecting to MQTT...
14981500
Connected to MQTT broker: broker.emqx.io, port: 1883
@@ -1559,7 +1561,7 @@ This is terminal debug output when running [FullyFeatured_ESP8266_Ethernet](exam
15591561

15601562
```
15611563
Starting FullyFeatured_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_ENC28J60 Ethernet
1562-
AsyncMQTT_Generic v1.6.0 for ESP8266
1564+
AsyncMQTT_Generic v1.6.1 for ESP8266
15631565
Connecting to network : .....................................
15641566
Ethernet DHCP IP address: 192.168.2.187
15651567
Connecting to MQTT...
@@ -1628,7 +1630,7 @@ This is terminal debug output when running [FullyFeatured_ESP8266_Ethernet](exam
16281630

16291631
```
16301632
Starting FullyFeatured_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet
1631-
AsyncMQTT_Generic v1.6.0 for ESP8266
1633+
AsyncMQTT_Generic v1.6.1 for ESP8266
16321634
Connecting to network : .
16331635
Ethernet DHCP IP address: 192.168.2.188
16341636
Connecting to MQTT...
@@ -1686,6 +1688,77 @@ Publish acknowledged.
16861688
packetId: 3
16871689
```
16881690

1691+
---
1692+
1693+
1694+
#### 14. FullyFeature_RP2040W on RASPBERRY_PI_PICO_W
1695+
1696+
This is terminal debug output when running [FullyFeature_RP2040W](examples/RP2040W/FullyFeature_RP2040W) on **RASPBERRY_PI_PICO_W**, using `CYW43439 WiFi`, connecting to `broker.emqx.io` MQTT server.
1697+
1698+
1699+
```
1700+
Starting FullyFeature_RP2040W on RASPBERRY_PI_PICO_W
1701+
AsyncMQTT_Generic v1.6.1 for RP2040W CYW43439 WiFi
1702+
Connecting to SSID: HueNet2
1703+
Connected to SSID: HueNet2
1704+
Local IP Address: 192.168.2.180
1705+
Signal strength (RSSI):0 dBm
1706+
Connecting to MQTT...
1707+
Connected to MQTT broker: broker.emqx.io, port: 1883
1708+
PubTopic: async-mqtt/RP2040W_Pub
1709+
************************************************
1710+
Session present: 0
1711+
Subscribing at QoS 2, packetId: 1
1712+
Publishing at QoS 0
1713+
Publishing at QoS 1, packetId: 2
1714+
Publishing at QoS 2, packetId: 3
1715+
************************************************
1716+
Subscribe acknowledged.
1717+
packetId: 1
1718+
qos: 2
1719+
Publish received.
1720+
topic: async-mqtt/RP2040W_Pub
1721+
message: RP2040W Test3
1722+
qos: 2
1723+
dup: 0
1724+
retain: 1
1725+
len: 13
1726+
index: 0
1727+
total: 13
1728+
Publish acknowledged.
1729+
packetId: 2
1730+
Publish received.
1731+
topic: async-mqtt/RP2040W_Pub
1732+
message: RP2040W Test1
1733+
qos: 0
1734+
dup: 0
1735+
retain: 0
1736+
len: 13
1737+
index: 0
1738+
total: 13
1739+
Publish received.
1740+
topic: async-mqtt/RP2040W_Pub
1741+
message: RP2040W Test2
1742+
qos: 1
1743+
dup: 0
1744+
retain: 0
1745+
len: 13
1746+
index: 0
1747+
total: 13
1748+
Publish received.
1749+
topic: async-mqtt/RP2040W_Pub
1750+
message: RP2040W Test3
1751+
qos: 2
1752+
dup: 0
1753+
retain: 0
1754+
len: 13
1755+
index: 0
1756+
total: 13
1757+
Publish acknowledged.
1758+
packetId: 3
1759+
1760+
```
1761+
16891762
---
16901763
---
16911764

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.6.1](#releases-v161)
1415
* [Releases v1.6.0](#releases-v160)
1516
* [Releases v1.5.0](#releases-v150)
1617
* [Releases v1.4.0](#releases-v140)
@@ -26,6 +27,11 @@
2627

2728
## Changelog
2829

30+
### Releases v1.6.1
31+
32+
1. Workaround for RP2040W `WiFi.status()` bug using `ping()` to local gateway for example [FullyFeatured_RP2040W](examples/RP2040W/FullyFeatured_RP2040W)
33+
2. Use WiFi macAddress for RP2040W `_clientId`
34+
2935
### Releases v1.6.0
3036

3137
1. Add support to **RASPBERRY_PI_PICO_W with CYW43439 WiFi**, using [**arduino-pico core v2.4.0+**](https://github.com/earlephilhower/arduino-pico)

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "AsyncMQTT_Generic",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"keywords": "communication, iot, automation, async, async-tcp, async-tcp-ssl, async-mqtt, mqtt, async-mqtt-client, esp8266, esp32, stm32, portenta-h7, wt32-eth01, tls, teensy-41, qn-ethernet, lwip, lan8742a, lan8720",
55
"description": "Arduino Arduino Library for ESP8266, ESP32, Portenta_H7, STM32 and RP2040W asynchronous MQTT client implementation. This library, ported to support ESP32, WT32_ETH01 (ESP32 + LAN8720), ESP8266, Portenta_H7 (Ethernet or WiFi) and STM32 (LAN8742A or LAN8720 Ethernet), Teensy 4.1 using QNEthernet, RASPBERRY_PI_PICO_W with CYW43439 WiFi. Currently supporting TLS/SSL for ESP32 only",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncMQTT_Generic
2-
version=1.6.0
2+
version=1.6.1
33
author=Marvin ROGER,Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
sentence=Arduino Library for ESP8266, ESP32, Portenta_H7, STM32 and RP2040W asynchronous MQTT client implementation

src/AsyncMqttClient_Generic.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1111
12-
Version: 1.6.0
12+
Version: 1.6.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -22,6 +22,7 @@
2222
1.4.0 K Hoang 17/03/2022 Add support to Teensy 4.1 using QNEthernet Library
2323
1.5.0 K Hoang 14/04/2022 Add support to ESP8266 W5x00/ENC28J60 using lwip_W5100/lwip_W5500 or lwip_enc28j60 library
2424
1.6.0 K Hoang 14/08/2022 Add support to RP2040W with CYW43439 WiFi using arduino-pico core
25+
1.6.1 K Hoang 17/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway
2526
*****************************************************************************************************************************/
2627

2728
#pragma once
@@ -40,15 +41,15 @@
4041

4142
/////////////////////////////////////////////////////////
4243

43-
#define ASYNC_MQTT_GENERIC_SHORT_VERSION "AsyncMQTT_Generic v1.6.0"
44+
#define ASYNC_MQTT_GENERIC_SHORT_VERSION "AsyncMQTT_Generic v1.6.1"
4445

4546
/////////////////////////////////////////////////////////
4647

4748
#define ASYNC_MQTT_GENERIC_VERSION_MAJOR 1
4849
#define ASYNC_MQTT_GENERIC_VERSION_MINOR 6
49-
#define ASYNC_MQTT_GENERIC_VERSION_PATCH 0
50+
#define ASYNC_MQTT_GENERIC_VERSION_PATCH 1
5051

51-
#define ASYNC_MQTT_GENERIC_VERSION_INT 1006000
52+
#define ASYNC_MQTT_GENERIC_VERSION_INT 1006001
5253

5354
/////////////////////////////////////////////////////////
5455

src/AsyncMqttClient_Generic_Debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1111
12-
Version: 1.6.0
12+
Version: 1.6.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -22,6 +22,7 @@
2222
1.4.0 K Hoang 17/03/2022 Add support to Teensy 4.1 using QNEthernet Library
2323
1.5.0 K Hoang 14/04/2022 Add support to ESP8266 W5x00/ENC28J60 using lwip_W5100/lwip_W5500 or lwip_enc28j60 library
2424
1.6.0 K Hoang 14/08/2022 Add support to RP2040W with CYW43439 WiFi using arduino-pico core
25+
1.6.1 K Hoang 17/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway
2526
*****************************************************************************************************************************/
2627

2728
#pragma once

src/AsyncMqttClient_Generic_Impl.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1111
12-
Version: 1.6.0
12+
Version: 1.6.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -22,6 +22,7 @@
2222
1.4.0 K Hoang 17/03/2022 Add support to Teensy 4.1 using QNEthernet Library
2323
1.5.0 K Hoang 14/04/2022 Add support to ESP8266 W5x00/ENC28J60 using lwip_W5100/lwip_W5500 or lwip_enc28j60 library
2424
1.6.0 K Hoang 14/08/2022 Add support to RP2040W with CYW43439 WiFi using arduino-pico core
25+
1.6.1 K Hoang 17/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway
2526
*****************************************************************************************************************************/
2627

2728
#pragma once
@@ -1139,7 +1140,7 @@ void AsyncMqttClient::connect()
11391140

11401141
#if (USE_ETHERNET_PORTENTA_H7)
11411142

1142-
// 6 HEX bytes + NULL
1143+
// 6 HEX bytes
11431144
uint8_t macPortenta[6];
11441145

11451146
Ethernet.MACAddress(macPortenta);
@@ -1182,10 +1183,15 @@ void AsyncMqttClient::connect()
11821183
_clientId = _generatedClientId;
11831184

11841185
#elif ASYNC_MQTT_USING_RP2040W
1185-
// For WiFi. TODO Get RP2040 unique hardwareID to use for WiFi
1186+
// For WiFi. Use macAddress for WiFi
1187+
// 6 HEX bytes
1188+
uint8_t macRP2040W[6];
1189+
1190+
WiFi.macAddress(macRP2040W);
1191+
1192+
snprintf(_generatedClientId, sizeof(_generatedClientId), "2040w-%02X%02X%02X%02X%02X%02X",
1193+
macRP2040W[0], macRP2040W[1], macRP2040W[2], macRP2040W[3], macRP2040W[4], macRP2040W[5]);
11861194

1187-
snprintf(_generatedClientId, sizeof(_generatedClientId), "2040w-%06lx", micros());
1188-
11891195
_clientId = _generatedClientId;
11901196

11911197
#endif

src/AsyncMqtt_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Built by Khoi Hoang https://github.com/khoih-prog/AsyncMqttClient_Generic
1111
12-
Version: 1.6.0
12+
Version: 1.6.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -22,6 +22,7 @@
2222
1.4.0 K Hoang 17/03/2022 Add support to Teensy 4.1 using QNEthernet Library
2323
1.5.0 K Hoang 14/04/2022 Add support to ESP8266 W5x00/ENC28J60 using lwip_W5100/lwip_W5500 or lwip_enc28j60 library
2424
1.6.0 K Hoang 14/08/2022 Add support to RP2040W with CYW43439 WiFi using arduino-pico core
25+
1.6.1 K Hoang 17/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway
2526
*****************************************************************************************************************************/
2627

2728
#pragma once

0 commit comments

Comments
 (0)