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

Commit 6ff6ec9

Browse files
authored
Update README.md and use allman astyle
1 parent 6cda0e4 commit 6ff6ec9

9 files changed

+858
-700
lines changed

CONTRIBUTING.md

+23-4
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-
* `ArduinoCore-mbed` Core Version (e.g. `ArduinoCore-mbed` mbed_portenta core v3.0.1)
18+
* `ArduinoCore-mbed` Core Version (e.g. `ArduinoCore-mbed` mbed_portenta core v3.4.1)
1919
* `Portenta_H7` Board type (e.g. Portenta_H7 Rev2 ABX00042, etc.)
2020
* Contextual information (e.g. what you were trying to achieve)
2121
* Simplest possible steps to reproduce
@@ -28,13 +28,13 @@ Please ensure to specify the following:
2828

2929
```
3030
Arduino IDE version: 1.8.19
31-
`ArduinoCore-mbed` mbed_portenta core v3.0.1
31+
`ArduinoCore-mbed` mbed_portenta core v3.4.1
3232
Portenta_H7 Rev2 ABX00042
3333
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
34+
Linux xy-Inspiron-3593 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3535
3636
Context:
37-
I encountered a crash while using TimerInterrupt.
37+
I encountered a crash while trying to use the library
3838
3939
Steps to reproduce:
4040
1. ...
@@ -43,14 +43,33 @@ Steps to reproduce:
4343
4. ...
4444
```
4545

46+
---
4647

4748
### Sending Feature Requests
4849

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

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

54+
---
55+
5356
### Sending Pull Requests
5457

5558
Pull Requests with changes and fixes are also welcome!
5659

60+
Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)
61+
62+
1. Change directory to the library GitHub
63+
64+
```
65+
xy@xy-Inspiron-3593:~$ cd Arduino/xy/WiFiManager_Portenta_H7_Lite_GitHub/
66+
xy@xy-Inspiron-3593:~/Arduino/xy/WiFiManager_Portenta_H7_Lite_GitHub$
67+
```
68+
69+
2. Issue astyle command
70+
71+
```
72+
xy@xy-Inspiron-3593:~/Arduino/xy/WiFiManager_Portenta_H7_Lite_GitHub$ bash utils/restyle.sh
73+
```
74+
75+

README.md

+31-29
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<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>
1010
<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>
11+
<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>
12+
<a href="https://profile-counter.glitch.me/khoih-prog-WiFiManager_Portenta_H7_Lite/count.svg" title="WiFiManager_Portenta_H7_Lite Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-WiFiManager_Portenta_H7_Lite/count.svg" style="height: 30px;width: 200px;"></a>
1113

1214

1315
---
@@ -108,7 +110,7 @@ The current `mbed_portenta core v2.6.1` has bug that once WiFi is connected, `Wi
108110

109111
The current workaround for this `WiFi.status()` bug is to use it with `WiFi.RSSI()`, such as
110112

111-
```
113+
```cpp
112114
bool WiFiConnected()
113115
{
114116
return ( (WiFi.status() == WL_CONNECTED) && (WiFi.RSSI() != 0) );
@@ -128,7 +130,7 @@ The current `mbed_portenta core v2.6.1` has bug that once WiFi is connected and
128130

129131
The current fix for this bug is to use `WiFi.end()` before `WiFi.begin()`, such as
130132

131-
```
133+
```cpp
132134
// Must have to reconnect after WiFi lost
133135
WiFi.end();
134136

@@ -206,12 +208,12 @@ This [**WiFiManager_Portenta_H7_Lite** library](https://github.com/khoih-prog/Wi
206208
## Prerequisites
207209

208210
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
209-
2. [`ArduinoCore-mbed mbed_portenta core 3.0.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino **Portenta_H7** boards, such as **Portenta_H7 Rev2 ABX00042, etc.**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
211+
2. [`ArduinoCore-mbed mbed_portenta core 3.4.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino **Portenta_H7** boards, such as **Portenta_H7 Rev2 ABX00042, etc.**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
210212
3. [`Functional-Vlpp library v1.0.2+`](https://github.com/khoih-prog/functional-vlpp) to use server's lambda function. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/Functional-Vlpp.svg?)](https://www.ardu-badge.com/Functional-Vlpp)
211-
4. [`WiFiWebServer library v1.8.0+`](https://github.com/khoih-prog/WiFiWebServer). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiWebServer.svg?)](https://www.ardu-badge.com/WiFiWebServer)
212-
5. [`LittleFS_Portenta_H7 v1.1.0+`](https://github.com/khoih-prog/LittleFS_Portenta_H7). To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_Portenta_H7.svg?)](https://www.ardu-badge.com/LittleFS_Portenta_H7)
213+
4. [`WiFiWebServer library v1.10.0+`](https://github.com/khoih-prog/WiFiWebServer). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiWebServer.svg?)](https://www.ardu-badge.com/WiFiWebServer)
214+
5. [`LittleFS_Portenta_H7 v1.2.0+`](https://github.com/khoih-prog/LittleFS_Portenta_H7). To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_Portenta_H7.svg?)](https://www.ardu-badge.com/LittleFS_Portenta_H7)
213215
6. [`DoubleResetDetector_Generic v1.8.1+`](https://github.com/khoih-prog/DoubleResetDetector_Generic). To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/DoubleResetDetector_Generic.svg?)](https://www.ardu-badge.com/DoubleResetDetector_Generic)
214-
7. [`WiFiMulti_Generic library v1.1.1+`](https://github.com/khoih-prog/WiFiMulti_Generic) to use WiFiMulti function. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiMulti_Generic.svg?)](https://www.ardu-badge.com/WiFiMulti_Generic). **New**
216+
7. [`WiFiMulti_Generic library v1.2.2+`](https://github.com/khoih-prog/WiFiMulti_Generic) to use WiFiMulti function. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiMulti_Generic.svg?)](https://www.ardu-badge.com/WiFiMulti_Generic). **New**
215217

216218
---
217219

@@ -244,12 +246,12 @@ You can also use this link [![arduino-library-badge](https://www.ardu-badge.com/
244246

245247
#### 1. For Portenta_H7 boards using Arduino IDE in Linux
246248

247-
**To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.)**, you have to copy the file [portenta_post_install.sh](Packages_Patches/arduino/hardware/mbed_portenta/3.0.1/portenta_post_install.sh) into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/3.0.1/portenta_post_install.sh).
249+
**To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.)**, you have to copy the file [portenta_post_install.sh](Packages_Patches/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh) into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh).
248250

249251
Then run the following command using `sudo`
250252

251253
```
252-
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.0.1
254+
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1
253255
$ chmod 755 portenta_post_install.sh
254256
$ sudo ./portenta_post_install.sh
255257
```
@@ -262,9 +264,9 @@ This will create the file `/etc/udev/rules.d/49-portenta_h7.rules` as follows:
262264
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
263265
```
264266

265-
Supposing the ArduinoCore-mbed core version is 3.0.1. Now only one file must be copied into the directory:
267+
Supposing the ArduinoCore-mbed core version is 3.4.1. Now only one file must be copied into the directory:
266268

267-
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/3.0.1/portenta_post_install.sh`
269+
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh`
268270

269271
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
270272

@@ -308,7 +310,7 @@ WiFiManager_Portenta_H7_Lite* WiFiManager_Portenta_H7;
308310

309311
- To add custom parameters, just add
310312

311-
```
313+
```cpp
312314
#include "defines.h"
313315

314316
// USE_DYNAMIC_PARAMETERS defined in defines.h
@@ -372,7 +374,7 @@ uint16_t NUM_MENU_ITEMS = 0;
372374

373375
- If you don't need to add dynamic parameters, use the following in sketch
374376

375-
```
377+
```cpp
376378
#define USE_DYNAMIC_PARAMETERS false
377379
```
378380

@@ -411,21 +413,21 @@ WiFiManager_Portenta_H7->setConfigPortalIP(IPAddress(xxx,xxx,xxx,xxx));
411413
412414
- To set custom DHCP HostName :
413415
414-
```
416+
```cpp
415417
// Set customized DHCP HostName
416418
WiFiManager_Portenta_H7->begin("SAMD_ABCDEF");
417419
```
418420

419421
or just use the default Hostname, for example "SAMD_XXXXXX" for SAMD
420422

421-
```
423+
```cpp
422424
//Or use default Hostname "WIFI_GENERIC_XXXXXX"
423425
//WiFiManager_Portenta_H7->begin();
424426
```
425427

426428
#### 8. To use custom HTML Style
427429

428-
```
430+
```cpp
429431
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
430432
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
431433

@@ -437,13 +439,13 @@ WiFiManager_Portenta_H7->setCustomsStyle(NewCustomsStyle);
437439
#### 9. To use custom Head Elements
438440
439441
440-
```
442+
```cpp
441443
WiFiManager_Portenta_H7->setCustomsHeadElement("<style>html{filter: invert(10%);}</style>");
442444
```
443445

444446
#### 10. To use CORS Header
445447

446-
```
448+
```cpp
447449
WiFiManager_Portenta_H7->setCORSHeader("Your Access-Control-Allow-Origin");
448450
```
449451
@@ -457,7 +459,7 @@ Once Credentials / WiFi network information is saved in the host non-volatile me
457459
458460
#### 11.1 If you need to use and input only one set of WiFi SSID/PWD
459461
460-
```
462+
```cpp
461463
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
462464
// Default is false (if not defined) => must input 2 sets of SSID/PWD
463465
#define REQUIRE_ONE_SET_SSID_PW true
@@ -466,7 +468,7 @@ But it's always advisable to use and input both sets for reliability.
466468

467469
#### 11.2 If you need to use both sets of WiFi SSID/PWD
468470

469-
```
471+
```cpp
470472
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
471473
// Default is false (if not defined) => must input 2 sets of SSID/PWD
472474
#define REQUIRE_ONE_SET_SSID_PW false
@@ -477,15 +479,15 @@ But it's always advisable to use and input both sets for reliability.
477479
#### 12.1 Enable auto-scan of WiFi networks for selection in Configuration Portal
478480

479481

480-
```
482+
```cpp
481483
#define SCAN_WIFI_NETWORKS true
482484
```
483485

484486
The manual input of SSIDs is default enabled, so that users can input arbitrary SSID, not only from the scanned list. This is for the sample use-cases in which users can input the known SSIDs of another place, then send the boards to that place. The boards can connect to WiFi without users entering Config Portal to re-configure.
485487

486488
#### 12.2 Disable manually input SSIDs
487489

488-
```
490+
```cpp
489491
// To disable manually input SSID, only from a scanned SSID lists
490492
#define MANUAL_SSID_INPUT_ALLOWED false
491493
```
@@ -497,7 +499,7 @@ This is for normal use-cases in which users can only select an SSID from a scann
497499
The maximum number of SSIDs in the list is selectable from 2 to 15 (for ESP8266/ESP32-AT shields, from 2-6). If invalid number of SSIDs is selected, the default number of 10 will be used.
498500

499501

500-
```
502+
```cpp
501503
// From 2-15
502504
#define MAX_SSID_IN_LIST 8
503505
```
@@ -515,7 +517,7 @@ To use, uncomment in `defines.h`.
515517

516518
Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18#issue-1094004380)
517519

518-
```
520+
```cpp
519521
#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
520522
```
521523

@@ -529,7 +531,7 @@ Only use whenever urgent tasks in loop() can't be delayed. But if so, it's bette
529531

530532
Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18#issuecomment-1006197561)
531533

532-
```
534+
```cpp
533535
#define WIFI_RECON_INTERVAL 30000 // 30s
534536
```
535537

@@ -598,7 +600,7 @@ See this example and modify as necessary
598600

599601
#### 1. To always load [Default Credentials](examples/Portenta_H7_WiFi/Credentials.h) and override Config Portal data
600602

601-
```
603+
```cpp
602604
// Used mostly for development and debugging. FORCES default values to be loaded each run.
603605
// Config Portal data input will be ignored and overridden by DEFAULT_CONFIG_DATA
604606
bool LOAD_DEFAULT_CONFIG_DATA = true;
@@ -608,7 +610,7 @@ bool LOAD_DEFAULT_CONFIG_DATA = true;
608610

609611
Config Portal data input will be override DEFAULT_CONFIG_DATA
610612

611-
```
613+
```cpp
612614
// Used mostly once debugged. Assumes good data already saved in device.
613615
// Config Portal data input will be override DEFAULT_CONFIG_DATA
614616
bool LOAD_DEFAULT_CONFIG_DATA = false;
@@ -694,7 +696,7 @@ Example of [Default dynamicParams](examples/Portenta_H7_WiFi/dynamicParams.h)
694696

695697
- To add custom parameters, just modify the example below
696698

697-
```
699+
```cpp
698700
#include "defines.h"
699701

700702
// USE_DYNAMIC_PARAMETERS defined in defines.h
@@ -755,13 +757,13 @@ uint16_t NUM_MENU_ITEMS = 0;
755757
```
756758
- If you don't need to add dynamic parameters, use the following in sketch
757759

758-
```
760+
```cpp
759761
#define USE_DYNAMIC_PARAMETERS false
760762
```
761763

762764
or
763765

764-
```
766+
```cpp
765767
/////////////// Start dynamic Credentials ///////////////
766768

767769
MenuItem myMenuItems [] = {};

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
77
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/WiFiManager_Portenta_H7_Lite.svg)](http://github.com/khoih-prog/WiFiManager_Portenta_H7_Lite/issues)
88

9+
<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>
10+
<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>
11+
<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>
12+
<a href="https://profile-counter.glitch.me/khoih-prog-WiFiManager_Portenta_H7_Lite/count.svg" title="WiFiManager_Portenta_H7_Lite Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-WiFiManager_Portenta_H7_Lite/count.svg" style="height: 30px;width: 200px;"></a>
913
---
1014
---
1115

library.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
{
2828
"owner": "khoih-prog",
2929
"name": "WiFiWebServer",
30-
"version": "^1.8.0",
30+
"version": "^1.10.0",
3131
"platforms": ["*"]
3232
},
3333
{
3434
"owner": "khoih-prog",
3535
"name": "WiFiMulti_Generic",
36-
"version": ">=1.1.1",
36+
"version": ">=1.2.2",
3737
"platforms": ["*"]
3838
},
3939
{
@@ -45,7 +45,7 @@
4545
{
4646
"owner": "khoih-prog",
4747
"name": "LittleFS_Portenta_H7",
48-
"version": "^1.1.0",
48+
"version": "^1.2.0",
4949
"platforms": ["mbed_portenta"]
5050
},
5151
{

0 commit comments

Comments
 (0)