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

Commit eeb30b4

Browse files
authored
v1.3.1 to add waitingForDRD() function
### Releases v1.3.1 1. Add waitingForDRD() function to signal in DRD wating period. Check [DRD is waiting for a double reset? #14](#14) 2. Add example [checkWaitingDRD](https://github.com/khoih-prog/ESP_DoubleResetDetector/tree/master/examples/checkWaitingDRD) to demo how to use the new feature.
1 parent da76548 commit eeb30b4

File tree

7 files changed

+70
-27
lines changed

7 files changed

+70
-27
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.19
3030
ESP8266 Core Version 3.0.2
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-99-generic #112-Ubuntu SMP Thu Feb 3 13:50:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux kh-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered a non-response while trying to press the reset button twice.

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
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/ESP_DoubleResetDetector.svg)](http://github.com/khoih-prog/ESP_DoubleResetDetector/issues)
88

9-
<a href="https://www.buymeacoffee.com/khoihprog6" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 50px !important;width: 181px !important;" ></a>
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>
1011

1112
---
1213
---
@@ -28,6 +29,7 @@
2829
* [ 2. ConfigOnDRD_ESP32_minimal](examples/ConfigOnDRD_ESP32_minimal)
2930
* [ 3. ConfigOnDRD_ESP8266_minimal](examples/ConfigOnDRD_ESP8266_minimal)
3031
* [ 4. minimal](examples/minimal)
32+
* [ 5. checkWaitingDRD](examples/checkWaitingDRD) **New**
3133
* [Examples from other libraries](#examples-from-other-libraries)
3234
* [ 1. ESP_WiFiManager Library](https://github.com/khoih-prog/ESP_WiFiManager)
3335
* [ 1. ConfigOnDoubleReset](https://github.com/khoih-prog/ESP_WiFiManager/tree/master/examples/ConfigOnDoubleReset)
@@ -56,6 +58,7 @@
5658
* [ 6. Blynk_Async_ESP32_BT_WF](https://github.com/khoih-prog/Blynk_Async_ESP32_BT_WF)
5759
* [ 7. Blynk_Async_GSM_Manager](https://github.com/khoih-prog/Blynk_Async_GSM_Manager)
5860
* [ 8. Ethernet_Manager](https://github.com/khoih-prog/Ethernet_Manager)
61+
* [Example checkWaitingDRD](#Example-checkWaitingDRD)
5962
* [Debug Terminal Output Samples](#debug-terminal-output-samples)
6063
* [1. ESP32_FSWebServer_DRD on ESP32_DEV](#1-esp32_fswebserver_drd-on-esp32_dev)
6164
* [2. ConfigOnDoubleReset on ESP32_DEV](#2-configondoublereset-on-esp32_dev)
@@ -265,19 +268,28 @@ and there are many more.
265268
* [ 7. Blynk_Async_GSM_Manager](https://github.com/khoih-prog/Blynk_Async_GSM_Manager)
266269
* [ 8. Ethernet_Manager](https://github.com/khoih-prog/Ethernet_Manager)
267270

271+
---
272+
---
273+
274+
### Example [checkWaitingDRD](examples/checkWaitingDRD)
275+
276+
https://github.com/khoih-prog/ESP_DoubleResetDetector/blob/da76548b25f1c2d4774f154011e7221c1fd7d824/examples/checkWaitingDRD/checkWaitingDRD.ino#L14-L132
277+
278+
279+
268280
---
269281
---
270282

271283
### Debug Terminal Output Samples
272284

273285
#### 1. ESP32_FSWebServer_DRD on ESP32_DEV
274286

275-
This is terminal debug output when running [ESP32_FSWebServer_DRD](https://github.com/khoih-prog/ESP_WiFiManager/tree/master/examples/ESP32_FSWebServer_DRD) on ***ESP32 ESP32_DEV.***. Config Portal was requested by DRD to input and save Credentials. The boards then connected to WiFi AP **HueNet1** using new Static IP successfully. WiFi AP **HueNet1** is then lost, and board **autoreconnects** itself to backup WiFi AP **HueNet2**.
287+
This is terminal debug output when running [ESP32_FSWebServer_DRD](https://github.com/khoih-prog/ESP_WiFiManager/tree/master/examples/ESP32_FSWebServer_DRD) on **ESP32 ESP32_DEV.**. Config Portal was requested by DRD to input and save Credentials. The boards then connected to WiFi AP **HueNet1** using new Static IP successfully. WiFi AP **HueNet1** is then lost, and board **autoreconnects** itself to backup WiFi AP **HueNet2**.
276288

277289
```cpp
278290
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32_DEV
279-
ESP_WiFiManager Version v1.9.0
280-
ESP_DoubleResetDetector Version v1.3.0
291+
ESP_WiFiManager v1.10.1
292+
ESP_DoubleResetDetector v1.3.1
281293
FS File: /ConfigSW.json, size: 150B
282294
FS File: /CanadaFlag_1.png, size: 40.25KB
283295
FS File: /CanadaFlag_2.png, size: 8.12KB
@@ -337,13 +349,13 @@ HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH HHHHHHHHHH
337349

338350
#### 2. ConfigOnDoubleReset on ESP32_DEV
339351

340-
This is terminal debug output when running [ConfigOnDoubleReset](https://github.com/khoih-prog/ESP_WiFiManager/tree/master/examples/ConfigOnDoubleReset) on ***ESP32 ESP32_DEV.***. Config Portal was requested by DRD to input and save Credentials.
352+
This is terminal debug output when running [ConfigOnDoubleReset](https://github.com/khoih-prog/ESP_WiFiManager/tree/master/examples/ConfigOnDoubleReset) on **ESP32 ESP32_DEV.**. Config Portal was requested by DRD to input and save Credentials.
341353

342354

343355
```
344356
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
345-
ESP_WiFiManager Version v1.9.0
346-
ESP_DoubleResetDetector Version v1.3.0
357+
ESP_WiFiManager v1.10.1
358+
ESP_DoubleResetDetector v1.3.1
347359
[WM] RFC925 Hostname = ConfigOnDoubleReset
348360
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
349361
Stored: SSID = HueNet1, Pass = 12345678
@@ -386,8 +398,8 @@ load:0x40080400,len:6352
386398
entry 0x400806b8
387399

388400
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
389-
ESP_WiFiManager Version v1.9.0
390-
ESP_DoubleResetDetector Version v1.3.0
401+
ESP_WiFiManager Version v1.10.1
402+
ESP_DoubleResetDetector Version v1.3.1
391403
[WM] RFC925 Hostname = ConfigOnDoubleReset
392404
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
393405
Stored: SSID = HueNet1, Pass = jenniqqs
@@ -414,13 +426,13 @@ Starting configuration portal.
414426
415427
#### 3. ESPAsync_WiFi using LittleFS on ESP32S3_DEV
416428
417-
This is terminal debug output when running [ESPAsync_WiFi](https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite/tree/master/examples/ESPAsync_WiFi) on ***ESP32 ESP32S3_DEV.***. Config Portal was requested by DRD to input and save Credentials.
429+
This is terminal debug output when running [ESPAsync_WiFi](https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite/tree/master/examples/ESPAsync_WiFi) on **ESP32 ESP32S3_DEV.**. Config Portal was requested by DRD to input and save Credentials.
418430
419431
420432
```
421433
Starting ESPAsync_WiFi using LittleFS on ESP32S3_DEV
422-
ESPAsync_WiFiManager_Lite v1.7.0
423-
ESP_DoubleResetDetector v1.3.0
434+
ESPAsync_WiFiManager_Lite v1.8.2
435+
ESP_DoubleResetDetector v1.3.1
424436
LittleFS Flag read = 0xD0D01234
425437
doubleResetDetected
426438
Saving config file...
@@ -536,10 +548,13 @@ Submit issues to: [ESP_DoubleResetDetector issues](https://github.com/khoih-prog
536548
### Contributions and thanks
537549

538550
1. Thanks to [zobix](https://github.com/zobix) for report the bug in [Isssue 2](https://github.com/khoih-prog/ESP_DoubleResetDetector/issues/2)
551+
1. Thanks to [Tochi Moreno](https://github.com/tochimoreno) for enhancement request in [DRD is waiting for a double reset? #14](https://github.com/khoih-prog/ESP_DoubleResetDetector/discussions/14) leading to v1.3.1 to add `waitingForDRD()` function to signal in DRD wating period
552+
539553

540554
<table>
541555
<tr>
542556
<td align="center"><a href="https://github.com/zobix"><img src="https://github.com/zobix.png" width="100px;" alt="zobix"/><br /><sub><b>Zobix</b></sub></a><br /></td>
557+
<td align="center"><a href="https://github.com/tochimoreno"><img src="https://github.com/tochimoreno.png" width="100px;" alt="tochimoreno"/><br /><sub><b>Tochi Moreno</b></sub></a><br /></td>
543558
</tr>
544559
</table>
545560

changelog.md

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

1414
* [Changelog](#changelog)
15+
* [Releases v1.3.1](#releases-v131)
1516
* [Releases v1.3.0](#releases-v130)
1617
* [Releases v1.2.1](#releases-v121)
1718
* [Releases v1.2.0](#releases-v120)
@@ -27,6 +28,11 @@
2728

2829
## Changelog
2930

31+
### Releases v1.3.1
32+
33+
1. Add waitingForDRD() function to signal in DRD wating period. Check [DRD is waiting for a double reset? #14](https://github.com/khoih-prog/ESP_DoubleResetDetector/discussions/14)
34+
2. Add example [checkWaitingDRD](https://github.com/khoih-prog/ESP_DoubleResetDetector/tree/master/examples/checkWaitingDRD) to demo how to use the new feature.
35+
3036
### Releases v1.3.0
3137

3238
1. Add support to `ESP32_S3` using [ESP32 core, esp32-s3-support branch, v2.0.2+](https://github.com/espressif/arduino-esp32/tree/esp32-s3-support)

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ DoubleResetDetector
1111
# Methods and Functions (KEYWORD2)
1212
#######################################
1313
detectDoubleReset KEYWORD2
14+
waitingForDRD KEYWORD2
1415
loop KEYWORD2
1516
stop KEYWORD2
1617

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP_DoubleResetDetector",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"keywords": "rtc, eeprom, littlefs, spiffs, reset, data, esp32, esp32-c3, esp32-s2, esp32-s3, esp8266, double-reset, detector, double-reset-detector",
55
"description": "Library to detect a double reset within a predetermined time, using RTC Memory, EEPROM, LittleFS or SPIFFS for ESP8266 and ESP32. An alternative start-up mode can be used. One example use is to allow re-configuration of device WiFi credentials. Now supporting ESP32_C3, ESP32_S2 ans ESP32_S3",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP_DoubleResetDetector
2-
version=1.3.0
2+
version=1.3.1
33
author=Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
license=MIT

src/ESP_DoubleResetDetector.h

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Built by Khoi Hoang https://github.com/khoih-prog/ESP_DoubleResetDetector
1111
Licensed under MIT license
12-
Version: 1.3.0
12+
Version: 1.3.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -22,28 +22,33 @@
2222
1.1.2 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
2323
1.2.0 K Hoang 26/11/2021 Auto detect ESP32 core and use either built-in LittleFS or LITTLEFS library
2424
1.2.1 K Hoang 26/11/2021 Fix compile error for ESP32 core v1.0.5-
25-
1.3.0 K Hoang 10/02/2022 Add support to new ESP32-S3
25+
1.3.0 K Hoang 10/02/2022 Add support to new ESP32-S3
26+
1.3.1 K Hoang 04/03/2022 Add waitingForDRD() function to signal in DRD wating period
2627
*****************************************************************************************************************************/
2728

2829
#pragma once
2930

3031
#ifndef ESP_DoubleResetDetector_H
3132
#define ESP_DoubleResetDetector_H
3233

34+
#ifndef DOUBLERESETDETECTOR_DEBUG
35+
#define DOUBLERESETDETECTOR_DEBUG false
36+
#endif
37+
3338
#if defined(ARDUINO) && (ARDUINO >= 100)
3439
#include <Arduino.h>
3540
#else
3641
#include <WProgram.h>
3742
#endif
3843

3944
#ifndef ESP_DOUBLE_RESET_DETECTOR_VERSION
40-
#define ESP_DOUBLE_RESET_DETECTOR_VERSION "ESP_DoubleResetDetector v1.3.0"
45+
#define ESP_DOUBLE_RESET_DETECTOR_VERSION "ESP_DoubleResetDetector v1.3.1"
4146

4247
#define ESP_DOUBLE_RESET_DETECTOR_VERSION_MAJOR 1
4348
#define ESP_DOUBLE_RESET_DETECTOR_VERSION_MINOR 3
44-
#define ESP_DOUBLE_RESET_DETECTOR_VERSION_PATCH 0
49+
#define ESP_DOUBLE_RESET_DETECTOR_VERSION_PATCH 1
4550

46-
#define ESP_DOUBLE_RESET_DETECTOR_VERSION_INT 1003000
51+
#define ESP_DOUBLE_RESET_DETECTOR_VERSION_INT 1003001
4752
#endif
4853

4954
#define ESP_DOUBLERESETDETECTOR_VERSION ESP_DOUBLE_RESET_DETECTOR_VERSION
@@ -55,7 +60,11 @@
5560

5661
#ifdef ESP32
5762
#if (!ESP_DRD_USE_EEPROM && !ESP_DRD_USE_SPIFFS && !ESP_DRD_USE_LITTLEFS)
58-
#warning Neither EEPROM, SPIFFS nor LittleFS selected. Default to EEPROM
63+
64+
#if (DOUBLERESETDETECTOR_DEBUG)
65+
#warning Neither EEPROM, SPIFFS nor LittleFS selected. Default to EEPROM
66+
#endif
67+
5968
#ifdef ESP_DRD_USE_EEPROM
6069
#undef ESP_DRD_USE_EEPROM
6170
#define ESP_DRD_USE_EEPROM true
@@ -65,7 +74,10 @@
6574

6675
#ifdef ESP8266
6776
#if (!ESP8266_DRD_USE_RTC && !ESP_DRD_USE_EEPROM && !ESP_DRD_USE_SPIFFS && !ESP_DRD_USE_LITTLEFS)
68-
#warning Neither RTC, EEPROM, LITTLEFS nor SPIFFS selected. Default to EEPROM
77+
#if (DOUBLERESETDETECTOR_DEBUG)
78+
#warning Neither RTC, EEPROM, LITTLEFS nor SPIFFS selected. Default to EEPROM
79+
#endif
80+
6981
#ifdef ESP_DRD_USE_EEPROM
7082
#undef ESP_DRD_USE_EEPROM
7183
#define ESP_DRD_USE_EEPROM true
@@ -97,14 +109,20 @@
97109
// Check cores/esp32/esp_arduino_version.h and cores/esp32/core_version.h
98110
//#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
99111
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )
100-
#warning Using ESP32 Core 1.0.6 or 2.0.0+
112+
#if (DOUBLERESETDETECTOR_DEBUG)
113+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
114+
#endif
115+
101116
// The library has been merged into esp32 core from release 1.0.6
102117
#include <LittleFS.h>
103118

104119
#define FileFS LittleFS
105120
#define FS_Name "LittleFS"
106121
#else
107-
#warning Using ESP32 Core 1.0.5-. You must install LITTLEFS library
122+
#if (DOUBLERESETDETECTOR_DEBUG)
123+
#warning Using ESP32 Core 1.0.5-. You must install LITTLEFS library
124+
#endif
125+
108126
// The library has been merged into esp32 core from release 1.0.6
109127
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
110128

@@ -135,9 +153,7 @@
135153

136154
#endif //#if ESP_DRD_USE_EEPROM
137155

138-
#ifndef DOUBLERESETDETECTOR_DEBUG
139-
#define DOUBLERESETDETECTOR_DEBUG false
140-
#endif
156+
141157

142158
#define DOUBLERESETDETECTOR_FLAG_SET 0xD0D01234
143159
#define DOUBLERESETDETECTOR_FLAG_CLEAR 0xD0D04321
@@ -204,6 +220,11 @@ class DoubleResetDetector
204220
return doubleResetDetected;
205221

206222
};
223+
224+
bool waitingForDRD()
225+
{
226+
return waitingForDoubleReset;
227+
}
207228

208229
void loop()
209230
{

0 commit comments

Comments
 (0)