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

Commit

Permalink
v1.2.1 : Workaround for RP2040W WiFi.status() bug
Browse files Browse the repository at this point in the history
#### Releases v1.2.1

1. Workaround for RP2040W WiFi.status() bug
2. Add example [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W)
  • Loading branch information
khoih-prog authored Aug 16, 2022
1 parent 02f8b55 commit 952b40f
Show file tree
Hide file tree
Showing 23 changed files with 131 additions and 38 deletions.
95 changes: 82 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* [1. ArduinoSTL for AVR boards](#1-ArduinoSTL-for-AVR-boards)
* [Examples](#examples)
* [ 1. WiFiMulti](examples/WiFiMulti)
* [ 2. WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W) **New**
* [Example WiFiMulti](#example-WiFiMulti)
* [1. File WiFiMulti.ino](#1-File-WiFiMulti)
* [2. File defines.h](#2-File-definesh)
Expand All @@ -60,6 +61,7 @@
* [ 8. WiFiMulti on Arduino AVR Mega2560](#8-WiFiMulti-on-Arduino-AVR-Mega2560)
* [ 9. WiFiMulti on RTL8720DN](#9-WiFiMulti-on-RTL8720DN)
* [10. WiFiMulti on PORTENTA_H7_M7](#10-WiFiMulti-on-PORTENTA_H7_M7)
* [11. WiFiMulti on RP2040W](#11-WiFiMulti-on-RP2040W)
* [Debug](#debug)
* [Troubleshooting](#troubleshooting)
* [Issues](#issues)
Expand Down Expand Up @@ -539,6 +541,7 @@ Just copy the following file into the [`ArduinoSTL library`](https://github.com/
### Examples:

1. [WiFiMulti](examples/WiFiMulti)
2. [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W) **New**

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

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

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


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

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

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

```
Starting WiFiMulti on RASPBERRY_PI_PICO
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
WiFi shield init done
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Expand Down Expand Up @@ -657,7 +660,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on RaspberryPi Pico
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
WiFi shield init done
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Expand Down Expand Up @@ -748,7 +751,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on Nano RP2040 Connect
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -869,7 +872,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on NANO_RP2040_CONNECT
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -991,7 +994,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on ESP8266_NODEMCU_ESP12E
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [APlistAdd] Add SSID: SSID = HueNet1
[WFM] [APlistAdd] Add SSID: SSID = HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -1024,7 +1027,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on ESP32C3_DEV
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -1235,7 +1238,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on ESP32S3_DEV
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -1468,7 +1471,7 @@ The following are debug terminal output when running example [WiFiMulti](example

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

```
Starting WiFiMulti on RTL8720DN
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -1770,7 +1773,7 @@ The following are debug terminal output when running example [WiFiMulti](example

```
Starting WiFiMulti on PORTENTA_H7_M7
WiFiMulti_Generic v1.2.0
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
Connecting WiFi...
Expand Down Expand Up @@ -1862,6 +1865,71 @@ WiFi lost. Trying to scan and reconnect
[WFM] IP address: 192.168.2.77
```


---

#### 11. WiFiMulti on RP2040W

The following are debug terminal output when running example [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W) on `RASPBERRY_PI_PICO_W using CYW43439 WiFi`

#### 10.1 First time => OK


```
Starting WiFiMulti on RASPBERRY_PI_PICO_W
WiFiMulti_Generic v1.2.1
[WFM] [addAP] add SSID: HueNet1
[WFM] [addAP] add SSID: HueNet2
[WFM] [addAP] add SSID: ssid_from_AP_1
[WFM] [addAP] add SSID: ssid_from_AP_2
[WFM] [addAP] add SSID: ssid_from_AP_3
Connecting WiFi...
[WFM] [run] Scan done
[WFM] [run] Number of Networks found: 15
[run] Connecting BSSID: [WFM] EE:EE:EE:EE:EE:EE
[WFM] SSID: HueNet1 , Best dB: -62
[WFM] [run] Connecting done.
WiFi connected, SSID: HueNet1, IP address: 192.168.2.180
[WFM] Client connected, Local IP = 192.168.2.180
H[WFM] Client connected, Local IP = 192.168.2.180
H[WFM] Connection failed. Local IP = (IP unset)
WiFi lost. Call connectMultiWiFi in loop
WiFi lost. Trying to scan and reconnect
[WFM] [run] Scan done
[WFM] [run] Number of Networks found: 9
[run] Connecting BSSID: [WFM] EE:EE:EE:EE:EE:EE
[WFM] SSID: HueNet2 , Best dB: -62
[WFM] [run] Connecting done.
[WFM] WiFi connected after time: 1
[WFM] SSID: HueNet2 ,RSSI= 0
[WFM] IP address: 192.168.2.180
H[WFM] Client connected, Local IP = 192.168.2.180
```


#### 10.2 Lost WiFi => Scan and auto-reconnect

```
H[WFM] Connection failed. Local IP = (IP unset)
WiFi lost. Call connectMultiWiFi in loop
WiFi lost. Trying to scan and reconnect
[WFM] [run] Scan done
[WFM] [run] Number of Networks found: 9
[run] Connecting BSSID: [WFM] EE:EE:EE:EE:EE:EE
[WFM] SSID: HueNet2 , Best dB: -62
[WFM] [run] Connecting done.
[WFM] WiFi connected after time: 1
[WFM] SSID: HueNet2 ,RSSI= 0
[WFM] IP address: 192.168.2.180
H[WFM] Client connected, Local IP = 192.168.2.180
H[WFM] Connection failed. Local IP = (IP unset)
```


---
---

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

// Use this to disable all output debug msgs
// Debug Level from 0 to 4
#define _WIFIMULTI_LOGLEVEL_ 0
#define _WIFIMULTI_LOGLEVEL_ 2
```

---
Expand Down Expand Up @@ -1927,6 +1995,7 @@ Submit issues to: [WiFiMulti_Generic issues](https://github.com/khoih-prog/WiFiM
23. Add support to Maixduino boards using `WiFi101`, `WiFiNINA_Generic` or `WiFiEspAT`
24. Add support to Arduino, Sparkfun, Adafruit, etc. AVR boards (Mega, 32U4, etc.). To use `LibraryPatches` for `ArduinoSTL` library
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)
26. Workaround for RP2040W WiFi.status() bug

---
---
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


* [Changelog](#changelog)
* [Releases v1.2.1](#releases-v121)
* [Releases v1.2.0](#releases-v120)
* [Releases v1.1.1](#releases-v111)
* [Releases v1.1.0](#releases-v110)
Expand All @@ -22,6 +23,11 @@

## Changelog

#### Releases v1.2.1

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)
2. Add example [WiFiMulti_RP2040W](examples/WiFiMulti_RP2040W)

#### Releases v1.2.0

1. Add support to RASPBERRY_PI_PICO_W using CYW43439 WiFi
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WiFiMulti_Generic",
"version": "1.2.0",
"version": "1.2.1",
"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",
"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",
"authors":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=WiFiMulti_Generic
version=1.2.0
version=1.2.1
author=Khoi Hoang
license=GPLv3
maintainer=Khoi Hoang <khoih.prog@gmail.com>
Expand Down
4 changes: 2 additions & 2 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
; ============================================================
;default_envs = ESP8266
;default_envs = ESP32
default_envs = SAMD
;default_envs = SAMD
;default_envs = NRF52
;default_envs = STM32
;default_envs = pico
default_envs = pico
;default_envs = portenta_h7_m7
;default_envs = portenta_h7_m4

Expand Down
3 changes: 2 additions & 1 deletion src/ESP32/WiFiMulti_Generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp32 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/ESP32/WiFiMulti_Generic_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp32 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/ESP8266/ESP8266WiFiMulti.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/ESP8266/ESP8266WiFiMulti_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp32 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/ESP_AT/ESP_AT_WiFiMulti_Generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/ESP_AT/ESP_AT_WiFiMulti_Generic_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/PortentaH7/PortentaH7_WiFiMulti_Generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
Copyright (c) 2015 Markus Sattler. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
Version: 1.2.0
Version: 1.2.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 15/02/2020 Initial coding for ESP32, ESP8266, WiFiNINA and ESP_AT modules
1.1.0 K Hoang 16/02/2020 Add support to WiFi101 and many more boards (PortentaH7, megaAVR, Sparkfun SAMD, etc.)
1.1.1 K Hoang 26/04/2020 Fix bug
1.2.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi
1.2.1 K Hoang 16/08/2022 Workarounnd for RP2040W WiFi.status() bug
***************************************************************************************************************************************/

#pragma once
Expand Down
Loading

0 comments on commit 952b40f

Please sign in to comment.