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

Commit

Permalink
Update README.md and use allman astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
khoih-prog authored Nov 24, 2022
1 parent 673b8af commit 7969f1a
Show file tree
Hide file tree
Showing 21 changed files with 1,317 additions and 1,133 deletions.
28 changes: 24 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v3.1.1, etc.)
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v3.4.1, etc.)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -28,26 +28,46 @@ Please ensure to specify the following:
```
Arduino IDE version: 1.8.19
RASPBERRY_PI_PICO board
ArduinoCore-mbed v3.1.1
ArduinoCore-mbed v3.4.1
OS: Ubuntu 20.04 LTS
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
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while trying to use the Timer Interrupt.
I encountered a crash while using this library
Steps to reproduce:
1. ...
2. ...
3. ...
4. ...
```

---

### Sending Feature Requests

Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.

There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/WiFiMulti_Generic/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.

---

### Sending Pull Requests

Pull Requests with changes and fixes are also welcome!

Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)

1. Change directory to the library GitHub

```
xy@xy-Inspiron-3593:~$ cd Arduino/xy/WiFiMulti_Generic_GitHub/
xy@xy-Inspiron-3593:~/Arduino/xy/WiFiMulti_Generic_GitHub$
```

2. Issue astyle command

```
xy@xy-Inspiron-3593:~/Arduino/xy/WiFiMulti_Generic_GitHub$ bash utils/restyle.sh
```

153 changes: 92 additions & 61 deletions README.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
## WiFiMulti_Generic
## WiFiMulti_Generic Library

[![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiMulti_Generic.svg?)](https://www.ardu-badge.com/WiFiMulti_Generic)
[![GitHub release](https://img.shields.io/github/release/khoih-prog/WiFiMulti_Generic.svg)](https://github.com/khoih-prog/WiFiMulti_Generic/releases)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/WiFiMulti_Generic.svg)](http://github.com/khoih-prog/WiFiMulti_Generic/issues)


<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
<a href="https://profile-counter.glitch.me/khoih-prog-WiFiMulti_Generic/count.svg" title="WiFiMulti_Generic Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-WiFiMulti_Generic/count.svg" style="height: 30px;width: 200px;"></a>
---
---

Expand All @@ -26,7 +31,7 @@

#### Releases v1.2.2

1. Better workaround for RP2040W WiFi.status() bug using ping() to local gateway. 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)
1. Better workaround for RP2040W WiFi.status() bug using `ping()` to local gateway. 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)

#### Releases v1.2.1

Expand Down
39 changes: 21 additions & 18 deletions examples/WiFiMulti/WiFiMulti.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**************************************************************************************************************************************
WiFiMulti.ino
For any WiFi shields, such as ESP32, ESP8266, Portenta_H7, WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, etc
WiFiMulti_Generic is a library to adapt the ESP32/ESP8266 WiFiMulti feature to other WiFi modules
Based on and modified from WiFiMulti of ESP32 core: https://github.com/espressif/arduino-esp32
Based on and modified from WiFiMulti of ESP8266 core: https://github.com/esp8266/Arduino
Built by Khoi Hoang https://github.com/khoih-prog/WiFiMulti_Generic
License under GPL-3.0
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Expand Down Expand Up @@ -60,26 +60,26 @@ void heartBeatPrint()
else if (num++ % 10 == 0)
{
Serial.print(F(" "));
}
}
}

uint8_t connectMultiWiFi()
{
#if defined(ESP32)
// For ESP32, this better be 0 to shorten the connect time.
// For ESP32-S2/C3, must be > 500
#if ( USING_ESP32_S2 || USING_ESP32_C3 )
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 500L
#else
// For ESP32 core v1.0.6, must be >= 500
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 800L
#endif
#if ( USING_ESP32_S2 || USING_ESP32_C3 )
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 500L
#else
// For ESP32 core v1.0.6, must be >= 500
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 800L
#endif
#elif (defined(ESP8266))
// For ESP8266, this better be 2200 to enable connect the 1st time
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 2200L
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 2200L
#else
// For general board, this better be 1000 to enable connect the 1st time
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 1000L
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 1000L
#endif

#define WIFI_MULTI_CONNECT_WAITING_MS 500L
Expand Down Expand Up @@ -132,6 +132,7 @@ uint8_t connectMultiWiFi()
void check_WiFi()
{
#if ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) )

// Workaround for bug in https://github.com/arduino/ArduinoCore-mbed/issues/381
if ( (WiFi.status() != WL_CONNECTED) || (WiFi.RSSI() == 0) )
#elif ( defined(ARDUINO_RASPBERRY_PI_PICO_W) )
Expand All @@ -155,9 +156,9 @@ void check_status()
#if ( defined(ARDUINO_RASPBERRY_PI_PICO_W) )
// You can change longer or shorter depending on your network response
// Shorter => more responsive, but more ping traffic
#define WIFICHECK_INTERVAL 1000L
#define WIFICHECK_INTERVAL 1000L
#else
#define WIFICHECK_INTERVAL 1000L
#define WIFICHECK_INTERVAL 1000L
#endif

#define HEARTBEAT_INTERVAL 10000L
Expand Down Expand Up @@ -185,9 +186,11 @@ void check_status()
void setup()
{
Serial.begin(115200);

while (!Serial && millis() < 5000);

Serial.print(F("\nStarting WiFiMulti on ")); Serial.println(BOARD_NAME);
Serial.print(F("\nStarting WiFiMulti on "));
Serial.println(BOARD_NAME);
Serial.println(WIFIMULTI_GENERIC_VERSION);

#if WIFI_USING_ESP_AT
Expand Down
Loading

0 comments on commit 7969f1a

Please sign in to comment.