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

Commit 952b40f

Browse files
authored
v1.2.1 : Workaround for RP2040W WiFi.status() bug
#### Releases v1.2.1 1. Workaround for RP2040W WiFi.status() bug 2. Add example [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W)
1 parent 02f8b55 commit 952b40f

23 files changed

+131
-38
lines changed

README.md

Lines changed: 82 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* [1. ArduinoSTL for AVR boards](#1-ArduinoSTL-for-AVR-boards)
4747
* [Examples](#examples)
4848
* [ 1. WiFiMulti](examples/WiFiMulti)
49+
* [ 2. WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W) **New**
4950
* [Example WiFiMulti](#example-WiFiMulti)
5051
* [1. File WiFiMulti.ino](#1-File-WiFiMulti)
5152
* [2. File defines.h](#2-File-definesh)
@@ -60,6 +61,7 @@
6061
* [ 8. WiFiMulti on Arduino AVR Mega2560](#8-WiFiMulti-on-Arduino-AVR-Mega2560)
6162
* [ 9. WiFiMulti on RTL8720DN](#9-WiFiMulti-on-RTL8720DN)
6263
* [10. WiFiMulti on PORTENTA_H7_M7](#10-WiFiMulti-on-PORTENTA_H7_M7)
64+
* [11. WiFiMulti on RP2040W](#11-WiFiMulti-on-RP2040W)
6365
* [Debug](#debug)
6466
* [Troubleshooting](#troubleshooting)
6567
* [Issues](#issues)
@@ -539,6 +541,7 @@ Just copy the following file into the [`ArduinoSTL library`](https://github.com/
539541
### Examples:
540542

541543
1. [WiFiMulti](examples/WiFiMulti)
544+
2. [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W) **New**
542545

543546
---
544547
---
@@ -547,12 +550,12 @@ Just copy the following file into the [`ArduinoSTL library`](https://github.com/
547550

548551
#### 1. File [WiFiMulti.ino](examples/WiFiMulti/WiFiMulti.ino)
549552

550-
https://github.com/khoih-prog/WiFiMulti_Generic/blob/40fa20df73304b8f63c271fa54117472f29eb938/examples/WiFiMulti/WiFiMulti.ino#L21-L193
553+
https://github.com/khoih-prog/WiFiMulti_Generic/blob/02f8b5580ff5d7821299f219524df0c9d95e4b79/examples/WiFiMulti/WiFiMulti.ino#L21-L226
551554

552555

553556
#### 2. File [defines.h](examples/WiFiMulti/defines.h)
554557

555-
https://github.com/khoih-prog/WiFiMulti_Generic/blob/40fa20df73304b8f63c271fa54117472f29eb938/examples/WiFiMulti/defines.h#L15-L529
558+
https://github.com/khoih-prog/WiFiMulti_Generic/blob/02f8b5580ff5d7821299f219524df0c9d95e4b79/examples/WiFiMulti/defines.h#L1-L529
556559

557560
---
558561
---
@@ -567,7 +570,7 @@ The following are debug terminal output when running example [WiFiMulti](example
567570

568571
```
569572
Starting WiFiMulti on RASPBERRY_PI_PICO
570-
WiFiMulti_Generic v1.2.0
573+
WiFiMulti_Generic v1.2.1
571574
WiFi shield init done
572575
[WFM] [addAP] add SSID: HueNet1
573576
[WFM] [addAP] add SSID: HueNet2
@@ -657,7 +660,7 @@ The following are debug terminal output when running example [WiFiMulti](example
657660

658661
```
659662
Starting WiFiMulti on RaspberryPi Pico
660-
WiFiMulti_Generic v1.2.0
663+
WiFiMulti_Generic v1.2.1
661664
WiFi shield init done
662665
[WFM] [addAP] add SSID: HueNet1
663666
[WFM] [addAP] add SSID: HueNet2
@@ -748,7 +751,7 @@ The following are debug terminal output when running example [WiFiMulti](example
748751

749752
```
750753
Starting WiFiMulti on Nano RP2040 Connect
751-
WiFiMulti_Generic v1.2.0
754+
WiFiMulti_Generic v1.2.1
752755
[WFM] [addAP] add SSID: HueNet1
753756
[WFM] [addAP] add SSID: HueNet2
754757
Connecting WiFi...
@@ -869,7 +872,7 @@ The following are debug terminal output when running example [WiFiMulti](example
869872

870873
```
871874
Starting WiFiMulti on NANO_RP2040_CONNECT
872-
WiFiMulti_Generic v1.2.0
875+
WiFiMulti_Generic v1.2.1
873876
[WFM] [addAP] add SSID: HueNet1
874877
[WFM] [addAP] add SSID: HueNet2
875878
Connecting WiFi...
@@ -991,7 +994,7 @@ The following are debug terminal output when running example [WiFiMulti](example
991994

992995
```
993996
Starting WiFiMulti on ESP8266_NODEMCU_ESP12E
994-
WiFiMulti_Generic v1.2.0
997+
WiFiMulti_Generic v1.2.1
995998
[WFM] [APlistAdd] Add SSID: SSID = HueNet1
996999
[WFM] [APlistAdd] Add SSID: SSID = HueNet2
9971000
Connecting WiFi...
@@ -1024,7 +1027,7 @@ The following are debug terminal output when running example [WiFiMulti](example
10241027

10251028
```
10261029
Starting WiFiMulti on ESP32C3_DEV
1027-
WiFiMulti_Generic v1.2.0
1030+
WiFiMulti_Generic v1.2.1
10281031
[WFM] [addAP] add SSID: HueNet1
10291032
[WFM] [addAP] add SSID: HueNet2
10301033
Connecting WiFi...
@@ -1235,7 +1238,7 @@ The following are debug terminal output when running example [WiFiMulti](example
12351238

12361239
```
12371240
Starting WiFiMulti on ESP32S3_DEV
1238-
WiFiMulti_Generic v1.2.0
1241+
WiFiMulti_Generic v1.2.1
12391242
[WFM] [addAP] add SSID: HueNet1
12401243
[WFM] [addAP] add SSID: HueNet2
12411244
Connecting WiFi...
@@ -1468,7 +1471,7 @@ The following are debug terminal output when running example [WiFiMulti](example
14681471

14691472
```
14701473
Starting WiFiMulti on Arduino AVR Mega2560/ADK
1471-
WiFiMulti_Generic v1.2.0
1474+
WiFiMulti_Generic v1.2.1
14721475
WiFi shield init done
14731476
[WFM] [addAP] add SSID: HueNet1
14741477
[WFM] [addAP] add SSID: HueNet2
@@ -1555,7 +1558,7 @@ The following are debug terminal output when running example [WiFiMulti](example
15551558

15561559
```
15571560
Starting WiFiMulti on RTL8720DN
1558-
WiFiMulti_Generic v1.2.0
1561+
WiFiMulti_Generic v1.2.1
15591562
[WFM] [addAP] add SSID: HueNet1
15601563
[WFM] [addAP] add SSID: HueNet2
15611564
Connecting WiFi...
@@ -1770,7 +1773,7 @@ The following are debug terminal output when running example [WiFiMulti](example
17701773

17711774
```
17721775
Starting WiFiMulti on PORTENTA_H7_M7
1773-
WiFiMulti_Generic v1.2.0
1776+
WiFiMulti_Generic v1.2.1
17741777
[WFM] [addAP] add SSID: HueNet1
17751778
[WFM] [addAP] add SSID: HueNet2
17761779
Connecting WiFi...
@@ -1862,6 +1865,71 @@ WiFi lost. Trying to scan and reconnect
18621865
[WFM] IP address: 192.168.2.77
18631866
```
18641867

1868+
1869+
---
1870+
1871+
#### 11. WiFiMulti on RP2040W
1872+
1873+
The following are debug terminal output when running example [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W) on `RASPBERRY_PI_PICO_W using CYW43439 WiFi`
1874+
1875+
#### 10.1 First time => OK
1876+
1877+
1878+
```
1879+
Starting WiFiMulti on RASPBERRY_PI_PICO_W
1880+
WiFiMulti_Generic v1.2.1
1881+
[WFM] [addAP] add SSID: HueNet1
1882+
[WFM] [addAP] add SSID: HueNet2
1883+
[WFM] [addAP] add SSID: ssid_from_AP_1
1884+
[WFM] [addAP] add SSID: ssid_from_AP_2
1885+
[WFM] [addAP] add SSID: ssid_from_AP_3
1886+
Connecting WiFi...
1887+
[WFM] [run] Scan done
1888+
[WFM] [run] Number of Networks found: 15
1889+
[run] Connecting BSSID: [WFM] EE:EE:EE:EE:EE:EE
1890+
[WFM] SSID: HueNet1 , Best dB: -62
1891+
[WFM] [run] Connecting done.
1892+
1893+
WiFi connected, SSID: HueNet1, IP address: 192.168.2.180
1894+
[WFM] Client connected, Local IP = 192.168.2.180
1895+
1896+
H[WFM] Client connected, Local IP = 192.168.2.180
1897+
H[WFM] Connection failed. Local IP = (IP unset)
1898+
1899+
WiFi lost. Call connectMultiWiFi in loop
1900+
WiFi lost. Trying to scan and reconnect
1901+
[WFM] [run] Scan done
1902+
[WFM] [run] Number of Networks found: 9
1903+
[run] Connecting BSSID: [WFM] EE:EE:EE:EE:EE:EE
1904+
[WFM] SSID: HueNet2 , Best dB: -62
1905+
[WFM] [run] Connecting done.
1906+
[WFM] WiFi connected after time: 1
1907+
[WFM] SSID: HueNet2 ,RSSI= 0
1908+
[WFM] IP address: 192.168.2.180
1909+
H[WFM] Client connected, Local IP = 192.168.2.180
1910+
```
1911+
1912+
1913+
#### 10.2 Lost WiFi => Scan and auto-reconnect
1914+
1915+
```
1916+
H[WFM] Connection failed. Local IP = (IP unset)
1917+
1918+
WiFi lost. Call connectMultiWiFi in loop
1919+
WiFi lost. Trying to scan and reconnect
1920+
[WFM] [run] Scan done
1921+
[WFM] [run] Number of Networks found: 9
1922+
[run] Connecting BSSID: [WFM] EE:EE:EE:EE:EE:EE
1923+
[WFM] SSID: HueNet2 , Best dB: -62
1924+
[WFM] [run] Connecting done.
1925+
[WFM] WiFi connected after time: 1
1926+
[WFM] SSID: HueNet2 ,RSSI= 0
1927+
[WFM] IP address: 192.168.2.180
1928+
H[WFM] Client connected, Local IP = 192.168.2.180
1929+
H[WFM] Connection failed. Local IP = (IP unset)
1930+
```
1931+
1932+
18651933
---
18661934
---
18671935

@@ -1875,7 +1943,7 @@ Debug is enabled by default on Serial. Debug Level from 0 to 4. To disable, chan
18751943

18761944
// Use this to disable all output debug msgs
18771945
// Debug Level from 0 to 4
1878-
#define _WIFIMULTI_LOGLEVEL_ 0
1946+
#define _WIFIMULTI_LOGLEVEL_ 2
18791947
```
18801948

18811949
---
@@ -1927,6 +1995,7 @@ Submit issues to: [WiFiMulti_Generic issues](https://github.com/khoih-prog/WiFiM
19271995
23. Add support to Maixduino boards using `WiFi101`, `WiFiNINA_Generic` or `WiFiEspAT`
19281996
24. Add support to Arduino, Sparkfun, Adafruit, etc. AVR boards (Mega, 32U4, etc.). To use `LibraryPatches` for `ArduinoSTL` library
19291997
25. Add support to RASPBERRY_PI_PICO_W using CYW43439 WiFi with [**Earle Philhower's arduino-pico core** v2.4.0+](https://github.com/earlephilhower/arduino-pico)
1998+
26. Workaround for RP2040W WiFi.status() bug
19301999

19312000
---
19322001
---

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.2.1](#releases-v121)
1516
* [Releases v1.2.0](#releases-v120)
1617
* [Releases v1.1.1](#releases-v111)
1718
* [Releases v1.1.0](#releases-v110)
@@ -22,6 +23,11 @@
2223

2324
## Changelog
2425

26+
#### Releases v1.2.1
27+
28+
1. Workaround for RP2040W WiFi.status() bug. Check [WiFi.status() wrongly reports WL_CONNECTED even when WiFi is lost and RSSI is always 0 dBm #762](https://github.com/earlephilhower/arduino-pico/issues/762)
29+
2. Add example [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W)
30+
2531
#### Releases v1.2.0
2632

2733
1. Add support to RASPBERRY_PI_PICO_W using CYW43439 WiFi

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WiFiMulti_Generic",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"keywords": "WiFi, WiFiMulti, WiFi-Multi, Arduino, ESP32, ESP8266, WiFiNINA, WiFiNINA-Generic, ESP8266-AT, ESP32-AT, RP2040, Nano-33-IoT, Nano-RP2040-Connect, SAMD, Teensy, Portenta, nRF52, SAM-DUE, AT-Command, mbed",
55
"description": "Simple MultiWiFi library to adapt ESP32/ESP8266 MultiWiFi of WiFi libraries to all other WiFi modules and libraries. Currently supporting ESP32, ESP8266, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52, RP2040-based (Nano-RP2040-Connect, RASPBERRY_PI_PICO, RASPBERRY_PI_PICO_W, etc.) boards using WiFi, such as WiFiNINA, WiFi101, CYW43439, U-Blox W101, W102, ESP8266/ESP32-AT modules/shields, with functions similar to those of ESP8266/ESP32 MultiWiFi of WiFi libraries",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=WiFiMulti_Generic
2-
version=1.2.0
2+
version=1.2.1
33
author=Khoi Hoang
44
license=GPLv3
55
maintainer=Khoi Hoang <khoih.prog@gmail.com>

platformio/platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
; ============================================================
2020
;default_envs = ESP8266
2121
;default_envs = ESP32
22-
default_envs = SAMD
22+
;default_envs = SAMD
2323
;default_envs = NRF52
2424
;default_envs = STM32
25-
;default_envs = pico
25+
default_envs = pico
2626
;default_envs = portenta_h7_m7
2727
;default_envs = portenta_h7_m4
2828

src/ESP32/WiFiMulti_Generic.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
Copyright (c) 2015 Markus Sattler. All rights reserved.
2525
This file is part of the esp32 core for Arduino environment.
2626
27-
Version: 1.2.0
27+
Version: 1.2.1
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
3232
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
3333
1.1.1 K Hoang 26/04/2020 Fix bug
3434
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
35+
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
3536
***************************************************************************************************************************************/
3637

3738
#pragma once

src/ESP32/WiFiMulti_Generic_Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
Copyright (c) 2015 Markus Sattler. All rights reserved.
2525
This file is part of the esp32 core for Arduino environment.
2626
27-
Version: 1.2.0
27+
Version: 1.2.1
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
3232
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
3333
1.1.1 K Hoang 26/04/2020 Fix bug
3434
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
35+
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
3536
***************************************************************************************************************************************/
3637

3738
#pragma once

src/ESP8266/ESP8266WiFiMulti.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
Copyright (c) 2015 Markus Sattler. All rights reserved.
2525
This file is part of the esp8266 core for Arduino environment.
2626
27-
Version: 1.2.0
27+
Version: 1.2.1
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
3232
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
3333
1.1.1 K Hoang 26/04/2020 Fix bug
3434
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
35+
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
3536
***************************************************************************************************************************************/
3637

3738
#pragma once

src/ESP8266/ESP8266WiFiMulti_Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
Copyright (c) 2015 Markus Sattler. All rights reserved.
2525
This file is part of the esp32 core for Arduino environment.
2626
27-
Version: 1.2.0
27+
Version: 1.2.1
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
3232
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
3333
1.1.1 K Hoang 26/04/2020 Fix bug
3434
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
35+
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
3536
***************************************************************************************************************************************/
3637

3738
#pragma once

src/ESP_AT/ESP_AT_WiFiMulti_Generic.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
Copyright (c) 2015 Markus Sattler. All rights reserved.
2525
This file is part of the esp8266 core for Arduino environment.
2626
27-
Version: 1.2.0
27+
Version: 1.2.1
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
3131
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
3232
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
3333
1.1.1 K Hoang 26/04/2020 Fix bug
3434
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
35+
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
3536
***************************************************************************************************************************************/
3637

3738
#pragma once

0 commit comments

Comments
 (0)