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

Commit

Permalink
v1.9.0 to reduce v1.8.0 breaking effect
Browse files Browse the repository at this point in the history
### Releases v1.9.0

1. Reduce the breaking effect of v1.8.0 by enabling compatibility with old code to include only `ESP_WiFiManager.h`. Check [Important Breaking Change from v1.8.0](https://github.com/khoih-prog/ESP_WiFiManager#Important-Breaking-Change-from-v180)
  • Loading branch information
khoih-prog authored Jan 18, 2022
1 parent d755f2d commit 5369660
Show file tree
Hide file tree
Showing 32 changed files with 913 additions and 745 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please ensure to specify the following:
Arduino IDE version: 1.8.19
ESP8266 Core Version 3.0.2
OS: Ubuntu 20.04 LTS
Linux Inspiron 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Linux Inspiron 5.4.0-94-generic #106-Ubuntu SMP Thu Jan 6 23:58:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered an endless loop while trying to connect to Local WiFi.
Expand Down
82 changes: 63 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
## Table of Contents

* [Important Breaking Change from v1.8.0](#Important-Breaking-Change-from-v180)
* [For v1.9.0 and up](#For-v190-and-up)
* [For v1.8.0 only](#For-v180-only)
* [Important Note](#important-note)
* [Why do we need the new Async ESPAsync_WiFiManager library](#why-do-we-need-the-new-async-espasync_wifimanager-library)
* [Why do we need this ESP_WiFiManager library](#why-do-we-need-this-esp_wifimanager-library)
Expand Down Expand Up @@ -152,6 +154,46 @@

### Important Breaking Change from v1.8.0

#### For v1.9.0 and up

Please have a look at [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix-multiple-definitions-linker-error)

From v1.9.0, you just use

```
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
```

instead of both

```
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager
```


For complex project having `Multiple Definitions Linker Error` issue, you can use in many files (**Be careful**: `.hpp`, not `.h`)

```
#include <ESP_WiFiManager.hpp> //https://github.com/khoih-prog/ESP_WiFiManager
```

but only in main(), .ino with setup() to avoid `Multiple Definitions Linker Error`


```
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
```

---


#### For v1.8.0 only

It's advisable to use v1.9.0+

Please have a look at [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix-multiple-definitions-linker-error)

From v1.8.0, you must use
Expand Down Expand Up @@ -310,14 +352,14 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
You can use

```
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager.hpp> //https://github.com/khoih-prog/ESP_WiFiManager
```

in many files. But be sure to use the following `#include <ESP_WiFiManager-Impl.h>` **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
in many files. But be sure to use the following `#include <ESP_WiFiManager.h>` **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error

```
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
```

Check [ConfigOnDoubleReset_Multi](examples/ConfigOnDoubleReset_Multi) for an example how and where to do so.
Expand Down Expand Up @@ -2151,8 +2193,8 @@ ESP_wifiManager.setRemoveDuplicateAPs(false);
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.8.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1008000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.9.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1009000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
Expand Down Expand Up @@ -2492,7 +2534,9 @@ IPAddress APStaticSN = IPAddress(255, 255, 255, 0);
//#define HTTP_PORT 8080

#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

#define HTTP_PORT 80

Expand Down Expand Up @@ -3521,7 +3565,7 @@ This is terminal debug output when running [ConfigOnSwitchFS_MQTT_Ptr](examples/
```
Starting ConfigOnSwichFS_MQTT_Ptr using LittleFS on ESP8266_NODEMCU_ESP12E
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
Configuration file not found
Failed to read configuration file, using default values
[WM] RFC925 Hostname = ConfigOnSwichFS-MQTT
Expand Down Expand Up @@ -3633,7 +3677,7 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](examples/ESP3
```cpp
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
FS File: /ConfigSW.json, size: 150B
FS File: /CanadaFlag_1.png, size: 40.25KB
Expand Down Expand Up @@ -3698,7 +3742,7 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](examples/ESP3

```
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using LittleFS on ESP32_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
FS File: /CanadaFlag_1.png, size: 40.25KB
FS File: /CanadaFlag_2.png, size: 8.12KB
Expand Down Expand Up @@ -3757,7 +3801,7 @@ This is terminal debug output when running [ConfigOnDRD_FS_MQTT_Ptr_Complex](exa

```
Starting ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP32_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
Config File successfully parsed
Expand Down Expand Up @@ -3800,7 +3844,7 @@ WWWW WTWWWW WWTWWW WWWTWW WWWWTW WWWWW

```
Starting ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP32_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
Config File successfully parsed
Expand Down Expand Up @@ -3885,7 +3929,7 @@ This is terminal debug output when running [ConfigOnDRD_FS_MQTT_Ptr_Complex](exa

```
Starting ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP8266_NODEMCU_ESP12E
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
Config File successfully parsed
Expand Down Expand Up @@ -3925,7 +3969,7 @@ TWWWW WTWWWW WWTWWW WWWTWW WWWWTW WWWWW

```
Starting ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP8266_NODEMCU_ESP12E
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
Config File successfully parsed
Expand Down Expand Up @@ -4002,7 +4046,7 @@ This is terminal debug output when running [ConfigOnDoubleReset](examples/Config

```
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32S2_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] setAPStaticIPConfig
Expand Down Expand Up @@ -4052,7 +4096,7 @@ This is terminal debug output when running [ConfigOnDoubleReset](examples/Config

```
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
Expand Down Expand Up @@ -4162,7 +4206,7 @@ Local Date/Time: Thu May 6 21:29:18 2021

```
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
Expand Down Expand Up @@ -4213,7 +4257,7 @@ This is terminal debug output when running [ConfigOnDoubleReset](examples/Config

```
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32S2_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
Expand Down Expand Up @@ -4359,7 +4403,7 @@ Local Date/Time: Thu May 6 21:29:18 2021

```
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32S2_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
Expand Down Expand Up @@ -4412,7 +4456,7 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](examples/ESP3

```
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32C3_DEV
ESP_WiFiManager v1.8.0
ESP_WiFiManager v1.9.0
ESP_DoubleResetDetector v1.2.1
FS File: wm_cp.dat, size: 4B
FS File: wm_cp.bak, size: 4B
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.9.0](#releases-v190)
* [Releases v1.8.0](#releases-v180)
* [Releases v1.7.8](#releases-v178)
* [Releases v1.7.7](#releases-v177)
Expand Down Expand Up @@ -50,6 +51,11 @@

## Changelog

### Releases v1.9.0

1. Reduce the breaking effect of v1.8.0 by enabling compatibility with old code to include only `ESP_WiFiManager.h`. Check [Important Breaking Change from v1.8.0](https://github.com/khoih-prog/ESP_WiFiManager#Important-Breaking-Change-from-v180)


### Releases v1.8.0

1. Fix `multiple-definitions` linker error and weird bug related to `src_cpp`. Check [Different behaviour using the src_cpp or src_h lib #80](https://github.com/khoih-prog/ESPAsync_WiFiManager/discussions/80)
Expand Down
8 changes: 5 additions & 3 deletions examples/AutoConnect/AutoConnect.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.8.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1008000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.9.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1009000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
Expand Down Expand Up @@ -251,7 +251,9 @@ IPAddress APStaticSN = IPAddress(255, 255, 255, 0);
//#define HTTP_PORT 8080

#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Function Prototypes
uint8_t connectMultiWiFi();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.8.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1008000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.9.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1009000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
Expand Down Expand Up @@ -262,7 +262,9 @@ IPAddress APStaticSN = IPAddress(255, 255, 255, 0);
//#define HTTP_PORT 8080

#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

//define your default values here, if there are different values in configFileName (config.json), they are overwritten.
#define BLYNK_SERVER_LEN 64
Expand Down
8 changes: 5 additions & 3 deletions examples/AutoConnectWithFeedback/AutoConnectWithFeedback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.8.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1008000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.9.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1009000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
Expand Down Expand Up @@ -254,7 +254,9 @@ IPAddress APStaticSN = IPAddress(255, 255, 255, 0);
//#define HTTP_PORT 8080

#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Function Prototypes
uint8_t connectMultiWiFi(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.8.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1008000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.9.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1009000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
Expand Down Expand Up @@ -257,7 +257,9 @@ IPAddress APStaticSN = IPAddress(255, 255, 255, 0);
//#define HTTP_PORT 8080

#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

//for LED status
#include <Ticker.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#error This code is intended to run on ESP32 platform! Please check your Tools->Board setting.
#endif
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

void setup()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#endif
#define _WIFIMGR_LOGLEVEL_ 4 // 0-4 where 4 is the highest verbosity level
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

void setup()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
#endif
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager
// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager
#define DRD_TIMEOUT 10
#define DRD_ADDRESS 0
#include <ESP_DoubleResetDetector.h> //https://github.com/khoih-prog/ESP_DoubleResetDetector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
#endif
#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager
// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager
#define DRD_TIMEOUT 10
#define DRD_ADDRESS 0
#include <ESP_DoubleResetDetector.h> //https://github.com/khoih-prog/ESP_DoubleResetDetector
Expand Down
8 changes: 5 additions & 3 deletions examples/ConfigOnDRD_FS_MQTT_Ptr/ConfigOnDRD_FS_MQTT_Ptr.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.8.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1008000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.9.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1009000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
Expand Down Expand Up @@ -372,7 +372,9 @@ IPAddress APStaticSN = IPAddress(255, 255, 255, 0);
//#define HTTP_PORT 8080

#include <ESP_WiFiManager.h> //https://github.com/khoih-prog/ESP_WiFiManager
#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

// Redundant, for v1.8.0 only
//#include <ESP_WiFiManager-Impl.h> //https://github.com/khoih-prog/ESP_WiFiManager

#define HTTP_PORT 80

Expand Down
Loading

0 comments on commit 5369660

Please sign in to comment.