Compare commits

...
1209 Commits
Author SHA1 Message Date
Rob Aleck 32655b7226 Update WiFiManager.cpp (#1812) 2025-03-28 19:32:57 -05:00
Pascal Brunot b67b7828b9 Fix compilation warning (#1740)
Compiler warning : format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t'
he compiler warning arises because the format specifier %lu expects a long unsigned int, but the variable free is of type uint32_t (which is typically unsigned int). The ESP32, part of the Espressif32 family, typically defines uint32_t as unsigned int, so using the %u format specifier is appropriate.
2025-02-04 20:11:10 -06:00
Dave MadisonandAndreas Breitschopp 8e4c612fa3 Add user custom header/footer functions (#1769)
* Added setCustomTopBodyElement allowing to define custom HTML to be added at the top of the "<body>" tag.

* Change custom top body element to 'header'

This will make more sense once a footer is added. No functional changes.

* Make custom header concat conditional

Matching the _bodyClass comparison above

* Create getHTTPEnd function

* Add custom body footer functionality

* Fix <small> close tag on update page

* Add missing HTTP ends to exit and close

* Remove 'immediately' from header/footer desc

It's not immediate, the 'wrap' div is added before/after.

---------

Co-authored-by: Andreas Breitschopp <a-breitschopp@ab-tools.com>
2024-12-12 16:40:11 -06:00
Shawn A 7e2fa84daf Update cpp_lint.yml
remove line length
2024-12-12 16:39:33 -06:00
Jos Zuijderwijk 0fad7f50d1 Replace deprecated type (#1748) 2024-12-10 21:06:50 -06:00
Jack 47342ed6f7 Force remove DNS input from Captive portal issue #1733 (#1745) 2024-12-10 21:02:41 -06:00
Dave Madison 9333ec68ed Add CSS body classes for each page (#1767)
* Add body classes argument

Note that the additional function argument for getHTTPHead() includes a default argument for backwards compatibility with the API.

* Add page-specific classes

Allows easy styling of each page

* Change root CSS class to 'home'

Trying to avoid confusion between the class for the root level and the CSS ":root" pseudo-class

* Use conditional body class spacing

Avoids an extra space if a body class is set, but an empty string is passed to the function
2024-12-10 20:56:58 -06:00
Anil Raj Rimal 922059b472 fix(compile_example.yaml): Fix cache key inconsistency and correct typo in 'Compile examples' workflow (#1776) 2024-12-10 20:53:25 -06:00
Dave Madison b541d9cd9c Do not fill child backgrounds in dark mode (#1768)
Small change which allows users to style the body background with dark mode enabled, without having to style the child elements (a, h1) as well.
2024-12-10 20:26:18 -06:00
Anil Raj Rimal 7ebbcfe360 Enhance cache strategy with board-specific cache keys (#1777)
* fix(compile_example.yaml): Fix cache key inconsistency and correct typo in 'Compile examples' workflow

* feat(compile_library.yml): Use board-specific cache keys to avoid conflicts
2024-12-10 20:17:25 -06:00
David RAMBEAU a37f4fc41c FR Translation (#1755)
Proposal of French translation
2024-08-07 21:42:01 -05:00
Shawn A e978bc059c Update compile_examples.yaml 2024-03-29 20:40:20 -05:00
Shawn A 94020043a5 Update compile_examples.yaml 2024-03-29 20:39:46 -05:00
Shawn A 8cc5f290fa Rename onDemandWebPortal.ino to OnDemandWebPortal.ino 2024-03-29 20:38:12 -05:00
Harshad Italiya 4cca898927 Renaming as Arduino needs same name for sketch and directory. (#1727) 2024-03-29 14:58:31 -05:00
DarkZeros 76efbd5c36 Fix Debug Log format (#1722) 2024-03-17 15:58:54 -05:00
tablatronix d82d0a1b9f version bump 2024-03-01 20:29:49 -06:00
tablatronix b1720d2981 disable agressivereconn test method 2024-02-19 21:47:44 -06:00
tablatronix d8f8d5478a Adds connect status for ambiguous state
Will find a way to clear this up using assumption based on reason codes, wrong password is very ambiguous with PMF and modern APs
2024-02-16 22:07:21 -06:00
tablatronix 45675eae3e add debug level to version str 2024-02-16 22:02:42 -06:00
tablatronix 91451f58bf typo #1710 2024-02-15 08:59:09 -06:00
tablatronix 304d489c2f fix for #1710 2024-02-14 23:41:56 -06:00
tablatronix 607dfdb606 wifi mode debug 2024-01-22 20:35:10 -06:00
Frank Cohen 0d84861270 Wifi manager frank cohen (#1642)
* Readme update

Tested on ESP32-S3, so I added the ESP32-S3 shield to the readme

* testing a commit

* Update to Readme

Added ESP32-S3 tag and fixed the release shield to not click away from the project.

* Typos fixed
2024-01-20 10:21:23 -06:00
tablatronix e76e4c27af #1703 2024-01-16 22:13:54 -06:00
tablatronix c2af8e55d6 Update WiFiManager.cpp 2024-01-16 22:11:14 -06:00
Yohan Lasorsa 20535edf27 Allow subclassing (#1698) 2024-01-13 09:51:39 -06:00
tablatronix 73da98b3ec Remove S3 NOTEMP 2023-12-31 12:39:34 -06:00
tablatronix c09a3584dd revert, S3 platform does not have this yet 2023-12-31 12:39:19 -06:00
tablatronix 0b734828ba restore getWiFiIsSaved adds lowlevelinit 2023-12-16 22:16:20 -06:00
tablatronix 5656e5707b #1595 2023-11-22 14:08:00 -06:00
tablatronix 3efb536629 disable captiveportal for webportal 2023-11-17 19:37:44 -06:00
tablatronix 9df7acdeeb doh 2023-11-17 12:14:04 -06:00
tablatronix 18145e42ba update serverloc 2023-11-16 21:32:16 -06:00
tablatronix 0e2016879b #1558 fix?
Detect password only change
2023-11-15 21:56:07 -06:00
tablatronix 680968ff30 comments 2023-11-05 08:34:12 -06:00
tablatronix 94529cd08b turn off preload and async scanning
Until more qa can be done here , I have reports of these causing issues and first scans being empty on latest IDF and chips
2023-11-03 22:18:26 -05:00
tablatronix 7d95727761 add button funcs tests to super 2023-11-03 22:17:20 -05:00
tablatronix f328cd05cd possible fixes for these
Not entirely sure why esp8266 is not auto casting these
2023-10-10 22:52:41 -05:00
tablatronix 72956f563f Revert "Revert "#1587""
This reverts commit ba3f1986f2.
2023-10-10 21:56:28 -05:00
tablatronix 1cc7df59c2 add delays to some loops
These are fast and should not be needed but better safe I suppose
2023-10-10 07:09:39 -05:00
tablatronix 439af6e6b1 oops 2023-10-09 22:24:01 -05:00
tablatronix 99f770c493 adds button func tests 2023-10-09 22:22:36 -05:00
tablatronix 5a663db42e Fix debug_max 2023-10-09 22:22:02 -05:00
tablatronix ba3f1986f2 Revert "#1587"
This reverts commit b735c61f6e.
2023-09-28 23:41:35 -05:00
Nicolas T 6a92492bee Update WiFiManager.cpp (#1657) 2023-09-21 08:59:06 -05:00
tablatronix 0d07e09a44 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2023-09-18 18:20:48 -05:00
tablatronix d6bf07fd71 Update OnDemandConfigPortal.ino 2023-09-18 18:20:45 -05:00
tablatronix 5a8e869a7e add workaround for #1543
@etoten thanks, slight change, Might have to add ipv6 detection instead and handle it that way
2023-09-18 18:18:12 -05:00
tablatronix 465b44d734 localize debuglevel enum, add method 2023-09-18 18:14:18 -05:00
tablatronix eb27c525e3 move 404 handler public, remove 404 info, add examples for overrides 2023-09-08 13:27:15 -05:00
Avi B 3a303eeb45 Update CMakeLists.txt (#1624)
Change `REQUIRES` to `PRIV_REQUIRES` because the public API of this package does not require users of this package to know about `arduino`.
2023-06-10 20:53:21 -05:00
tablatronix 9b8de0d77f #1610 quick fix
dirty fix, will have to add proper flashstring helper casts instead probably
2023-05-18 22:51:04 -05:00
tablatronix df250c9074 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2023-05-16 20:20:05 -05:00
tablatronix b735c61f6e #1587
menutokens pointers not actually in progmem
2023-05-16 20:19:57 -05:00
Pascal Wagler cad9ffc83f Make *Show Password* a label so one can click on it (#1595) 2023-05-16 20:17:39 -05:00
tablatronix e9bbb6c588 fixes #1608 2023-05-16 20:14:38 -05:00
tablatronix 88c378f0a2 v2.0.16-rc.2 2023-05-11 13:40:19 -05:00
tablatronix aa8856adf3 #1583 missed this one 2023-05-02 15:03:29 -05:00
tablatronix 4611c75dfb fix #1540 2023-03-22 19:35:57 -05:00
tablatronix 8cf3b43efb Remove hacky scope check, param length 0 2023-03-15 21:24:44 -05:00
tablatronix ca5df00d60 fix HTTPSend copy 2023-03-15 21:17:46 -05:00
tablatronix 4c0d7fa777 Adds es_ES strings sample for WM_STRINGS_FILE
add strings file `build_flags = -DWM_DEBUG_PORT=Serial  -DWM_DEBUG_LEVEL=4 -DWM_STRINGS_FILE="\"wm_strings_es.h\""`
2023-03-15 20:58:45 -05:00
tablatronix ccf04aa5b0 added some http debugging 2023-03-15 17:54:47 -05:00
tablatronix 297123b5d7 disable hallread
I will add esp detection for this stuff before readding
2022-12-16 11:40:15 -06:00
tablatronix 32b6bda04c fixes #1532 2022-12-15 14:41:21 -06:00
Philipp bacaf521e4 Unified casing of strings (#1529) 2022-12-11 11:21:14 -06:00
tablatronix 430a9bcdcb I think i versioned this wrong 2022-12-10 11:22:15 -06:00
Shawn A 26a33e3e11 Update README.md 2022-12-08 10:18:15 -06:00
tablatronix 118ca1ec30 fixes #1528 2022-12-08 10:15:06 -06:00
tablatronix fe9774fe0f lower debug level 2022-11-28 16:34:44 -06:00
tablatronix 7cdaf5c785 2.0.0-RC.1 2022-11-28 16:32:13 -06:00
Shawn A 0080e3581e Refactor strings BREAKING (#1474)
* refactor strings, split out consts breaking!

* move consts out of strings file BREAKING

You will have to remove the constants from your strings files and add the new include instead, a simple diff should obviously show the changes

* adds WM_STRINGS_FILE for env overrides

* Revert "move consts out of strings file BREAKING"

This reverts commit bb9f092413153825d8e7acde1dcc1489e840df1e.

* Create wm_strings_en.h

* final clean up of strings_en.h, legacy

* comments
2022-11-28 16:15:20 -06:00
tablatronix 6eb8432357 add scan mode options examples 2022-11-28 15:30:44 -06:00
Shawn A 71937d1155 Update ISSUE_TEMPLATE.md 2022-11-10 13:07:45 -06:00
tablatronix 9f5981e2fd v bump 2022-10-14 11:50:32 -05:00
tablatronix 701d58fd07 fixes #1511 2022-10-14 11:35:51 -05:00
tablatronix dbefaed1a2 fix #1509 2022-10-14 11:34:50 -05:00
tablatronix 476952c2da add back button to saves 2022-10-04 16:35:43 -05:00
Avi B 48d4dbcfe5 Support for WifiManager as ESP-IDF component (#1489)
Enables support for WifiManager as an ESP-IDF component.  ESP-IDF is a popular development framework for ESP32 chips.

This file is based on the CMakeLists.txt file from the popular Adafruit-GFX-Library library.
2022-10-03 20:55:56 -05:00
Shawn A 9e4b7cb66d Update README.md 2022-09-25 11:48:03 -05:00
tablatronix 7fa6387d99 #1504 2022-09-21 11:55:56 -05:00
Thiti Yamsung 993b1ad9a9 fix: not found getChipModel method for ESP8266 (#1503) 2022-09-21 06:54:31 -05:00
tablatronix 696b920273 update rtc for resetreasons on multiple models 2022-09-20 22:11:52 -05:00
tablatronix 4ff7d7049a add chip model etc to debugging 2022-09-20 22:11:35 -05:00
tablatronix 30efa2e028 add esp model and wifi mode status to info page headers 2022-09-20 22:11:15 -05:00
tablatronix 6d23d7591f remove hall sensor, fix temp 2022-09-20 22:09:57 -05:00
tablatronix 9eee18ab32 add esp32 temp sensor back 2022-09-20 22:08:54 -05:00
tablatronix 0ae78ee339 add heaadings to template 2022-09-20 22:07:50 -05:00
tablatronix 15459925b0 ver bump 2022-09-20 19:39:50 -05:00
tablatronix d5536fbc69 remove workardound for arduino 2.0.5 #1482 2022-09-20 19:37:26 -05:00
tablatronix ac2cd86f21 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-09-16 10:22:48 -05:00
tablatronix 3545410ba4 remove captive portal check on ota done, remove serial debug 2022-09-16 10:22:34 -05:00
tablatronix dda1c45fa9 disable captive portal checks on ota uploades 2022-09-16 10:21:52 -05:00
tablatronix 297a1af260 clean up 2022-09-16 10:21:34 -05:00
Thiti Yamsung c34770ec32 feat(callback): add config portal timeout callback for handle config portal timeout (#1497) 2022-09-15 07:07:55 -05:00
tablatronix 1b5d71bac7 workaround for #1482 2022-09-12 16:06:23 -05:00
tablatronix 6fb63f834a remove wifiissaved check 2022-09-12 16:05:16 -05:00
tablatronix 2b24b91f88 fixes #1490
Does not fix wifi not init yet thanks @erriez
2022-09-12 12:06:40 -05:00
tablatronix b676daf37c oops #1403 2022-09-12 11:23:04 -05:00
tablatronix 7bdcfd501e fix esp8266 versioning 2022-09-01 15:27:31 -05:00
tablatronix 60efff754e fix redefine 2022-09-01 11:53:53 -05:00
tablatronix 62d951c8e4 try to fixup arduino version debugging info 2022-09-01 10:43:44 -05:00
tablatronix bb8aec4ce5 remove reset from basic 2022-09-01 10:43:19 -05:00
tablatronix 201ad2e838 Disable temp sensor for all esp32 until can find a better check 2022-09-01 07:54:41 -05:00
tablatronix d04d1f677b enabling #538
Turning on wifi scan preload and async scanning, with hardcoded cachetime of 30seconds. Should make wifi page load faster, and make interface seem smoother. Will have to test with various enviroments and on S2/x3 chips
2022-08-31 16:40:01 -05:00
tablatronix 9abf5abdf6 fixes #1206 2022-08-31 15:34:20 -05:00
tablatronix 5820298640 cleanup dev example 2022-08-31 14:36:30 -05:00
Shawn A 4dcf0cc78b Update discord link 2022-08-24 18:10:55 -05:00
tablatronix 94bb90322b #1403 try to increase hostname reliability and keep connect times low 2022-08-18 22:10:41 -05:00
tablatronix b90af1ac4d fixes #1068 esp32 S2
Esp32 has seeveral variations on when you can sethostname, might vary with versions so will try to add a best practice for all
2022-08-17 19:24:45 -05:00
tablatronix e0c5fb7daf Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-08-09 11:04:19 -05:00
tablatronix e9dec77a83 beta ver bump 2022-08-09 11:04:07 -05:00
John 8e0a17e5c8 Change test action to install from local directory (#1473)
* Change test action to install from local directory

* Update GH action for ESP8266 as well
2022-08-09 11:00:03 -05:00
tablatronix 58baeaba6f adds temporary fallbacks for esp32 set country
Find better way to check version feature check, arduino ver is not always available.
2022-08-09 10:59:33 -05:00
John 5ded0c9ef8 Use esp_wifi_set_country_code for ESP32 (#1470)
Replaces the use of esp_wifi_set_country() with esp_wifi_set_country_code() for ESP32 in order to both solve a crash under Arduino 2.x and remove the requirement to independently maintain country-specific channel settings
2022-08-09 10:44:06 -05:00
JoergAJ 7d498ed50a Added links in readme file (#1446)
* Update README.md

Updated links to examples

* Update README.md

Updated links

* Update README.md

* Update README.md

* Update README.md

* Update README.md

added placeholder links for buttons

* Update README.md

added links to the action workflow (compile_library /examples) + expressif links to the product pages
2022-07-15 11:59:12 -05:00
tablatronix f2ed2cb997 #1452
Possible fix
2022-07-13 22:14:58 -05:00
tablatronix b8205e71f3 add connection fixes for esp32 wifi not started yet 2022-06-30 13:40:38 -05:00
tablatronix 605d1e897a add missing debug toggle 2022-06-30 12:14:23 -05:00
45gfg9 01bd8a398b Update WiFiManager.cpp (#1443)
Avoid constructing two String objects and adding them together. Just concatenate c-strings.
2022-06-28 13:14:06 -05:00
tablatronix 65fec94317 fix compiler warnings #1421 2022-06-26 23:22:10 -05:00
tablatronix 06c63720f6 #1421
remove temp
2022-06-26 16:39:33 -05:00
tablatronix 14aeb7575f Fix hostname for esp8266, needs to run after sta ughh 2022-06-24 23:44:03 -05:00
tablatronix afd328b3b2 Fix hostname #1403 2022-06-24 20:07:17 -05:00
tablatronix 9e408e41a8 LittleFS Basic example 2022-06-22 10:50:47 -05:00
tablatronix 6522cb30a8 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-06-21 08:22:00 -05:00
tablatronix 260a9abee8 add input type example 2022-06-21 08:21:58 -05:00
tablatronix 3c2a05312b Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-06-20 22:14:12 -05:00
tablatronix b05a71b618 add comments for httpupdate callbacks 2022-06-20 22:13:30 -05:00
tablatronix f9a47786b7 adds otacallback and progress example callback for Update lib #1435 2022-06-20 22:12:52 -05:00
tablatronix a2c33744f6 rename wifi callbacks 2022-06-17 14:21:13 -05:00
tablatronix 317c026952 adds setPreSaveParamsCallback
//called when saving params before anything else happens
    void          setPreSaveParamsCallback( std::function<void()> func );
2022-06-17 14:07:11 -05:00
tablatronix b5671834e4 Moves presavecallback after static ip copy
#1429
2022-06-17 13:50:33 -05:00
tablatronix 7078bd1786 add template js #1430 2022-06-17 12:35:53 -05:00
Martijn Hendriks 1af8f4540d Update strings_en.h (#1430)
show/hide wifi password during input
2022-06-17 12:35:17 -05:00
tablatronix b257590e98 comments 2022-06-17 11:46:49 -05:00
tablatronix ca4b63220c remove double non blocking timeout handler 2022-06-17 11:36:21 -05:00
tablatronix 0ab747c62a going through todos 2022-06-17 11:13:39 -05:00
JoergAJ c6e2b1b349 Updated links in README.md (#1431)
* Update README.md

Updated links to examples

* Update README.md

Updated links

* Update README.md

* Update README.md

* Update README.md
2022-06-16 15:33:51 -05:00
tablatronix 9c7fed4fe1 update template 2022-05-15 08:29:51 -05:00
tablatronix c56eec9018 change css disabled for all 2022-05-15 08:26:04 -05:00
Perry e7bb9bc28e Change Stream to Print (#1307)
* Change Stream to Print 1/2

Update WifiManager to use base class Print instead of Stream.

I debug into a custom buffer, and that buffer implements Print, but not Stream.

* Change Stream to Print 2/2

Update WifiManager to use base class Print instead of Stream.

I debug into a custom buffer, and that buffer implements Print, but not Stream.
2022-05-08 09:30:33 -05:00
Michael Ammann 137410e184 Silence debug output (#1404)
This is probably a left over from debugging, can we remove or at least move it to a DEBUG_WM
2022-05-08 09:28:07 -05:00
Anthony Bryant 86e413dc2a Escape single quotes in htmlEntities() (#1413)
This should allow SSIDs that contain single quotes to populate data-ssid correctly. Without this patch, clicking on an SSID containing a single quote will either:
* Not use the whole SSID, in cases where there's text before the quote:
  `foo'bar` will appear in the SSID box as just `foo`
* Fall back to innerText, in cases where the quote is the first character in the SSID:
  `'); DROP TABLE WIFI; --` will appear in the SSID box as a version that has spaces converted to non-breaking spaces, causing the connection to eventually fail with WL_NO_SSID_AVAIL.
2022-05-08 09:27:17 -05:00
tablatronix 8d34744b29 fixes #1414
added a prefix to macros
2022-05-08 09:24:28 -05:00
alexmaurer-madis 833420fe99 WM_VERSION_STR correction (used in About section) (#1407)
From  "v1.0.11-beta" to "v2.0.11-beta"

I think the major version was forgotten to be updated.
2022-05-03 09:38:44 -05:00
tablatronix b7ca079d9d add favicon example 2022-04-19 20:55:24 -05:00
tablatronix 13b43076f9 bump beta 2022-04-14 12:08:37 -05:00
Ovidiu Pruteanu cd01cbf77d Add .idea to .gitignore for JetBrains IDEs (#1391) 2022-04-12 08:11:31 -05:00
tablatronix 483b83489b Fix #1383 2022-04-11 20:23:43 -05:00
tablatronix 7bffda3fe6 adds option to keep cfgp open on wifi save
// if true (default) then stop the config portal from autoConnect when wifi is saved
    void          setDisableConfigPortal(boolean enable);

Name will change
2022-04-08 20:44:08 -05:00
tablatronix 590e212ddb better fix $1386 2022-04-07 08:41:57 -05:00
tablatronix 379ffee475 clean up variable declarations 2022-04-07 08:38:23 -05:00
tablatronix 1e628625aa fixes #1386
8
2022-04-07 08:37:43 -05:00
tablatronix c9393744a4 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-03-29 14:46:49 -05:00
tablatronix 918e02ddfd add resetsetting delay, some complaints its not working shrug 2022-03-29 14:46:42 -05:00
tablatronix 9cd81e3af9 debug 2022-03-29 14:46:08 -05:00
tablatronix ba6336587e Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-03-29 13:35:00 -05:00
tablatronix 6a85acdf85 add customMenuHTML 2022-03-29 13:34:58 -05:00
tablatronix 88b97c7caa #1383 fix 2022-03-29 13:31:41 -05:00
John ea4ee025f2 Output "Unknown" if Arduino/ESP-IDF version is unknown (#1382)
Closes #1381
2022-03-28 20:41:08 -05:00
tablatronix 278c57b4ec fixes #1379 2022-03-28 08:23:16 -05:00
tablatronix 91826229cb oops 2022-03-26 13:01:01 -05:00
tablatronix 9cec5a25a8 bump version 2022-03-25 14:41:03 -05:00
tablatronix da02b59a21 update template styles, add versionng to info 2022-03-25 14:40:52 -05:00
tablatronix e9a02d4668 add some button feedback 2022-03-25 14:36:46 -05:00
tablatronix b4368308ca remove bad example 2022-03-14 06:43:23 -05:00
tablatronix 47ce0110af Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-03-13 21:36:32 -05:00
tablatronix eb5ba12df1 #1371 2022-03-13 21:36:25 -05:00
tablatronix d70f358f3e add check to dissallow starting cp if already running
This will avoid support inquiries and add a log
2022-03-13 21:34:26 -05:00
tablatronix 1f3b2e34ae typo 2022-03-13 21:26:13 -05:00
tablatronix 0994c4b3f8 regression, webserver callbacks before reset crashes
any webserver event handlers bound before the webserver new reset would cause memory access issues when triggered.

Should remove all events on reset or make memory safe, not sure if this is the correct way to be reseting the webserver, but there were issues with the ports not releasing etc.
2022-03-11 08:34:08 -06:00
tablatronix 0d61a6b55f esp32 crashes on cb route shared pointer 2022-03-11 00:05:01 -06:00
tablatronix e830fa26e3 Adding a data attribute for ssid for input value
so it has nothing to do with the html , and can have different encoding, we could also just use IDs but scan cannot change, or use bssid

#1370
2022-03-11 00:04:21 -06:00
tablatronix acdad80a43 add callback debuggin 2022-03-10 22:34:03 -06:00
tablatronix 8f2c7ae870 remove test 2022-03-10 15:45:49 -06:00
tablatronix 713fcfc740 disable country in example 2022-03-10 15:41:07 -06:00
tablatronix e6d21b8436 use macro for webserver routes fstring helper 2022-02-24 12:15:11 -06:00
tablatronix 0aecb22904 Fix old sdk esp8266 error w softapssid 2022-02-24 11:50:08 -06:00
tablatronix fd7f400b25 Revert "Both infoids and _ap_password are intialized by check time. (#1344)"
This reverts commit 9f6dcad791.
2022-02-24 11:44:45 -06:00
tablatronix d8c81ecca1 macro test 2022-02-24 11:43:42 -06:00
tablatronix 8ecf0575a1 remove old content length headers 2022-02-24 10:45:06 -06:00
tablatronix e9d0012cce abstract httpserver setup 2022-02-23 16:46:24 -06:00
tablatronix c987ee93c8 abstract httpsend 2022-02-23 16:36:52 -06:00
Andy Piper 8279c5be2a Fix "Acccess" typo (#1366) 2022-02-23 13:08:30 -06:00
tablatronix 5acc7cc9aa css tweaks for inputs including select,checkbox
added vertical margins to inputs
2022-02-22 13:41:27 -06:00
tablatronix 14cf6b81d4 bump 2022-02-15 20:59:27 -06:00
tablatronix 36ed8c1af6 undo dashes, no clue
I will have to figure out why this causes ap not found on save, the string looks clean but there must be something going on, scan result not const?
2022-02-15 20:03:22 -06:00
tablatronix a581de29f3 bump ver bugfix 2022-02-15 08:26:55 -06:00
tablatronix 4ab63aa1e9 remove esp32 softapssid, ver check not working correctly 2022-02-15 08:26:42 -06:00
tablatronix c2081aaae7 bump releaase 2022-02-13 15:36:20 -06:00
tablatronix abd52d4754 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-02-04 22:04:22 -06:00
tablatronix 5052c675be version debug 2022-02-04 22:04:21 -06:00
tablatronix 755aca1643 #1348 just change _hostname to string ? 2022-02-04 22:04:10 -06:00
Shawn A 068c32ad27 oops 2022-02-04 18:12:14 -06:00
tablatronix fa76838ee5 fix esp32 softapssid 2022-02-04 17:54:50 -06:00
tablatronix 4d999b1456 fix #1353 #1354 2022-02-04 12:35:10 -06:00
Shawn A 78ca3ee39a badgers 2022-02-02 20:57:56 -06:00
tablatronix 68f5195260 add seminqignal to example dev 2022-01-24 14:13:36 -06:00
tablatronix 4086e46f6c fix param out of scope check, avoids some exceptions 2022-01-24 14:13:03 -06:00
tablatronix cf9d85fd6d add dashes to htmlentities 2022-01-24 14:12:42 -06:00
tablatronix 7c05228def debug logging 2022-01-24 14:12:21 -06:00
tablatronix 924cc06bb2 remove empty ssid, no idea what these are 2022-01-24 14:11:01 -06:00
tablatronix c3c741a2c0 add flash warning 2022-01-24 10:48:35 -06:00
Shawn A 6e057dfbb2 add connect timer log 2022-01-23 20:48:37 -06:00
Shawn A c8a8cc2f31 remove event debug 2022-01-23 20:45:37 -06:00
Shawn A c12d3c4a6e add aggressive recon options 2022-01-23 20:39:15 -06:00
Pedro Gabriel Planel 9f6dcad791 Both infoids and _ap_password are intialized by check time. (#1344)
Comparing it to NULL raises operation overload.
2022-01-23 20:01:05 -06:00
Shawn A 62ba184cc8 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2022-01-22 10:15:59 -06:00
Shawn A cfe2619069 add debugging 2022-01-22 10:15:58 -06:00
tablatronix 810f144cff keep portal open if connectonsave is false
Not sure if this is a good idea or bad one.. probably better than closing it automatically.
2022-01-21 16:14:11 -06:00
tablatronix 553ae00bac #1327 2022-01-21 14:02:59 -06:00
ricardollreis d0bdf7bdaa Enable Portal Timeout in not Blocking Portal (#1331)
Enable the use of setConfigPortalTimeout( ) & setConfigPortalBlocking(false) at same time, by calling process()
2022-01-06 11:04:13 -06:00
tablatronix 8452df79bb patch for arduino 2.0 event names 2021-11-09 08:24:14 -06:00
Shawn A 72b5331610 possible fix #1306 2021-10-30 16:51:39 -05:00
Shawn A 9d061ab24e fixes #1295 2021-10-01 21:17:37 -05:00
tablatronix 927e3e8db0 comment example 2021-09-29 13:47:02 -05:00
tablatronix deeff9fa89 fixes #1297 2021-09-29 13:46:21 -05:00
tablatronix 654d692025 move version to top 2021-09-29 13:07:35 -05:00
Shawn A f1779c97a1 Update titles 2021-09-17 15:31:02 -05:00
tablatronix 9553022b40 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-09-17 10:05:16 -05:00
tablatronix c77ab9e62c flip the --board args, although it was working already 2021-09-17 10:05:04 -05:00
Shawn A 2c28203c29 add discord 2021-09-17 10:02:30 -05:00
Shawn A 05807f56d8 Update README.md 2021-09-17 09:50:18 -05:00
Shawn A fd30eff2bf Update README.md 2021-09-17 09:49:27 -05:00
Shawn A aa20fbc789 swap CI badge 2021-09-17 09:49:03 -05:00
tablatronix ac089992e8 oops forgot this second section 2021-09-17 09:42:37 -05:00
tablatronix 2001438d6f fixing examples and actions 2021-09-17 09:37:07 -05:00
tablatronix 5928293c89 moved non blocking to advanced, accidently put in basic 2021-09-17 09:33:31 -05:00
tablatronix 5e9b0091da wrong case path 2021-09-17 09:22:16 -05:00
tablatronix aa59dcfe0f removed double author from arduino manifest, seems to mess up library searching 2021-09-17 09:17:39 -05:00
tablatronix 5bab658031 oops removed another example 2021-09-17 09:08:35 -05:00
tablatronix 08b2f4d83d change actions compile examples 2021-09-17 09:08:07 -05:00
Dmitriy Shafranskiy 2d2b9f82f3 CI / DC Update - Library Build, Linting, Examples Json Fix (#1264)
* Create main.yml

added onPush & onPull

* Update examples_esp8266.yml

added on push & on pull

* Delete main.yml

* Create examples_esp32.yaml

* CI/DC update

* CI/DC update

* CI/DC update

* hardcoded json lib version

* hardcoded json lib version

* hardcoded json lib version
2021-09-17 09:02:53 -05:00
tablatronix ef8bef1f4d Move spiffs examples, restructure params examples 2021-09-17 08:59:42 -05:00
tablatronix ef09264b6d remove empty example 2021-09-17 08:56:49 -05:00
tablatronix f9091951be add non blocking to basic 2021-09-17 08:56:28 -05:00
tablatronix 925eb79066 clean up spiffs examples 2021-09-17 08:43:01 -05:00
Ruan de Villiers 917f8bbfb0 Auto check ArduinoJson rather than using a #define 2021-09-17 08:32:41 -05:00
tablatronix 620ca70086 Merge branch 'master' into esp32s2 2021-09-09 10:18:58 -05:00
tablatronix 55d7ccbd7a Add better handling of arduino ver checking 2021-09-09 10:18:40 -05:00
tablatronix f199906e9d Testing fixes 2021-09-08 16:41:34 -05:00
Mollayo 70776a0a05 Using __FlashStringHelper for customHTML (#1292)
* Add callback for OTA update

* Using __FlashStringHelper for customHTML
2021-09-08 10:52:21 -05:00
tablatronix 94754e60b5 Merge branch 'master' into esp32s2 2021-09-08 10:49:10 -05:00
Mollayo 8ce698427d Add callback for OTA update (#1286) 2021-09-03 21:23:37 -05:00
tablatronix 8984863fe6 update example action 2021-06-21 11:15:56 -05:00
Dmitriy Shafranskiy cdd8a406a8 Added Github Action to Compile Examples on ESP8266 (#1258)
* Create examples_esp8266.yml

Init add of examples compilation

* Update examples_esp8266.yml

* Update examples_esp8266.yml

* Update examples_esp8266.yml

* Update examples_esp8266.yml

* Update examples_esp8266.yml

* Update examples_esp8266.yml
2021-06-21 11:11:39 -05:00
Shawn A d395e496a1 update travis url 2021-06-21 11:04:20 -05:00
tablatronix e87141eb04 bump arduinojson CI 2021-06-21 10:57:47 -05:00
tablatronix 8c1e890c36 remove uneeded test 2021-06-21 10:54:49 -05:00
tablatronix 109a618c1f Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-06-21 10:42:36 -05:00
tablatronix ce37e5c8ff file was named wrong 2021-06-21 10:42:34 -05:00
Shawn A 8503260101 Merge pull request #1005 from flavio-fernandes/constWiFiManagerParameter
trivial: WiFiManagerParameter get accessors should work on const
2021-06-21 10:28:52 -05:00
tablatronix 2ce0850d80 Renamed example folders 2021-06-21 10:06:46 -05:00
tablatronix 3bf0d4bed3 fix presavecallback called twice if params in wifi 2021-06-21 09:49:39 -05:00
tablatronix 69c60e8e4e drop debug back to verbose 2021-06-12 10:21:46 -05:00
tablatronix a83ac6e926 debugging, bypass loop if portalstopped
I really have to fix this state handling
2021-04-24 12:06:34 -05:00
tablatronix 14f70dde76 Switched to abort for #1243 2021-04-24 10:49:19 -05:00
tablatronix 5fa729170a oops 2021-04-24 09:14:00 -05:00
tablatronix b78efd36df oops #1243 2021-04-22 17:18:36 -05:00
tablatronix 8448d66ea7 #1243 clean 2021-04-22 17:16:34 -05:00
tablatronix bcf1dd69ff oops, fix comemnt 2021-04-22 11:09:19 -05:00
tablatronix 7820fb72e7 #1243 setSaveConnect()
can disable connect when save, does not alter return codes!
2021-04-22 11:06:12 -05:00
tablatronix 3bec5ade1a Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-04-13 14:40:08 -05:00
tablatronix 4d37843af8 fix #1241 maybe 2021-04-13 14:40:06 -05:00
tablatronix 87fcf08ee0 remove content-length heasders #1235 2021-04-13 14:35:27 -05:00
tablatronix f5dd402ba2 Fix ota title 2021-04-08 17:01:47 -05:00
tablatronix 960ef96805 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-04-05 10:05:15 -05:00
tablatronix d157694b12 minor whitespzce 2021-04-05 10:05:14 -05:00
Shawn A 1e90d22d3b removed development branch 2021-03-31 22:07:51 -05:00
Shawn A f16af759d1 Update ISSUE_TEMPLATE.md 2021-03-24 12:57:42 -05:00
tablatronix e8297f9b8f Merge branch 'master' into esp32s2 2021-03-18 16:56:35 -05:00
tablatronix 8bfc228695 fix for numretries not bailing 2021-03-18 16:56:25 -05:00
tablatronix 9b100c34dc missed one #1226 2021-03-18 14:28:04 -05:00
tablatronix c47fc907a9 fix array sizes for info 2021-03-17 14:52:11 -05:00
tablatronix 34e30277d7 double debug 2021-03-17 14:50:15 -05:00
tablatronix cd9e2070c3 fix bug in setconnecttimeout 2021-03-17 14:41:54 -05:00
tablatronix 1431ca7615 Revert "Merge pull request #1206 from cpainchaud/patch-1"
This reverts commit 65d3affda3, reversing
changes made to fe8d2970a0.
2021-03-17 13:46:00 -05:00
tablatronix a9507c98b5 test fixes for v3 esp32 S2 2021-03-16 08:53:17 -05:00
Shawn A 65d3affda3 Merge pull request #1206 from cpainchaud/patch-1
fix potential memory leak in  WiFiManagerParameter::setValue
2021-03-11 13:25:27 -06:00
tablatronix fe8d2970a0 better checking 2021-03-10 11:59:11 -06:00
tablatronix d805cbdc0c oops fix syntax 2021-03-10 11:58:51 -06:00
tablatronix 3e8560c570 fix for esp32 will have to shim 2021-03-09 14:15:34 -06:00
tablatronix 848a107b16 reorder info page 2021-03-09 14:09:14 -06:00
tablatronix 5578cb85c6 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-03-09 11:35:22 -06:00
tablatronix e24108fa45 debugplatform 2021-03-09 11:35:20 -06:00
tablatronix 2dd2eb1d7e fix omit param page if no params 2021-03-06 20:48:16 -06:00
tablatronix 04a39c2917 fix title on ota 2021-03-06 20:10:54 -06:00
tablatronix dac0018d77 Add ability to set custom titles, change page header titles
Replaces root WiFiManager title with cusotm as well as page title, Also swaps headers, title first then domain - ip
2021-03-06 20:09:12 -06:00
tablatronix c48173e32a Add ability to customize debug prefix 2021-03-06 11:25:38 -06:00
tablatronix 133dd8cd52 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-03-06 11:12:08 -06:00
tablatronix 0dbffbb730 adds wifi config tests 2021-03-06 11:12:01 -06:00
tablatronix 8aca0beccb fixup some debugs for portal timeout 2021-02-22 16:04:56 -06:00
tablatronix 77bd201d13 fixes #1210
Moves dns server out of webportal setup as it is only needed for softap and captive portal, still enabled for portal so cp can be toggled on and off
2021-02-22 16:04:37 -06:00
tablatronix 0780e4fe02 adds preloadWiFi default ssid pass 2021-02-05 16:23:44 -06:00
tablatronix c710e9ecbe add br to no networks error 2021-02-05 15:47:13 -06:00
tablatronix 2fdba90efb Remove links from help for dangerous items 2021-02-05 11:09:02 -06:00
Christophe Painchaud 9d9d314a0c fix syntax error 2021-02-05 17:50:34 +01:00
Christophe Painchaud bd59d98b91 fix potential memory leak in WiFiManagerParameter::setValue 2021-02-04 23:29:25 +01:00
tablatronix f122cc9509 fix ota debug 2021-02-04 13:23:48 -06:00
Shawn A 1c72f4c944 Merge pull request #1204 from cpainchaud/patch-1
fix  debug message in WiFiManager::handleParamSave
2021-02-04 12:05:40 -06:00
Christophe Painchaud 42532f995b fix debug message in WiFiManager::handleParamSave
DEBUG_WM(DEBUG_VERBOSE,F("<- HTTP Wifi save "));  while it's obviously Params instead of Wifi
2021-02-04 19:01:04 +01:00
tablatronix f714000fb9 Fixup ota 2021-02-04 10:25:30 -06:00
tablatronix 83e9bbc9db fix esp32 ota size 2021-02-03 16:18:19 -06:00
tablatronix ef8e26c87e debugger adjustments 2021-02-03 12:34:14 -06:00
tablatronix 0d04a14352 fix esp32 country err handle 2021-02-03 11:25:59 -06:00
tablatronix f9b86f6870 Changed ssid psk gets to peristent
Status would not show existing saved ssid psk or status if connect failed, as current config is empty if conx fails, this might break something not sure what else I am using non persistent checking for
2021-02-03 10:01:10 -06:00
tablatronix e933a20d20 Fixes #1203
Psk placeholder should not show if no psk is saved
2021-02-03 09:59:20 -06:00
tablatronix 6119a9efdf refactor #1199 2021-01-28 12:15:57 -06:00
Shawn A 9eac697606 Merge pull request #1199 from cpainchaud/master
adding WifiManager::isConfigPortalActive() abd WifiManager::isWebPortalActive()
2021-01-28 12:06:55 -06:00
Christophe Painchaud 87ec3c8d8d adding WifiManager::isConfigPortalActive() abd WifiManager::isWebPortalActive() 2021-01-28 18:13:09 +01:00
tablatronix 73b465329c clean up redundant debug blocks 2021-01-26 11:18:50 -06:00
tablatronix 245d24b31b fix comments for callbacks 2021-01-25 15:52:11 -06:00
tablatronix 1fc27318d3 Remove branch references 2021-01-25 10:28:39 -06:00
tablatronix 6eb463d646 Merge branch 'master' of https://github.com/tzapu/WiFiManager 2021-01-15 13:33:01 -06:00
tablatronix fcc662c70a add setDarkMode alias 2021-01-15 13:32:59 -06:00
tablatronix 60c1b8617d adding ota error 2021-01-09 11:26:05 -06:00
tablatronix 28a0dcbf13 Merge branch 'master' into development 2021-01-04 11:21:26 -06:00
tablatronix 0602cdcb41 Update .gitignore 2020-12-22 08:44:00 -06:00
Shawn A 6205ddc3d8 Delete .DS_Store 2020-12-22 08:41:41 -06:00
tablatronix e759a48847 esp temp and hall test 2020-12-18 16:26:34 -06:00
tablatronix b3d45031a5 update esp info page 2020-12-18 14:52:23 -06:00
tablatronix db74856951 Fix warning 2020-12-18 14:52:03 -06:00
tablatronix 0b68256215 #1158 2020-12-18 13:26:47 -06:00
tablatronix 6e05a9ff27 fix bad code, this was not supposed to be commited, sorry 2020-12-16 16:37:05 -06:00
tablatronix 41cb00ecaa fixes #1177 oops 2020-12-16 16:23:30 -06:00
Shawn A 4d2a6b2bac Merge pull request #1175 from egrekov/development
Fix. The library is not assembled under ESP8266
2020-12-16 09:32:16 -06:00
Evgenii Grekov 1e85c0e35e Fix. The library is not assembled under ESP8266 2020-12-16 15:17:38 +05:00
Shawn A 82701d9ec7 Update README.md 2020-12-15 20:22:33 -06:00
tablatronix e071e3ad8f debugging testing country esp32 2020-12-14 22:48:10 -06:00
tablatronix e394283fda fix ota handler string 2020-12-14 17:26:44 -06:00
tablatronix 4e4942b511 fixes #1169 for now 2020-12-12 18:25:08 -06:00
tablatronix 1fb70a9b44 fixes #1164 thanks @fretzbiz 2020-12-09 20:50:48 -06:00
Shawn A f0d3a24c11 badgers? 2020-12-08 14:03:07 -06:00
Shawn A 86a97d7669 gitter 2020-12-08 13:38:31 -06:00
tablatronix 506b3c48f3 Merge branch 'development' into ota 2020-12-08 12:59:00 -06:00
tablatronix 16bd0f4f3c dev v2.04 beta 2020-12-08 12:57:33 -06:00
tablatronix 78f00ffe0a v 0.16 2020-12-08 12:54:46 -06:00
Shawn A a72930eebf Merge pull request #1155 from ivankravets/patch-7
Fix library name
2020-12-08 10:31:44 -06:00
Ivan Kravets 8d967a6dfc Fix library name 2020-12-02 15:08:27 +02:00
tablatronix 321034b99e Moved debug strings no in flash, added WM_NODEBUG 2020-12-01 12:07:06 -06:00
tablatronix d8c7d2a6f0 Remove debug 2020-12-01 11:36:41 -06:00
tablatronix fc48649129 nother 2020-12-01 11:33:44 -06:00
tablatronix 12c114d11b missed one 2020-12-01 11:31:31 -06:00
tablatronix 2c84651286 clean up debug lines 2020-12-01 11:27:58 -06:00
tablatronix b34efd0206 testing basic auth 2020-12-01 10:09:15 -06:00
tablatronix 54904d316b add info page ota update 2020-12-01 10:09:01 -06:00
tablatronix 35e9f41b8b Merge branch 'development' into ota 2020-11-23 13:07:59 -06:00
Shawn A b5508762ef Merge pull request #1151 from brewpi-remix/development
Use constrain properly
2020-11-22 10:05:18 -06:00
Lee Bussy 3a66412db4 Merge pull request #1 from brewpi-remix/fix-constrain
Use constrain properly
2020-11-22 07:58:31 -06:00
Lee Bussy 5def8f84d4 Use constrain properly 2020-11-22 07:58:02 -06:00
tablatronix e1a263b47f forgot to clamp 0 2020-11-19 14:42:38 -06:00
tablatronix 3828790109 remove warnings 2020-11-19 14:25:21 -06:00
tablatronix a7fb6d5caf adds #1137 connect retries
setConnectRetries()
2020-11-19 14:25:12 -06:00
Flaviof 08fbe310b7 Merge branch 'development' into constWiFiManagerParameter 2020-11-19 14:32:36 -05:00
Shawn A 9e29835ac8 Merge pull request #1106 from davefiddes/fix-warning-in-debugplatforminfo
Fix warning in WiFiManager::debugPlatformInfo for ESP32
2020-11-19 13:11:32 -06:00
tablatronix e454c9969a remove oled stuff 2020-10-17 21:44:55 -05:00
tablatronix 08efbfcfe7 remove country debug 2020-09-15 10:18:43 -05:00
tablatronix 726bdfae46 #1125 remove country from 2.3.0 2020-09-15 09:54:45 -05:00
tablatronix 61916627ed example compile issue 2020-09-14 10:23:09 -05:00
tablatronix d1656421bb remove getheapstats, not exist in 2.3.0 2020-09-14 10:23:00 -05:00
David J. Fiddes fac59e1982 Fix warning in WiFiManager::debugPlatformInfo for ESP32
This fixes an unused variable warning as the call to
heap_caps_get_free_size() is not required.

Tests:
 - Enable debug mode and verify free heap and ESP SDK
    version are correctly displayed
 - Cross check with the free heap reported via the captive
    portal info page
2020-08-13 18:19:55 +01:00
tablatronix 31be25d54b Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2020-08-04 23:24:29 -05:00
tablatronix 994609f1e0 add logging 2020-08-04 23:24:28 -05:00
Shawn A 4319a66da9 Merge pull request #1073 from adrianjost/patch-1
swap comments
2020-06-07 13:58:21 -05:00
Adrian Jost 998243c60c swap comments 2020-06-07 20:26:03 +02:00
tablatronix 9af72535ef I messed up 2020-05-25 11:42:31 -05:00
tablatronix 2cedf7b368 2.0.2 2020-05-24 14:11:25 -05:00
tablatronix af3c3671a2 oops, remove js alert debug 2020-05-24 13:19:00 -05:00
tablatronix 80a8dfd554 Merge branch 'master' into hotfixes 2020-05-22 10:09:56 -05:00
tablatronix bc06bb0a1b clean up dev example a little 2020-05-19 23:26:08 -05:00
tablatronix 57a9f17335 add mdns update to process 2020-05-19 23:25:54 -05:00
Shawn A b2f87abd1b Update README.md
Title..
2020-05-19 16:18:44 -05:00
tablatronix 01538e69c1 cleaning up .h 2020-05-19 11:55:58 -05:00
tablatronix 3c0c3ff93e adds green status S, adds test back button 2020-05-19 11:34:31 -05:00
tablatronix f99eda8a9f Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2020-05-19 10:58:12 -05:00
tablatronix d71a14194b Fix MDNS
stupid c++ macros
2020-05-19 10:58:10 -05:00
Shawn A 95d116cea3 Update README.md
:warning
2020-05-18 16:34:27 -05:00
Shawn A f4a577bbc2 Update README.md 2020-05-18 16:31:13 -05:00
tablatronix 634fac4be0 fix travis esp32 2020-05-18 15:49:24 -05:00
tablatronix b67d1656d8 Fix esp32 mdns 2020-05-18 15:46:44 -05:00
tablatronix 01b909a1d2 version alpha release 2020-05-18 15:36:15 -05:00
tablatronix 5edf38550a update 2020-05-18 15:35:50 -05:00
tablatronix 7458674c7b Merge branch 'development' into ota 2020-05-15 16:53:13 -05:00
tablatronix 0486034c6a some comments etc 2020-05-14 21:56:33 -05:00
tablatronix 6029a39f05 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2020-05-14 21:55:49 -05:00
tablatronix 3e9f9a103e #1050 prevent copy assignment of param constructor 2020-05-14 21:55:47 -05:00
Shawn A 062e66bb3c Merge pull request #1053 from dontsovcmc/readme_dns
Readme: fill DNS server if setSTAStaticIPConfig
2020-05-14 08:21:00 -05:00
doncov.eugene 7b52e709db Readme: fill DNS server if setSTAStaticIPConfig 2020-05-14 15:50:39 +03:00
tablatronix 135e872caa remove debug 2020-05-11 21:29:46 -05:00
tablatronix 6515190124 fixes #1046 2020-05-11 17:23:20 -05:00
tablatronix 32075b32cd fixes #1040, adds http port
`setHttpPort`
2020-05-11 12:39:50 -05:00
tablatronix 6b6a960075 Merge branch 'development' into ota 2020-05-10 14:00:22 -05:00
tablatronix 5aebb1dd51 Some hostname testing 2020-05-08 23:31:02 -05:00
tablatronix 293f705b0f #1039 2020-04-19 00:53:18 -05:00
tablatronix e9d75a08b8 Disables usermode restore
I may add optionals later for this, right now sta mode is the default, and sta mode will always be the only mode on after using WM, if you were using ap mode you have to turn it back on yourself until I have a better solution or documentation.
2020-04-10 10:06:11 -05:00
tablatronix 709cfffb95 adds embedded logo example 2020-04-07 11:42:01 -05:00
tablatronix 6c08094e41 Skip autoconnect when there are no creds saved 2020-03-13 11:35:04 -05:00
tablatronix 4a98ba0e29 Update OnDemandConfigPortal.ino 2020-02-27 11:34:31 -06:00
tablatronix 3f93afe9c2 change debug saves logs 2020-02-25 16:31:45 -06:00
tablatronix eb771a0608 Merge branch 'development' into ota 2020-02-19 12:54:04 -06:00
tablatronix 89fcfe9680 adds to dev example 2020-02-18 16:25:17 -06:00
tablatronix b61bc261bf disable clean connect, OPTIONAL setter
setCleanConnect(bool enable); // default false

This was originally intended to improve connection stability, but it is now causing problems , this is now disabled and can be reenabled optionally.
Possible race condition diconnecting while auto connecting or async setmode delays
2020-02-18 16:14:45 -06:00
tablatronix decd2942c5 fix param out of scope check in doparamsave 2020-02-18 15:09:42 -06:00
tablatronix dd8bbea8c5 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2020-02-18 13:31:49 -06:00
tablatronix bdb1ab3c32 comments, dev example tests 2020-02-18 13:31:40 -06:00
Shawn A e173946284 Merge pull request #1011 from marcovannoord/patch-1
Update WiFiManager.cpp
2020-02-18 13:29:28 -06:00
Marco f7d4c166ae Update WiFiManager.cpp
Fixed bug where, after clicking "Save", it would display an empty page to the user, instead of the wifi save page. (due to local variable)
2020-02-18 11:02:56 +01:00
Flavio Fernandes 893568052a trivial: WiFiManagerParameter get accessors should work on const instances
Enhancement: It should be okay to invoke getID() and getValue() in a
const instance of the WiFiManagerParameter class.

See: https://github.com/flavio-fernandes/persistWifiSetting/commit/135adb1c7e436db1ed92ccd5eb522b9ae418b216
2020-02-07 07:39:46 -05:00
Shawn A 9967d27148 Merge pull request #993 from Ruandv/issue654
Fix ArduinoJson (Using ARDUINOJSON_VERSION_MAJOR)
2020-01-27 14:28:25 -06:00
tablatronix cc4acba4ab add shouldbreakafterconifg workaround to readme 2020-01-22 10:51:27 -06:00
tablatronix 87009dc443 fixes #987 2020-01-22 10:42:08 -06:00
tablatronix 2f76338ec7 merge and release hotfixes 2020-01-22 09:05:41 -06:00
tablatronix f3c1964e1c Merge branch 'hotfixes' 2020-01-22 09:04:39 -06:00
tablatronix 13132edd9e Easier debugging autoconnect 2020-01-22 09:02:02 -06:00
Shawn A 0a7d7469fd Merge pull request #995 from revolter/patch-1
Add missing line to code sample
2020-01-22 08:58:43 -06:00
Iulian Onofrei 725f824e58 Add missing line to code sample 2020-01-19 18:35:06 +02:00
Ruan de Villiers a6438edb3c Auto check ArduinoJson rather than using a #define 2020-01-15 07:24:28 +02:00
Ruan de Villiers 9669bfd1a3 Added functionality to toggle between ArduinoJson 5 and 6 2020-01-14 21:20:51 +02:00
Ruan de Villiers 210b4c5d01 Updated AutoConnectWithFSParameters to toggle between ArduinoJson5 and ArduinoJson6 2020-01-14 21:07:38 +02:00
tablatronix ef962adc57 Merge branch 'development' into ota 2019-12-12 12:41:27 -06:00
tablatronix c9665adfaf oops remove mdns test 2019-12-03 23:00:40 -06:00
tablatronix 12fde678e5 bump arduino ide 2019-12-03 22:55:59 -06:00
tablatronix 351761b9a7 travis failing shrug
`home/travis/.arduino15/packages/esp8266/hardware/esp8266/2.6.0/cores/esp8266/debug.h:8:26: error: '::printf' has not been declared`
2019-12-03 22:15:03 -06:00
tablatronix 0fd0c33222 remove serial1 2019-11-29 20:06:41 -06:00
tablatronix 636027cabc rework #974
make compatible with params page
2019-11-29 20:04:31 -06:00
tablatronix 7882c0e9a9 fixes #975 2019-11-29 19:54:02 -06:00
tablatronix 9d6ce13b92 fix for #740 confusion 2019-11-29 19:29:56 -06:00
tablatronix 72bcbd8a80 fixes #974 password placeholder
showPassword()  optional
2019-11-29 18:32:10 -06:00
tablatronix 56ad40d083 Fixes #970 I broke constructor 2019-11-17 12:20:30 -06:00
tablatronix 22e35b2a03 #667 remove compile warning
Still not sure what the issue was here.
2019-11-14 00:37:41 -06:00
tablatronix f93d444966 remove otaflag probably not needed 2019-11-14 00:24:11 -06:00
tablatronix d90f6854e9 Update OnDemandConfigPortal.ino
adds ota to dev example suite
2019-11-13 23:11:05 -06:00
tablatronix a4993a8441 comments 2019-11-13 23:10:43 -06:00
tablatronix 768ead409e add support for build debug flags
WM_DEBUG_LEVEL
WM_DEBUG_PORT
closes #965
2019-11-13 22:47:55 -06:00
tablatronix fb29462e73 add heap frag logging to esp32 2019-11-13 09:12:23 -06:00
tablatronix 2447a3fd74 oops double debug titles 2019-11-12 22:56:46 -06:00
tablatronix e45bdb1831 Update WiFiManager.cpp
adds more heap debug debug_level DEBUG_MAX to enable
#961 #518
2019-11-12 22:54:45 -06:00
tablatronix a2355889ba fixes #956
Not tested, not sure if captive portal works with hidden ap, test please.
adds wm.setWiFiAPHidden(bool);
2019-10-30 08:55:24 -05:00
Shawn A 4014daeb71 Merge pull request #958 from LongLiveCHIEF/add-platformio-install-info
Add PlatformIO installation docs
2019-10-27 20:13:11 -05:00
Brian vanderbusch 7d7e228b9e Add PlatformIO installation docs 2019-10-27 15:06:44 -05:00
tablatronix 9a85b107fa spiffs erase #949 2019-09-26 13:56:48 -05:00
tablatronix 8190ec6077 Merge branch 'development' into ota 2019-09-25 12:43:49 -05:00
tablatronix 3771a79a55 dev example country and bounce 2019-09-13 11:28:05 -05:00
tablatronix 4d94476fa3 add string guards 2019-09-13 11:27:20 -05:00
tablatronix 5d9a51f671 adds country support for esp8266 #667 2019-09-13 11:27:05 -05:00
tablatronix e50d30cd5e uppercase default ap name
This should match the default in sdk now
2019-09-12 14:49:38 -05:00
tablatronix 6e1e698cf9 comments 2019-09-12 09:57:56 -05:00
tablatronix f06f4ea5dc adds async cache time _scancachetime adds async flag 2019-09-12 09:57:35 -05:00
tablatronix 646af21d30 changed dev example non delay 2019-09-12 09:56:55 -05:00
tablatronix 3f8f3eb1ad fixes #936, adds setWiFiAPChannel 2019-09-12 09:56:37 -05:00
tablatronix bd8320a45a fixes #935 disables password ofr open ap selects
Only works if htmk class l is not removed and html not changed, js will have to be updated if changed
2019-09-12 09:53:49 -05:00
tablatronix 58428ec1f8 fixup some calls
I think these should work, will have to test for empty strings and not actual info and fix
2019-09-11 12:22:31 -05:00
tablatronix 999da6d1a1 fixes #924 wifi info getters
gets ssid and psk with persistent param, needs testing
2019-09-11 12:00:09 -05:00
tablatronix 368ea928f0 arduino wont pickup this release
trying a different format
2019-09-09 08:46:45 -05:00
tablatronix 7acc77bcb1 fixing comments for disableipfields 2019-08-30 10:48:43 -05:00
tablatronix 2e7af253ab V0.15-beta
I think this works for library managers..
2019-08-30 09:44:20 -05:00
tablatronix d0e70fdd6b fixes #336 2019-08-30 09:36:44 -05:00
tablatronix 8f9edd18a6 fixes #708 2019-08-30 09:19:20 -05:00
tablatronix 89eb952d18 hotfix #576 2019-08-30 09:14:54 -05:00
Shawn A d1e395e78f Merge pull request #615 from xnorbi/master
Fixed: Waiting for connection result with time out issue
2019-08-30 09:02:19 -05:00
Shawn A 286e5d13d9 Merge pull request #772 from dontsovcmc/issuu_#644_utf-8_correct
separate charset UTF-8 and viewport meta
2019-08-30 09:01:09 -05:00
Shawn A ff26ed4e4c Merge branch 'master' into issuu_#644_utf-8_correct 2019-08-30 09:00:57 -05:00
Shawn A edce3fc84c Merge pull request #928 from d-a-v/head
hotfix: rename internal HTTP_HEAD to HTTP_HEADER
2019-08-30 08:52:52 -05:00
David Gauchard f26638e38b hotfix: rename internal HTTP_HEAD to HTTP_HEADER 2019-08-30 15:38:36 +02:00
tablatronix 1b8d870c22 add explicit mode to all examples
So people stop complaining when ap starts by default cause they dont know how esp works.
2019-08-14 13:40:19 -05:00
tablatronix 34d9a975b5 remove reeadme self reffeential link 2019-07-29 16:59:50 -05:00
tablatronix e2d7ae7533 ESP32 DEFINE LED_BUILTIN 2019-07-29 16:33:59 -05:00
tablatronix 41810a344a bump arduino 1.8.8, install boards esp32 2019-07-29 16:06:57 -05:00
tablatronix 6e1104efbf esp8266 build passing, work on esp32 2019-07-29 15:08:34 -05:00
tablatronix 422ce3e165 not sure how this all got changed 2019-07-29 14:13:39 -05:00
tablatronix 7f414f5224 dumb 2019-07-29 14:10:01 -05:00
tablatronix 5b997e0597 trying to fix travis again 2019-07-29 14:02:47 -05:00
tablatronix 6335512ded Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2019-07-29 13:49:17 -05:00
tablatronix 7446edf547 remove esp32 travis 2019-07-29 13:48:53 -05:00
tablatronix 4775b1df51 ok maybe not 2019-07-19 09:19:39 -05:00
tablatronix 8a8e363cc3 Can i just do esp32 boards install now ? 2019-07-19 08:23:21 -05:00
tablatronix b5218d1b93 fix travis compile on esp32 2019-07-19 08:04:46 -05:00
tablatronix e0e0150f78 why did they change every flag????? 2019-07-13 07:34:57 -05:00
tablatronix 5685e7d9b4 ugh boards is so whack 2019-07-13 07:21:19 -05:00
tablatronix 35a1ab2e8d remove crytalfreq 2019-07-13 07:18:23 -05:00
tablatronix 8483118860 all jacked up 2019-07-13 07:15:32 -05:00
tablatronix 49c6cec998 ugh wtf 2019-07-13 07:08:35 -05:00
tablatronix a1c53d785f travis fqbn updates
just removing bad ones for now, will fix later
2019-07-13 07:00:13 -05:00
tablatronix debb20e41b Revert "remove geenric from travis for now"
This reverts commit d20b85a7b8.
2019-07-13 06:56:20 -05:00
tablatronix d20b85a7b8 remove geenric from travis for now 2019-07-13 06:53:58 -05:00
Shawn A c3ff582374 Merge pull request #894 from mikdatdogru/patch-1
signal class value has been wrapped to int()
2019-06-03 11:38:29 -05:00
Shawn A cccc7c9ae6 Merge pull request #895 from mikdatdogru/patch-2
Update WiFiManager.template.html
2019-06-03 11:32:38 -05:00
Mikdat DOĞRU 318742e183 Update WiFiManager.template.html
parse.js parsing error fixed
2019-06-02 18:58:13 +03:00
Mikdat DOĞRU 7fbb941383 Update WiFiManager.cpp
i wrapped to int() function, because cannot match on css because the incoming data is decimal
2019-06-02 18:27:50 +03:00
tablatronix 4873c7c632 silence event debug 2019-02-26 21:37:57 -06:00
tablatronix f0441f65b7 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2019-02-26 21:36:27 -06:00
tablatronix ea1a09130f fix #771 again, I never set hasbegun to true!
should fix esp32 events not working, namely async scannetworks
2019-02-26 21:36:25 -06:00
tablatronix 8b685d6826 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2019-02-25 08:46:29 -06:00
tablatronix 621ac63154 Update .travis.yml 2019-02-25 08:46:10 -06:00
tablatronix d6cf147e5b fixing up travis, not sure why cpufreq is throwing errors or debug ? 2019-02-24 08:41:33 -06:00
tablatronix 30fd2b13a6 remove extra define init() 2019-02-24 08:30:57 -06:00
tablatronix 6131c2d38a update basic.ino 2019-02-24 08:29:20 -06:00
tablatronix bbc98a7e74 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2019-02-19 22:06:18 -06:00
tablatronix 9353fb01d3 added debugging log 2019-02-19 22:06:16 -06:00
Shawn A 8f6950d3eb Merge pull request #803 from sidey79/define-hardware
wifimanager.cpp / wifimanager.h
2019-02-14 11:52:42 -06:00
tablatronix 0865a36a5e fix for #782 2019-01-31 16:49:13 -06:00
tablatronix c6591ce7b9 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2019-01-26 18:07:24 -06:00
tablatronix 0e75b669b7 change var name 2019-01-20 10:11:24 -06:00
tablatronix 3717e323b9 adds password debugging 2019-01-10 15:37:12 -06:00
sidey79 1282c4d5b5 wifimanager.cpp / wifimanager.h
added define that checks on esp32 or esp8266. If another hardware is selectec, then do not try to compile this code.
2019-01-08 23:33:56 +01:00
tablatronix 862e2dbde2 stupid shit wont compile
other stuff says not in scope , makes no sense
2019-01-04 14:54:31 -06:00
tablatronix aaf2544c93 add sample oled support to DEV example 2019-01-04 14:50:38 -06:00
tablatronix e25277b20c make getRSSIQuality public 2019-01-04 09:37:07 -06:00
tablatronix 944450840a applies #772 to dev 2018-12-20 10:56:55 -06:00
tablatronix 540ee694fe Merge branch 'development' into ota 2018-12-20 10:47:11 -06:00
david gauchard 71f997b5c7 Merge branch 'master' of https://github.com/tzapu/WiFiManager into loop 2018-12-08 23:42:48 +01:00
doncov.eugene fd6bf74720 separate charset and viewport meta 2018-11-26 17:03:20 +03:00
tablatronix 65ad141008 Update WiFiManager.cpp
tentative fix for #771
2018-11-24 19:16:25 -06:00
tablatronix 4add3127d4 Update WiFiManager.cpp
tentative fix for #771
2018-11-24 19:12:33 -06:00
tablatronix 3e2f8ae9d8 fix update menu bug 2018-11-18 10:32:13 -06:00
tablatronix bbe984c93b sampe update 2018-11-13 16:49:43 -06:00
tablatronix cf1b1a93a6 remove width to make buttons back to small width 2018-11-13 16:36:21 -06:00
tablatronix 0ec7a58b7b add upload note 2018-11-13 16:35:26 -06:00
tablatronix 7da803389c add js to firmwaree upload
hide upload until selected, update return msg box
2018-11-09 16:43:54 -06:00
tablatronix 5a3829abf9 Merge branch 'development' into ota 2018-11-09 15:38:19 -06:00
tablatronix 6459e4fd4d add variable css to template 2018-11-09 15:37:27 -06:00
tablatronix df38c54a66 Merge branch 'development' into ota 2018-11-09 15:26:52 -06:00
tablatronix 65cb95585d more css consolodating 2018-11-09 15:25:56 -06:00
tablatronix 9d3cc69b56 rework css
shrink css, add file upload input styling
2018-11-09 15:16:19 -06:00
tablatronix 5dab5a4685 adds accept filter for ota .bin
#727
2018-11-09 14:20:35 -06:00
tablatronix 69e08e7871 add input accepttype 2018-11-09 14:19:30 -06:00
tablatronix c9af1b11a7 clean up some ota stuff disable renable timeouts 2018-11-08 14:11:56 -06:00
tablatronix cac71e368e update todo 2018-11-08 13:36:13 -06:00
tablatronix 2267f34fb5 fix wrong urls 2018-11-08 13:35:33 -06:00
Shawn A 205d30e958 Merge pull request #587 from sidey79/dev-ota-updater
WIP: Added OTA updater option from esp8266
2018-11-08 12:51:02 -06:00
Shawn A 7dc75eacde Merge branch 'ota' into dev-ota-updater 2018-11-08 12:50:14 -06:00
tablatronix 9a4c0f1580 hotfix #576 2018-11-08 12:20:01 -06:00
tablatronix ccfca4b663 adds customhtml input example 2018-11-06 12:04:18 -06:00
tablatronix 41214ad7eb Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-11-02 10:13:09 -05:00
tablatronix 501c824993 supports stopConfigPortal if blocking , flag abort 2018-11-02 10:13:07 -05:00
tablatronix 73f2a8c366 adds empty param constructor 2018-10-31 14:23:39 -05:00
tablatronix 38b6c878a2 chaange setCaptivePortalClientCheck to setAPClientCheck 2018-10-31 14:15:02 -05:00
tablatronix 370be061e4 adds custom param examples to advanced 2018-10-31 14:03:26 -05:00
tablatronix 2209f987b7 removed placeholder and added temlplace comments 2018-10-31 14:02:16 -05:00
tablatronix 7f0bd1e41f changed placeholder to label
deprecated getPlaceholder with getLabel
2018-10-31 13:47:05 -05:00
tablatronix 55577692fe add ntp time to dev example 2018-10-18 16:47:52 -05:00
tablatronix 2d021bbab8 adds nonblocking params example 2018-10-13 15:57:00 -05:00
tablatronix 256c889715 comments 2018-10-12 16:08:31 -05:00
tablatronix c3fd7d9622 #461 testing
adds new callback and moved webserver to public
2018-10-12 15:57:35 -05:00
tablatronix 3c280b12a8 moved apcallback after webserver is available 2018-10-12 15:16:59 -05:00
tablatronix 080f7751e0 moving apcallback after everything 2018-10-12 14:52:10 -05:00
tablatronix 1d0970a882 moving apcallback after sosftap()
apcallback used to only indicate that mode was softap, moved untikl after actually starting the ap, so it can be used to check status and get ip etc.
2018-10-12 14:10:16 -05:00
tablatronix bef46b9e72 adds setSaveParamsCallback
clean up examples
2018-10-11 15:23:48 -05:00
tablatronix 4f1196aa69 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-10-06 14:11:22 -05:00
tablatronix ea67dc22c0 remove resetsettings 2018-10-06 14:11:20 -05:00
tablatronix b091ee00d8 working on readme 2018-10-05 15:04:25 -05:00
tablatronix ec1d474d7b readme and comments 2018-10-05 14:29:11 -05:00
Shawn A 7d01b99e72 Merge pull request #378 from gmag11/resetConfigCallback
Add a callback when reset settings is triggered, changed to development branch
2018-10-05 09:21:36 -05:00
Shawn A 29bb8a7d22 Merge branch 'development' into resetConfigCallback 2018-10-05 09:21:14 -05:00
Shawn A b95cadbe9a Merge branch 'master' into resetConfigCallback 2018-10-05 08:43:26 -05:00
Shawn A e1e061e46a Merge pull request #734 from irwanayeah/development
add callback before save config wifi or params
2018-10-05 08:41:57 -05:00
Shawn A 686f7f74ee Merge pull request #718 from fllaca/get_parameters_method
Implements #717:  Added getParameters and getParametersCount methods.
2018-10-03 10:29:45 -05:00
tablatronix 669dad4206 starting readme updates 2018-10-01 12:28:37 -05:00
Shawn A 8e7b43a029 rename example 2018-09-27 13:39:12 -05:00
Shawn A fe772f6bf5 fix example 2018-09-26 09:47:59 -05:00
Shawn A 193fdf177c fix example 2018-09-26 09:45:03 -05:00
Shawn A 613ec354bd param defvalue mismatch checking 2018-09-26 09:44:59 -05:00
Shawn A 6dbc0017ba Merge pull request #743 from dontsovcmc/setValue
Set value
2018-09-26 10:28:33 -04:00
Shawn A 37e100672a Merge pull request #741 from dontsovcmc/waterius_development
WiFiManagerParameter init() to protected from private
2018-09-26 10:27:51 -04:00
Dontsov Evgeny 7d42423894 value limit is length 2018-09-24 04:19:21 +03:00
Dontsov Evgeny 85b2319b59 correct your idea about deflength 2018-09-24 03:45:49 +03:00
Dontsov Evgeny dbf91a4e8c example: custom paramaters with load/save settings 2018-09-24 03:28:03 +03:00
Dontsov Evgeny aad1a8d9d2 WiFiManagerParameter init() to protected 2018-09-23 23:19:17 +03:00
Shawn A c0f29a6fc3 Merge branch 'master' into hotfixes 2018-09-20 12:15:44 -05:00
Shawn A 34e1516524 charset utf-8 2018-09-20 12:15:02 -05:00
Shawn A 740005b21e Merge pull request #687 from dontsovcmc/utf-8
issuu #644 add utf-8 charset to head
2018-09-20 12:08:39 -05:00
Shawn A b42b2f23c2 Merge pull request #722 from rodri16/patch-2
Swapping enableAP and softAPConfig
2018-09-20 12:05:21 -05:00
Shawn A 0e4af48d54 fix example 2018-09-19 09:54:17 -05:00
Shawn A 9d00937f34 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-09-18 11:35:57 -05:00
Shawn A 0cd0b75d9e added custom html param example pattern 2018-09-18 11:35:55 -05:00
tablatronix c88df86313 syntax error in examples 2018-09-17 13:44:06 -05:00
Fernando Llaca 1c191c1d14 Rename "Old Examples" folder to "Old_Examples", to avoid errors when iterating examples folder. 2018-09-16 23:16:25 +02:00
Fernando Llaca 12fc6516d2 Missing semicolon 2018-09-16 22:57:01 +02:00
Fernando Llaca 448e079bc8 Use a especific version of ArduinoJson 2018-09-16 22:49:40 +02:00
Fernando Llaca b4cc27cb56 Added getParameters and getParametersCount methods.
Useful for iterating over WiFiManager parameter list
2018-09-16 21:34:24 +02:00
ayeah f9d1c9bd6f reformat 2018-09-17 01:19:18 +07:00
ayeah d9c27b98d4 add listener setPreSaveConfigCallback
this listener required for action before save process behind wifi or params.
2018-09-17 01:10:37 +07:00
Shawn A 4f0a87a0a5 adds esp32 core temp, not enabled
the core temp sensors are not calibrated in production atm, they are large offsets form chip to chip and are useful for relative temp swings only. Until the IDF comes up with a new temp sense, this is commented out.
2018-09-12 13:19:53 -05:00
Shawn A 9ce498c5b6 remove sleep mode 2018-09-12 10:55:04 -05:00
Shawn A 393e7e45df bug fixes #726 2018-09-12 09:56:20 -05:00
Shawn A 1e10ffa49a reworkgin examples 2018-09-07 16:16:44 -05:00
Shawn A 2610dcb2c5 change simple to basic clean up 2018-09-07 15:52:52 -05:00
Shawn A ed80635e32 non blocking examples 2018-09-07 15:43:43 -05:00
Shawn A c52186079a stopconfigportal public 2018-09-07 15:43:21 -05:00
Shawn A 7f12e202d4 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-09-07 14:53:11 -05:00
Shawn A 97e7d30c66 esp8266 2.3.0 compatability restored #576
asyncscannetworks not available in esp8266 2.3.0, adjusted server on to take cstr for backwards compatability
2018-09-07 14:53:08 -05:00
Shawn A 04552e40d8 some testing 2018-09-07 14:51:27 -05:00
tablatronix 0d8b96ebf3 update docblock to reflect setConfigPortalBlocking ignored configportaltimeout 2018-09-06 20:45:38 -05:00
Rodrigo Jose Carbajales 5827c2f8cb Swapping enableAP and softAPConfig
Swapping enableAP and softAPConfig for static IP STA
2018-09-06 12:11:38 +02:00
Shawn A 8871bdd311 logging 2018-09-04 16:39:16 -05:00
Shawn A 338544bc6a do savecallback on parmsave fo rnow #714 2018-09-04 16:39:00 -05:00
Shawn A 43051f9f51 fix 2018-09-04 16:37:14 -05:00
Shawn A 7ab5f6d5b2 clear wifi strings 2018-09-04 16:36:58 -05:00
Shawn A 3a0723cf66 skip connect if wifi empty 2018-09-04 16:36:47 -05:00
Shawn A 103c37d71f Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-09-04 08:14:12 -05:00
Shawn A 42241d6e36 fix nvs erase log 2018-09-04 08:13:30 -05:00
tablatronix b17c328f0f more debugging 2018-09-03 17:19:25 -05:00
tablatronix c1f018ca7c tentative fix for #720 2018-09-03 08:49:13 -05:00
Shawn A d6e091f587 test fix #702 2018-08-29 12:06:55 -05:00
Shawn A 8b579bb8a7 debug 2018-08-29 11:22:05 -05:00
Shawn A b2f6ff4a1f formatting 2018-08-29 10:39:28 -05:00
Shawn A 805072c4c4 adds checkboxes 2018-08-29 10:37:28 -05:00
Shawn A 247aecb2fc update requirements esp8266 2.4.0 2018-08-28 09:00:24 -05:00
Shawn A c78b76ba2e scan timing debugging 2018-08-27 12:30:28 -05:00
Shawn A 85d7f2a549 esp32 fix event cb to std::bind, adds async preload
esp32 does not have scan cb, must use event system and oncomplete to get scan count
2018-08-27 12:17:37 -05:00
Shawn A 16c37e5389 remove npt example, not esp32 compat 2018-08-27 12:16:14 -05:00
tablatronix b963e7f95a fix esp32 fatal, disabled async 2018-08-25 14:55:51 -05:00
tablatronix 1bf3fc04ea fixes #707 2018-08-24 13:37:15 -05:00
tablatronix 4f5e21647f fix res error 2018-08-24 13:02:34 -05:00
tablatronix f2bbb5f4e2 comments 2018-08-24 12:21:20 -05:00
tablatronix 34b7d1ea03 scan preload async
This changes the preload wifiscan to async and adds async support for wifi scans. preload async occursd on cp stsart and root loads(throttled)
2018-08-24 12:19:26 -05:00
tablatronix 28cf8eed16 adding async scannetworks 2018-08-23 16:46:17 -05:00
tablatronix 51432d0ef7 remove tests from example 2018-08-23 15:04:31 -05:00
tablatronix c651ab4b62 cleanup 2018-08-23 13:46:13 -05:00
tablatronix 3123eac5c8 typo 2018-08-23 13:36:08 -05:00
tablatronix 8f03b5df10 testing sta ap modes 2018-08-23 13:35:07 -05:00
tablatronix 2911bb33ee status debug 2018-08-23 13:04:18 -05:00
tablatronix 2074d85da7 cleanconnect 2018-08-23 12:54:48 -05:00
tablatronix 593eda9b87 oops again 2018-08-23 12:16:01 -05:00
tablatronix 3579733f5c refix #702 2018-08-23 12:09:46 -05:00
tablatronix 6d4c971b49 test for #702 2018-08-23 11:55:31 -05:00
tablatronix 1b8ce61522 well shit 2018-08-17 19:38:53 -05:00
tablatronix f1a1f44a08 #700 2018-08-15 19:11:53 -05:00
tablatronix 915023ccb9 fixes #619 unconfirmed needed 2018-08-10 13:49:15 -05:00
tablatronix 792ed84f4b debugging 2018-08-10 11:51:31 -05:00
tablatronix 5ee1ae78c0 fix callback order 2018-08-10 11:45:25 -05:00
tablatronix 4cceb95a42 debugging 2018-08-10 11:42:09 -05:00
tablatronix c6027058c9 added some debugging and testing 2018-08-09 15:21:12 -05:00
david gauchard 493a73c205 Merge branch 'master' of https://github.com/tzapu/WiFiManager into loop 2018-08-08 23:04:30 +02:00
tablatronix e9c4cdb2c6 disable setvalue on customhtml params 2018-08-07 14:06:31 -05:00
tablatronix 768a965810 remove custom ip from example 2018-08-07 13:57:10 -05:00
tablatronix c6ecad1b3a fixes #678 2018-08-07 13:55:45 -05:00
tablatronix 5a5f1c631b fix warning 2018-08-07 13:55:14 -05:00
tablatronix 573f8113ef fixes #691 2018-08-07 12:48:00 -05:00
tablatronix 440f312575 v 0.14 2018-08-05 11:06:15 -05:00
tablatronix dd7a686181 Merge branch 'hotfixes' 2018-08-05 11:05:56 -05:00
tablatronix 6a139688f3 ver .13 2018-08-05 11:03:39 -05:00
tablatronix b855c0a440 updating library managers 2018-08-05 10:48:23 -05:00
dontsovcmc 02de95c529 issuu #644 add utf-8 charset to head 2018-08-04 20:29:55 +03:00
Shawn A e18bc49a2a Wrong case 2018-07-23 07:06:22 -05:00
tablatronix 704a7ae393 hotfix WPS NO_EXTRA_4K_HEAP 2018-07-22 10:47:33 -05:00
tablatronix 2c41af00f5 fixes #671 2018-07-22 10:41:50 -05:00
Shawn A afbad01ee1 dev test sketch 2018-07-20 16:32:43 -05:00
Shawn A cba606b846 password invalid better error msg 2018-07-20 16:23:38 -05:00
Shawn A 8d5e9e3977 esp32 autoconnect is deprecated
https://github.com/espressif/esp-idf/issues/1960
2018-07-20 16:16:08 -05:00
Shawn A 24de319c7e issues with captive portals and preloadscan hammering 2018-07-19 16:54:38 -05:00
Shawn A ad623cb586 oops 2018-07-19 16:03:14 -05:00
Shawn A f2f0aabe3e dark theme tweaks 2018-07-19 14:02:02 -05:00
Shawn A 37cdda33c7 adds setClass(invert) black theme
adds class string to body, invert(black) is built in
` wm.setClass("invert");`
2018-07-19 13:10:37 -05:00
Shawn A c9ca210803 removing US default 2018-07-19 11:33:38 -05:00
Shawn A 2db93d28c7 clean up 2018-07-19 10:05:25 -05:00
Shawn A d140ccff84 adds setCountry, default US
accepts US JP CN, codes must be added to strings and WiFiSetCountry atm
2018-07-19 10:02:53 -05:00
Shawn A a51298ea54 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-07-19 08:40:48 -05:00
Shawn A f1fd553ac6 fix autoreconnect, forgot we use event for other stuff 2018-07-19 08:40:46 -05:00
Shawn A caa32c4bc2 Merge pull request #666 from 0x1abin/path-1
compat MacOS newline
2018-07-19 07:30:58 -05:00
0x1abin 0e6ed38986 compat macos newline 2018-07-19 14:36:18 +08:00
tablatronix a39b96be9c disable autoreconect esp32 2018-07-18 16:25:53 -05:00
tablatronix 713bf957c3 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-07-18 14:01:48 -05:00
tablatronix 74ceba7409 add non blocking example 2018-07-18 14:01:45 -05:00
Shawn A 08bb2322aa Oops 2018-07-16 17:07:31 -05:00
Shawn A 9ab4deaf5b clean up param length
Just changing to not modify argument, spacing
2018-07-16 08:06:03 -05:00
Shawn A 36ad6f80c4 Merge pull request #660 from liebman/do_param_save
Fix crasahes in doParamSave() &  WiFiManagerParameter::setValue
2018-07-16 07:55:39 -05:00
Christopher Liebman 2fac07cbf0 WiFiManagerParameter::setValue used length of default value for i
allocation and not passed length. Changed to use passed length or
length of default value if > passed length.
2018-07-15 14:39:11 -07:00
Christopher Liebman 85dd747949 Use hasParam() instead of checking server.arg() for NULL, it returns a String anyway.
Don't use .c_str() when its being assigned to a String anyway
2018-07-15 10:44:06 -07:00
Shawn A 32495668d8 Update ISSUE_TEMPLATE.md 2018-07-14 16:46:07 -05:00
tablatronix fc84e7a260 trying to fix param issues when param is out of scope
Ideally this should be done entirely different so params can follow wm scope and object lifetime..
2018-07-13 23:52:36 -05:00
tablatronix 933f86720a param was using user length for strncpy, causing overflows 2018-07-13 23:43:07 -05:00
tablatronix abbc110656 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-07-13 18:41:16 -05:00
tablatronix 17f2316ea8 fixes #655 2018-07-13 18:41:14 -05:00
tablatronix 24d317b9da fix #655 2018-07-13 18:27:50 -05:00
Shawn A 40d522d8b6 Merge pull request #649 from vincentVDB/patch-1
Update AutoConnectWithFSParameters.ino
2018-07-09 20:37:52 -05:00
vincentVDB 0f2ba754e2 Update AutoConnectWithFSParameters.ino
Close file !
2018-07-10 02:11:06 +02:00
Shawn A f65972aa55 Merge pull request #647 from liebman/fix_bad_progmem_access
fix bad progmem access
2018-07-08 11:02:49 -05:00
Chris Liebman e235a45d5a value is PROGMEM too.... 2018-07-08 08:32:41 -07:00
Christopher Liebman aeba5478ee fix bad progmem access introduced in https://github.com/tzapu/WiFiManager/pull/608 2018-07-08 07:14:11 -07:00
tablatronix b9f6b472a7 #645 comments 2018-07-07 09:45:24 -05:00
Shawn A b9fcc8fe22 Merge pull request #645 from liebman/only_support_wps_if_no_extra_4k_heap_defined
disable wps by default, enable if its enabled in core
2018-07-07 09:37:28 -05:00
Christopher Liebman 5a06f29c5b In https://github.com/esp8266/Arduino/pull/4889 the core was modified to
disable WPS by default.  Its only enabled if NO_EXTRA_4K_HEAP is defined.
To enable you must re-run the board manager with --noextra4kheap.
This addes #ifdef NO_EXTRA_4K_HEAP arround WPS usage so it won't generate
compiler errors.
2018-07-07 06:26:36 -07:00
tablatronix 4fdefaf67d example work 2018-07-02 10:10:09 -05:00
tablatronix 3a9d70f581 fix example 2018-06-30 13:42:33 -05:00
tablatronix 906a9d89cb advanced example testing 2018-06-29 16:52:20 -05:00
Shawn A c0187a60e1 fix esp32 usermode 2018-06-28 12:54:49 -05:00
Shawn A 0ab6f57239 fix esp32 resetsettings 2018-06-28 12:53:48 -05:00
Shawn A 9917f619b3 reworking examples 2018-06-28 12:53:36 -05:00
Shawn A 8f2791f908 fix esp32 fatal 2018-06-28 11:53:48 -05:00
Shawn A 6d92ae5a1f fixup examples 2018-06-28 11:52:50 -05:00
Shawn A 8d7da2fd8b FIx esp32 updates
Webserver now builtin to esp32 lib, esp32 persistent still not implemented properly, fixes erase again, fixes save again
2018-06-27 16:19:12 -05:00
Shawn A 94115006f6 Merge pull request #571 from liebman/remove_esp32_skiping_examples
enable all example builds for esp32
2018-06-19 12:51:05 -05:00
Shawn A 00b14d5d1c Merge pull request #608 from ohadcn/patch-1
add CORS headers
2018-06-19 12:46:45 -05:00
Shawn A bff3d75f91 Merge pull request #584 from cmarrin/development
Changed setAPCallback and setSaveConfigCallback to take std::function…
2018-06-19 11:35:18 -05:00
Shawn A e3d91a03ff add esp32 persistent test support
persistent support was added via a PR, but not very well, it is buggy.
2018-06-18 15:28:32 -05:00
Shawn A b3e19041ff fix esp32 erase w persistent 2018-06-18 15:27:47 -05:00
Shawn A 10088c71f3 Move all wifi functions out of constructor
Cannot use wifi in constructor on esp32, as it is not available yet,
2018-06-18 15:27:18 -05:00
Shawn A 01a5646317 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-06-18 11:40:05 -05:00
Shawn A 5066b86102 fix esp32 new bugs
esp32 only uses persistent on wifiLowLevelInit
        if(!persistent){
          esp_wifi_set_storage(WIFI_STORAGE_RAM);
        }
which only gets applied during certain functions, namely changing modes, or turning on wifi
2018-06-18 11:40:01 -05:00
Norbert f1e657e2b8 Fixed Waiting for connection result with time out issue 2018-06-04 13:51:29 +02:00
ohad 7f6039a6b7 Merge pull request #1 from ohadcn/patch-2
add CORS headers
2018-05-14 11:50:31 +03:00
ohad 24a25fc687 add CORS headers
this will allow external portal on the network to send credentials via browser.
2018-05-14 11:47:26 +03:00
ohad 128214a159 add CORS headers
this will allow external portal on the network to send credentials via browser.
2018-05-14 11:47:13 +03:00
tablatronix 718a8c8f4c fixing up setmenu docblocks 2018-04-26 20:46:00 -05:00
tablatronix 3c8af53440 comments, debugging 2018-04-25 11:12:12 -05:00
tablatronix 042640924f fix menu output
removed test menu output, removed ref , not sure why I put that there....
2018-04-19 19:01:50 -05:00
sidey79 428c9fcbd5 Updated for ESP32 - compile only tested 2018-04-13 21:51:36 +02:00
sidey79 9e265b44b5 Merge remote-tracking branch 'remotes/origin/development' into dev-ota-updater 2018-04-13 20:53:46 +02:00
sidey79 fe17307e09 Updated include for ota update lib for esp32 2018-04-11 22:11:44 +02:00
sidey79 3fafb3304a HTML Pages and generation for OAT Update adapted to current version of lib
Debug output corrected at some point
2018-04-10 23:07:56 +02:00
tablatronix f8ae461bfd fix savetimeout, too short, made optional 2018-04-09 19:48:31 -05:00
tablatronix d27fa7df61 hotfixing #425
this is a hotfix, there are numerous issues with this, development branch already addressed all of them.
2018-04-09 19:16:12 -05:00
sidey79 16bc717ceb Include Update.h for ESP32 2018-04-09 23:44:27 +02:00
sidey79 8065a1eaa4 Added OTA updater option from esp8266. Code is manly taken from KoljaWindeler but modified in some pieces to fit current library version 2018-04-09 23:08:43 +02:00
Chris Marrin 174bb615e6 Changed setAPCallback and setSaveConfigCallback to take std::function params
This allows Predicates and Lambdas to be passed. Still allows bare function pointers
so this patch is fully backward compatible. Tested on WiFiManager examples for
backward compatibility and on my own project (OfficeClock) for handling lambdas with
captured variables
2018-04-07 09:13:48 -07:00
Shawn A 82309e7a84 comment 2018-04-05 12:38:34 -05:00
Shawn A b682d8996b Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-04-05 12:34:56 -05:00
Shawn A c5b3637350 fixes #581
adds htmlentities to ssid outputs, limited replacements for now
2018-04-05 12:34:27 -05:00
Shawn A 5b3ac4236e fix some error logging 2018-04-05 12:29:42 -05:00
Shawn A 87c2eb42b6 fixup scnanetworks 2018-04-05 12:29:11 -05:00
Shawn A 10f17d0472 workaround for esp32 webserver parsearguments bug 2018-04-05 12:19:46 -05:00
tablatronix 7ec3b99020 clean up defines, removed stuff for memory 2018-03-31 12:42:06 -05:00
tablatronix 49104d4bbb adds chip revision efuse
not sure what use this is, as getChipRevision is usually the same anyway... shrug
2018-03-31 12:41:47 -05:00
Shawn A 41b29fa08c fix erroneous error debug 2018-03-28 09:38:07 -05:00
Shawn A ef70b49e98 fix nvs erase 2018-03-28 08:27:57 -05:00
Shawn A 4a6631511b fix handleerase add softapconfig catch fail 2018-03-28 08:23:04 -05:00
Shawn A a7b992450f Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-03-28 08:14:10 -05:00
Shawn A 10db048d61 getmodestr, handleerase(bool) 2018-03-28 08:13:53 -05:00
Shawn A 3ae0b40ad9 Merge pull request #575 from liebman/allow_disable_portal
allow automatic config portal to be disabled
2018-03-28 08:10:45 -05:00
Christopher Liebman 7495fe2999 add setEnableConfigPortal(boolean enable) - if false dont open condig portal from autoConnect() 2018-03-24 18:29:30 -07:00
Shawn A c9a7112cbb fix parenths #573 2018-03-21 13:46:53 -05:00
Shawn A 32ccac5936 ugh remove test example 2018-03-21 13:32:50 -05:00
Shawn A 32d6f11217 fixes #573 2018-03-21 13:30:53 -05:00
Christopher Liebman 13cd054c15 Merge branch 'master' into remove_esp32_skiping_examples 2018-03-21 10:31:55 -07:00
Shawn A c2cbe3015b refactor connectwifi, adds save timeout
wifi save now no longer uses settimeout timeout
2018-03-21 12:18:00 -05:00
Christopher Liebman 4e71d53c54 Merge branch 'development' into remove_esp32_skiping_examples 2018-03-21 09:13:16 -07:00
Shawn A 02c531a247 spiffs case 2018-03-21 11:05:05 -05:00
Christopher Liebman 6270630d1a enable all example builds for esp32 2018-03-21 07:18:31 -07:00
Shawn A 7279333a17 fix fsparam spiffs examples for esp32 2018-03-21 08:02:15 -05:00
Shawn A 6319955cdc Merge pull request #570 from liebman/fix_travis
Fix travis builds, add esp32 builds
2018-03-20 17:36:34 -05:00
Christopher Liebman 14cd0d563a Merge branch 'development' into fix_travis 2018-03-20 15:36:01 -07:00
Shawn A fd3f5bbb2d Delete OnDemandConfigPortal.ino.cpp
Sigh
2018-03-20 17:30:12 -05:00
Christopher Liebman 9e3061201e Merge branch 'development' into fix_travis 2018-03-20 15:19:40 -07:00
Christopher Liebman 208ae5c7ea Merge branch 'development' into fix_travis 2018-03-20 14:51:41 -07:00
Chris Liebman 56d3e6d737 make travis build again 2018-03-20 13:47:28 -07:00
Chris Liebman 5eea21afa9 add esp32 2018-03-20 13:17:09 -07:00
Chris Liebman e4605775a2 add esp32 2018-03-20 13:09:01 -07:00
Chris Liebman 9e5c1b5fe2 add esp32 2018-03-20 12:55:44 -07:00
Chris Liebman 3891c0a631 add esp32 2018-03-20 12:48:41 -07:00
Chris Liebman fe8f38aa59 add esp32 2018-03-20 12:07:35 -07:00
Shawn A 851a38e7fa ugh 2018-03-20 13:27:50 -05:00
Shawn A 7f6bd107e6 fix debug levels 2018-03-20 13:22:43 -05:00
Chris Liebman 28ed839274 add esp32 2018-03-20 11:16:58 -07:00
Chris Liebman c358378a27 add esp32 2018-03-20 11:16:49 -07:00
Shawn A d090dd3dd7 move menutokens 2018-03-20 13:14:50 -05:00
Chris Liebman 10d6deadc2 add esp32 2018-03-20 10:51:55 -07:00
Chris Liebman 19d578e04b add esp32 2018-03-20 10:43:22 -07:00
Shawn A 881f50fb7e fix compiler warnings 2018-03-20 12:35:01 -05:00
Shawn A 57fc15a20a fix section compile error 2018-03-20 12:31:49 -05:00
Shawn A 941865ec85 datatype fixes 2018-03-20 12:24:28 -05:00
Chris Liebman 6f84964894 fixing travis 2018-03-20 10:16:08 -07:00
Shawn A 88d2cfbff4 change varnames 2018-03-20 12:05:46 -05:00
Chris Liebman 839a421ff1 travis testing 2018-03-20 10:03:54 -07:00
Shawn A 7a57a1395d change setmenu to take vector or array of strnig tokens 2018-03-20 12:00:59 -05:00
Chris Liebman 31d53b18be travis testing 2018-03-20 09:58:34 -07:00
Shawn A 8d4f745abf Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-03-19 12:47:57 -05:00
Shawn A e970686064 fix debug blank 2018-03-19 12:47:56 -05:00
David Gauchard 159674bbba allow user loop while in AP mode 2018-03-17 19:05:11 +01:00
tablatronix 7ad6470adf oops 2018-03-17 10:45:48 -05:00
tablatronix de85162267 add bug workaround for esp8266 softap 2018-03-17 10:11:03 -05:00
tablatronix 8ddc86f470 adds handleClose 2018-03-17 10:10:46 -05:00
Shawn A c9e82ae920 menuids as vector to deal with size
This kind of makes it a pain in the ass for users, not sure how to make this easier, I can take in an array of string ids, with a count arg, makes it easier, but then users can pass nonsense in, this way its enum ids, but damn it sure is convoluted. Welcome to ideas here...

```c++
  std::vector<WiFiManager::menu_page_t> menu = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE,wm.MENU_SEP,wm.MENU_ERASE,wm.MENU_EXIT};
  wm.setMenu(menu);
```
2018-03-16 15:55:53 -05:00
Shawn A 0741dbde2e debug remove 2018-03-16 14:19:16 -05:00
Shawn A e3b7dc2641 kludge setmenu with size so it works
Prboably going to add a vector for this, I do not want to add the overhead of std::array for something optional
2018-03-16 14:18:48 -05:00
Shawn A d07f73263a showinfoerase toggle 2018-03-16 14:17:58 -05:00
Shawn A f60a1d1b06 adds section hrs 2018-03-16 10:56:28 -05:00
Shawn A 424f48f0a8 add setShowDnsFields, adds edge case force hide ip fields 2018-03-16 10:56:12 -05:00
Shawn A 03a40915ee minor layout fix to config 2018-03-15 16:34:37 -05:00
Shawn A b7d230cc40 remove testing 2018-03-15 16:15:38 -05:00
Shawn A 8cbd0fa54e oops 2018-03-15 16:08:48 -05:00
Shawn A 0749e1bdd7 Update README.md 2018-03-15 16:05:02 -05:00
Shawn A 655db109c1 comments 2018-03-15 15:51:47 -05:00
Shawn A 109dfa5c58 Merge pull request #561 from tzapu/pr560
Added Custom DNS, fix newlines
2018-03-15 15:41:07 -05:00
Shawn A 3cc1fabae7 fix tabs 2018-03-15 15:40:34 -05:00
Deb 81045e6433 Added Custom DNS, fix newlines 2018-03-15 15:29:34 -05:00
Shawn A 84752d8027 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-03-15 13:50:18 -05:00
Shawn A 36840fc712 add WM_RTC def for rtc.h 2018-03-15 13:50:17 -05:00
Shawn A 3378a4a846 Update README.md 2018-03-15 10:37:59 -05:00
Shawn A 21f1016d89 add esp shields 2018-03-15 10:36:26 -05:00
Shawn A 4f86945d7e Update ISSUE_TEMPLATE.md 2018-03-15 07:44:26 -05:00
Shawn A 278c320e22 added debug levels 2018-03-14 17:00:46 -05:00
Shawn A 29edaed0e7 fixes #555 oops 2018-03-14 12:59:51 -05:00
Shawn A 32e51ea37b notes 2018-03-14 12:52:50 -05:00
Shawn A 9346cee76c fix autoreconnect on auth failure 2018-03-14 10:46:08 -05:00
Shawn A 19d6101a1b fix up connection result for ondemand portal 2018-03-14 10:45:50 -05:00
Shawn A 68201cd965 remove serial.prints 2018-03-14 10:06:44 -05:00
tablatronix 1fade32d66 disable ssid input autoformatting
autocorrect='off' autocapitalize='none'
2018-03-08 22:36:14 -06:00
Shawn A 158dac1e68 fixes #551 2018-03-08 14:06:39 -06:00
Shawn A 721bb417bf remove debug 2018-03-07 15:41:47 -06:00
Shawn A 0c5e005866 fix customhtml parameters 2018-03-07 15:40:21 -06:00
Shawn A 0a1bd9f934 init params as null
I started gettting odd exceptions, so I thought this should be null and not on the stack or pointing to garbage. I might be totally in the wrong here.
2018-03-07 13:59:50 -06:00
Shawn A 5e487d6edc remove preallocation of params memory 2018-03-06 16:42:54 -06:00
Shawn A 1f9a13a42e oops fix constructor again 2018-03-06 16:14:13 -06:00
Shawn A 3796af5930 move routes to strings 2018-03-06 16:07:29 -06:00
Shawn A 8af108262c fix constructor 2018-03-06 16:07:18 -06:00
tablatronix b63e8b575b fixup #548 2018-03-05 22:01:47 -06:00
tablatronix a17fabd7fe Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-03-05 20:12:49 -06:00
tablatronix 5a34002d5d fix savecallback #543 2018-03-05 20:12:47 -06:00
Shawn A 6295d128aa adds opt erase flag 2018-03-05 16:35:26 -06:00
Shawn A 724447a654 oops 2018-03-05 16:26:59 -06:00
Shawn A 9f6cc23beb adds nvs erase
// #define WM_ERASE_NVS // esp32 erase() will erase NVS
2018-03-05 16:17:49 -06:00
Shawn A 6e1b2ed32c remove dnsserver from readme 2018-03-05 14:04:41 -06:00
Shawn A 8a17ef9c03 add debugging 2018-03-05 14:03:33 -06:00
Shawn A 3de9a34e3b Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-03-05 12:58:33 -06:00
Shawn A 4db3eca51e adds erase 2018-03-05 12:58:30 -06:00
tablatronix ca5609d8e6 oops #546 2018-03-03 10:42:25 -06:00
tablatronix 53df6ac612 #546 fix?
Since I do not know how to fix the delegated constructors properly, this should fix the issue for now
2018-03-03 10:33:04 -06:00
Shawn A 108af72d5f Update ISSUE_TEMPLATE.md 2018-03-02 12:42:20 -06:00
Shawn A 5ae132a7e9 #542 handler 2018-03-01 13:19:40 -06:00
Shawn A 5a6a365f0a Update CONTRIBUTING.md 2018-02-26 22:11:43 -06:00
Shawn A 92debb4bf8 comments 2018-02-24 10:45:58 -06:00
Shawn A ea9134afd2 fix webserver pointer 2018-02-24 09:13:20 -06:00
Shawn A bce3607504 add preloadscan enable 2018-02-24 08:54:40 -06:00
Shawn A 051966c856 fix order 2018-02-24 08:41:25 -06:00
Shawn A d0ed01433d add wifiscan preloading with cache
This uses core scan object and assumes its lifetime, I am not sure what the scope is or how long it lives, will have to convert to local copy if its being lost, caching for 60s after startweb portal and 10s after root load, refresh bypasses cache
2018-02-24 08:40:01 -06:00
Shawn A 7b4fd38b6b fix menuids 2018-02-24 07:51:07 -06:00
Shawn A 58d23513a1 comments 2018-02-23 23:57:12 -06:00
Shawn A 39da3e6d6c simplify debug 2018-02-23 23:49:23 -06:00
Shawn A 6749122eed change defs 2018-02-23 23:44:36 -06:00
Shawn A f210000c94 adds mdns support 2018-02-23 23:28:19 -06:00
Shawn A 327db84d18 fix resetsettings 2018-02-23 13:14:55 -06:00
Shawn A ff636abea8 fix menu and param save 2018-02-23 12:38:34 -06:00
Shawn A 951b39b088 fix param crash 2018-02-23 11:19:19 -06:00
Shawn A 6ba4a2523c fix up menus 2018-02-23 10:02:09 -06:00
Shawn A dfd48c2c81 add param help 2018-02-22 13:04:55 -06:00
Shawn A 3eb8d39565 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-02-22 08:54:17 -06:00
Shawn A ae95ca2c7b fix template 2018-02-22 08:54:12 -06:00
Shawn A edbaf5acdd finish up menu customization 2018-02-21 20:52:24 -06:00
Shawn A 7c4963fac2 fix bug 2018-02-21 20:12:54 -06:00
Shawn A c2bdbfafb9 adding menu control, in progress 2018-02-21 17:11:57 -06:00
Shawn A 4e57d74e87 fix some minor warnings 2018-02-21 10:52:55 -06:00
Shawn A 5e27194204 Merge branch 'master' into development 2018-02-21 08:41:22 -06:00
Shawn A b516085a3d Merge pull request #536 from d-a-v/warn
remove warning
2018-02-21 08:35:22 -06:00
David Gauchard f333f271e4 remove warning 2018-02-21 12:10:19 +01:00
Shawn A 35bf4a94bd change webserver pointer to using 2018-02-20 12:59:37 -06:00
Shawn A e01101eff1 #534 2018-02-20 11:54:14 -06:00
Shawn A 39f20a6adc #528 WL_DISCONNECTED support for testing 2018-02-20 11:13:46 -06:00
Shawn A 3d7074166c #528
using a static var for esp32 event for now to get this working and test. Probably not the best, not sure what the best option is here for esp32 onevent static member function callbacks
2018-02-20 08:49:54 -06:00
Shawn A 415f98d9fb debuggin esp32 auth fail events 2018-02-19 21:32:17 -06:00
Shawn A e5edf536a5 template update 2018-02-19 14:03:52 -06:00
Shawn A f9a8f5bdab allow empty ssids, bail earlier 2018-02-19 13:32:12 -06:00
Shawn A 64075bc7f9 feature #533 failure details 2018-02-19 13:31:43 -06:00
Shawn A 9eec7f97dd change some uneeded ints 2018-02-19 10:46:55 -06:00
Shawn A 0c6d4df7a7 remove debugging 2018-02-19 10:33:19 -06:00
Shawn A aaad9ca4c3 add result checking #527 2018-02-19 10:32:34 -06:00
Shawn A 7a5a72eed4 remove debugging 2018-02-19 10:12:25 -06:00
Shawn A 89cfdfc67f clean up 2018-02-19 10:04:40 -06:00
Shawn A 374e9f515f stability #527 2018-02-19 09:52:52 -06:00
Shawn A 9d16a68665 doc blocks, reformatting code 2018-02-19 08:37:12 -06:00
Shawn A ea994d5ccd adds getWiFiIsSaved() 2018-02-19 08:21:22 -06:00
Shawn A 97398d7ce2 fix #527 for esp8266 2018-02-18 20:23:04 -06:00
Shawn A 9f4156437b fixes #527 2018-02-18 20:15:55 -06:00
Shawn A cb7cbec1f8 testing #527 2018-02-18 12:27:20 -06:00
Shawn A f3db838ae1 fix info page and adds esp32 aphostname 2018-02-18 10:39:35 -06:00
Shawn A 1d6a7275e7 gitignore
no gitignore? add more stuff
2018-02-18 10:24:03 -06:00
Shawn A 1ee8f5a1a9 #528 adds getLastConxResult 2018-02-18 09:43:52 -06:00
Shawn A 076a355098 Merge pull request #515 from horendus/patch-1
Move more strings to FLASH to free up RAM
2018-02-15 18:15:28 -06:00
Shawn A 14c5169ac9 bugged 2018-02-15 16:59:16 -06:00
Shawn A b09cc31416 oops broke lock icons 2018-02-15 13:11:36 -06:00
Shawn A 41b4717148 more strings progmem 2018-02-15 12:23:20 -06:00
Shawn A d8d26b26c2 change wifiscan detaisl to css for toggling 2018-02-15 10:44:19 -06:00
Shawn A 98c78a2929 documenting source 2018-02-15 09:57:51 -06:00
Shawn A d86351dff4 Update ISSUE_TEMPLATE.md 2018-02-15 09:04:21 -06:00
Shawn A e9cf051cb2 Update ISSUE_TEMPLATE.md 2018-02-15 09:03:50 -06:00
Shawn A 08ae001a83 missed one file header 2018-02-15 08:37:14 -06:00
Shawn A b49849f8c0 file headers 2018-02-15 08:36:21 -06:00
Shawn A 603f2b5631 Merge pull request #490 from tzapu/esp32
Esp32 preliminary support
2018-02-15 08:06:47 -06:00
Shawn A 55b336e6d8 Merge branch 'development' into esp32 2018-02-15 07:49:24 -06:00
Shawn A 625c8e2f9e Merge branch 'esp32' of https://github.com/tzapu/WiFiManager into esp32 2018-02-15 07:48:15 -06:00
Shawn A 26ba373009 move authmode to progmem 2018-02-15 07:48:13 -06:00
Shawn A 8c1e070582 strings 2018-02-14 23:14:01 -06:00
Shawn A 3e66273c3e esp32 strings progmem 2018-02-14 23:08:59 -06:00
Shawn A 9da297f405 moved _wifissidprefix to progmem 2018-02-14 23:03:14 -06:00
Shawn A 18cb6af0e4 dup define 2018-02-14 22:43:55 -06:00
Shawn A a6dc373f5c typo 2018-02-14 22:41:06 -06:00
Shawn A 25b880cf9b comments 2018-02-14 22:39:56 -06:00
Shawn A 5730ce351a left in debug 2018-02-14 22:36:36 -06:00
Shawn A 62f5ce6e0c more string cleanup 2018-02-14 16:42:10 -06:00
Shawn A 91383f9bc1 refix memsketch 2018-02-14 16:03:09 -06:00
Shawn A ca3a726e88 Merge branch 'development' into esp32
Merge branch 'development' into esp32

# Conflicts:
#	WiFiManager.cpp
#	WiFiManager.h
#	strings_en.h
2018-02-14 15:55:29 -06:00
Shawn A 43a035091e more strings cleanup 2018-02-14 14:11:19 -06:00
Shawn A d98a59cca3 editing strings 2018-02-14 14:09:55 -06:00
Shawn A a247a5ecb4 fix sketch size 2018-02-14 14:09:39 -06:00
Shawn A c43551f85a some more strings in progmem 2018-02-14 13:24:00 -06:00
Shawn A cbb32fdd61 cleanup 2018-02-14 12:53:52 -06:00
Shawn A bc4c07f315 defaulting to icons 2018-02-14 12:50:05 -06:00
Shawn A 369b627b3b oops 2018-02-14 12:43:30 -06:00
Shawn A 089c487576 adds toggle for scan quality as percentage
`setScanDispPerc` until we have decent remplating
2018-02-14 12:42:21 -06:00
Shawn A ba3a2c8451 moved all tokens to strings.h 2018-02-14 12:41:38 -06:00
Shawn A 8e7663b52b ugh aliases 2018-02-14 11:13:28 -06:00
Shawn A 78f7de38ad publicized debug helpers 2018-02-14 10:54:04 -06:00
Shawn A 3d3518a10a adds disconnect method for users
non persistent disconnect
2018-02-14 10:50:57 -06:00
Shawn A e342fd9b71 refactor ip form outputs 2018-02-14 10:33:28 -06:00
Shawn A addb045a0c moved strings to flash 2018-02-14 09:36:09 -06:00
Shawn A bab1201dcb fix esp32 esp8266 bug 2018-02-13 11:40:19 -06:00
Shawn A 611246bd75 rename 2018-02-13 07:55:41 -06:00
Shawn A 3dcf3c0927 rename 2018-02-13 07:55:32 -06:00
Shawn A 7f2fdee9c8 Create ISSUE_TEMPLATE.md 2018-02-13 07:42:23 -06:00
Shawn A 1c890c0c49 Create contributing.md 2018-02-13 07:40:55 -06:00
Jasper 5243036dbf Update WiFiManager.cpp 2018-02-13 20:00:17 +08:00
Jasper a94d897ee4 Update WiFiManager.cpp 2018-02-13 19:52:38 +08:00
Jasper aa734eb606 Update WiFiManager.cpp 2018-02-13 17:18:26 +08:00
Jasper a863167b23 Lower RAM usage of library
Place remaining debug messages into Flash using F().
2018-02-13 11:16:37 +08:00
Shawn A 79eb0fee47 Merge branch 'development' of https://github.com/tzapu/WiFiManager into development 2018-02-12 19:23:52 -06:00
Shawn A 3e10f984e1 template 2018-02-12 19:23:51 -06:00
Shawn A 17410d38c2 readme 2018-02-12 13:46:03 -06:00
Shawn A 1f7dc79b20 added webserver precompiler warning
updates readme
2018-02-12 13:03:13 -06:00
Shawn A 95b48454e8 Merge branch 'development' into esp32 2018-02-12 12:31:31 -06:00
Shawn A 4424e66222 infohelp align html 2018-02-12 12:31:16 -06:00
Shawn A 75d007d1c8 Merge branch 'development' into esp32 2018-02-12 11:05:12 -06:00
Shawn A 46929e0ee6 change uptime 2018-02-12 10:59:50 -06:00
Shawn A 8e28011f13 fix some html bugs 2018-02-12 10:57:59 -06:00
Shawn A 617e52cb84 implemented info strings for esp32 2018-02-12 10:54:51 -06:00
Shawn A 2c735ab999 Merge branch 'development' into esp32
Merge branch 'development' into esp32

# Conflicts:
#	README.md
#	WiFiManager.cpp
#	WiFiManager.h
#	examples/OnDemandConfigPortal/OnDemandConfigPortal.ino
2018-02-12 08:47:28 -06:00
Shawn A fc4942db6e all tokens now in strings 2018-02-09 12:35:43 -06:00
Shawn A 3914fee227 converting token strings, in progress broken 2018-02-08 17:05:35 -06:00
Shawn A ffc85a81fe remove reset, no reason for it 2018-02-08 13:18:08 -06:00
Shawn A 1c4011bfb4 adds webclient checking for timeout delay 2018-02-08 12:31:31 -06:00
Shawn A 57ef33a7fc readme 2018-02-08 11:00:54 -06:00
Shawn A 9a76b3d94d camelcase _staShowStaticFields 2018-02-08 09:36:50 -06:00
Shawn A 0af804a2f1 Merge branch 'master' into esp32 2018-02-07 10:13:11 -06:00
Shawn A 4d715890f6 Update README.md
Esp32 warning
2018-02-06 19:16:41 -06:00
Shawn A f5fa886c93 Merge branch 'master' into development 2018-02-06 11:28:51 -06:00
Shawn A e49335d811 Merge pull request #505 from Loufylouf/master
Bug fix for problem discovered when setting length to 1 for additiona…
2018-02-06 11:25:27 -06:00
Shawn A 8e07025e38 fix esp32 wifi.ssid 2018-02-06 10:19:52 -06:00
Shawn A 7cc86e57be fix esp32 examples 2018-02-06 09:50:33 -06:00
Shawn A b22686c8a1 make debug funcs public 2018-02-06 09:50:03 -06:00
Shawn A 2b9ddea331 debugsoftapconfig for esp32 2018-02-06 09:49:49 -06:00
Laurent Louf 6aaa83a266 Bug fix for problem discovered when setting length to 1 for additional parameters
The initialization of the buffer holding the value stopped before the last character and storage did not take into account the extra-byte for end of string.
2018-02-06 14:12:13 +01:00
Shawn A b1b34a3c97 ajax test 2018-02-02 14:38:40 -06:00
Shawn A 44c85a2315 fixup merge 2018-02-01 13:16:26 -06:00
Shawn A da66231e47 Merge branch 'development' into esp32 2018-02-01 11:45:20 -06:00
Shawn A 2e08e7de32 #454 adds WIFI_MANAGER_OVERRIDE_STRINGS
I dont feel like resolving conflicts
2018-02-01 10:05:39 -06:00
Shawn A ebdfa063a7 Merge branch 'master' into development 2018-02-01 09:41:42 -06:00
Shawn A a3a04f1f9a Merge pull request #487 from mtiutiu/master
make WIFI_MANAGER_MAX_PARAMS customizable
2018-02-01 09:40:40 -06:00
Shawn A cfb0d2bc5f doh... 2018-02-01 08:51:08 -06:00
Shawn A e8d1ea17cb fix paramscount, oops 2018-02-01 08:04:34 -06:00
Shawn A 0d5ebde9af more string tokens 2018-01-31 16:44:58 -06:00
Shawn A 6894c89441 moved all html strings out of code 2018-01-31 16:37:53 -06:00
Shawn A b0c61688d6 cleanup 2018-01-31 14:07:38 -06:00
Shawn A 68762e1741 typo 2018-01-31 14:03:33 -06:00
Shawn A a21f8cbc39 moved http strings to include, added token flags 2018-01-31 13:54:54 -06:00
Shawn A 19d533b7d5 adds exit to readme 2018-01-31 13:07:34 -06:00
Shawn A ccfddefaa1 oops 2018-01-31 12:57:49 -06:00
Shawn A 95253e834d Merge branch 'master' into development 2018-01-31 12:50:24 -06:00
Shawn A 53a27f154e Merge pull request #467 from lukepalmer/master
Document that parameter id cannot contain spaces
2018-01-31 12:50:04 -06:00
Shawn A 53c8addfdc debugging clean 2018-01-31 12:48:11 -06:00
Shawn A e5c263c414 fixes paramid issues
paramid must be alphanumeric and adds {I} token support to use ids as input names if we make that optional.
2018-01-31 12:23:25 -06:00
Shawn A e015efe8d0 fixup debugging 2018-01-31 09:30:46 -06:00
Shawn A 5f78d38f46 fix up parameters 2018-01-31 09:30:37 -06:00
Shawn A fa04972cb1 fix tabs 2018-01-30 14:07:21 -06:00
Shawn A 8697cab0ae clean up .h file 2018-01-30 14:02:01 -06:00
Shawn A c8d89db529 oops 2018-01-30 14:00:39 -06:00
Shawn A ff973e1639 clean up parameters 2018-01-30 13:47:13 -06:00
Shawn A d61d9a67b1 Merge branch 'master' into development
conflicts resolved
2018-01-30 13:31:47 -06:00
Shawn A a4795b77f7 Merge pull request #374 from liebman/allocate-params-array
use malloc/free for WiFiManagerParameter* array instead of hard coding.
2018-01-30 12:29:30 -06:00
Shawn A 46a9431475 Merge branch 'master' into development 2018-01-30 12:10:13 -06:00
Shawn A a832af02ca Merge pull request #468 from liebman/param-value-memory-leak
WiFiManagerParameter allocates but never frees __value!
2018-01-30 12:08:31 -06:00
Shawn A d4540f1197 update library.properties 2018-01-29 14:09:18 -06:00
Shawn A d1639e228a update library.json
I thnk think this is correct
2018-01-29 14:05:59 -06:00
Shawn A fdfaecce8a Fix examples 2018-01-29 13:13:14 -06:00
Shawn A 380a63d519 attempt resetsettings fix 2018-01-29 11:36:10 -06:00
Shawn A 7e1455778d adds esp debugplatforminfo 2018-01-28 09:58:52 -06:00
Shawn A 00fb96aa29 Merge branch 'development' into esp32 2018-01-28 09:57:44 -06:00
Shawn A 7fb35a9540 adds debug platform info 2018-01-28 09:57:20 -06:00
Shawn A cb02e72123 fix esp8366 bug 2018-01-27 14:31:28 -06:00
Shawn A 85317530e8 fix esp8266 bug WEBSERVERSHIM 2018-01-27 14:28:07 -06:00
Shawn A e55741f201 Merge branch 'development' into esp32 2018-01-27 11:45:49 -06:00
Shawn A 8595ea5d2c oops 2018-01-27 11:45:38 -06:00
Shawn A 9a3f501a24 Merge branch 'development' into esp32 2018-01-27 11:42:02 -06:00
Shawn A 3b6d5f790a replace esp.reset with restart 2018-01-27 11:41:42 -06:00
Shawn A dbb091d1b7 fix info page 2018-01-27 11:40:05 -06:00
Shawn A 867eb4e689 oops 2018-01-27 08:49:55 -06:00
Shawn A 42cd1aeb8d fix for erase config when STA disabled 2018-01-27 08:31:17 -06:00
Shawn A a3678c6c22 millis typo 2018-01-27 08:19:54 -06:00
Shawn A 0fb86c3d8c fix deprecated warnings 2018-01-25 21:22:02 -06:00
Shawn A 4db69a3790 rework def WEBSERVERSHIM
testing libraries with esp8266 name or webserver
2018-01-25 16:05:55 -06:00
Shawn A 2761656d78 change wifi_ssid ret to string, fix info 2018-01-25 13:58:39 -06:00
Shawn A e56d22cfb1 fix esp32 enablesta toggle 2018-01-25 13:47:00 -06:00
Shawn A c13c076b46 quiet timeout logging 2018-01-25 13:09:19 -06:00
Shawn A f820dc78be fix esp32 SSID tokens 2018-01-25 13:08:56 -06:00
Shawn A af507d798e add bbx10 to authors 2018-01-25 12:48:09 -06:00
Shawn A a52740ecff fix esp32 erase flash 2018-01-24 21:24:21 -06:00
Shawn A 1f691ae35c typo 2018-01-24 17:08:24 -06:00
Shawn A 65c06c6e2b esp32 auto ssid 2018-01-24 16:09:30 -06:00
Shawn A 3777fcc846 esp32 about page 2018-01-24 16:09:17 -06:00
Shawn A de2deb8e69 oops 2018-01-24 15:24:05 -06:00
Shawn A 7189e36c59 clean up defines, remove esp31b 2018-01-24 13:54:58 -06:00
Shawn A 8dbe045655 remove system_event_info_t arg 2018-01-24 13:36:34 -06:00
Shawn A ead2b7353c enable autoreconnect 2018-01-24 13:16:06 -06:00
Shawn A ceaf53f604 adds esp32 autoreconnector
Using static event cb for now, feel free to improve, this functionality should be fixed in core soon
2018-01-24 13:13:25 -06:00
Shawn A e5879b2101 fix esp32 autoconnect 2018-01-24 11:05:28 -06:00
Shawn A 2a50d797a0 fix esp32 softap numclients 2018-01-24 08:50:24 -06:00
Shawn A 2af1c62bd1 redo esp32 disconnect 2018-01-24 08:27:56 -06:00
Shawn A f3be7c7c0b it compiles 2018-01-23 14:07:33 -06:00
Shawn A 90024b8603 adding def blocks, nonworking
adding conditionals for all module types, there has been requests for other module support in addition to esp32, so I ma just gonna go ahead and avoid else fallbacks for now. Not working yet.
2018-01-23 13:28:49 -06:00
Shawn A d883ce8ae1 Merge pull request #489 from tablatronix/development
added some esp abstraction to make ports easier
2018-01-23 11:41:34 -06:00
Shawn A 8364a6a85d added some esp abstraction to make ports easier 2018-01-23 11:39:12 -06:00
Tiutiu Marius Cristian 8c906af563 make WIFI_MANAGER_MAX_PARAMS customizable 2018-01-22 12:42:23 +02:00
Shawn A 5aafb89a3f Merge pull request #313 from tablatronix/development
Development and cleanup
2018-01-17 10:54:37 -06:00
Shawn A b266cd5934 fix open tag on info 2018-01-10 10:52:36 -06:00
Shawn A 1a61362f74 typo 2018-01-10 10:05:07 -06:00
Shawn A 7625680daf adds test of setCaptivePortalEnable to example 2018-01-10 10:04:26 -06:00
Shawn A d7976381e6 fix setCaptivePortalEnable 2018-01-10 10:02:46 -06:00
Christopher Liebman 5c6252fe45 should use delete[] not delete 2017-12-09 08:37:35 -08:00
Christopher Liebman a5ff5cb9e4 Add WiFiManagerParameter destructor to free new'd _value, it was allocated but never free'd 2017-12-09 06:24:15 -08:00
Christopher Liebman d66cd47df8 use realloc() when increasing the size of _params. addParameter() now returns bool
indicating the status of adding the parameter where false indicates it failed to
increase the size of _params and did not add the parameter.
2017-12-09 06:04:07 -08:00
Luke Palmer eb560629d6 Document parameters 2017-12-04 19:54:59 -05:00
Shawn A 0897c5800c update examples w setConfigPortalTimeout 2017-11-28 17:01:27 -06:00
Shawn A 648274ab3d oops left wrap test in 2017-11-21 12:51:43 -06:00
Shawn A 2f4015e797 fix token replace invalid html 2017-11-21 12:24:25 -06:00
Shawn A a702fa6c75 html validation fizes 2017-11-21 11:53:30 -06:00
Shawn A 9a571226cd Added some info panel changes
adds connect info to root info and wifi, minimal wordyness
2017-11-16 14:06:36 -06:00
Shawn A fa05d2c574 fix for configportal on wifisave fail
disocnnect STA on save failures
move reset out of configportal loop
2017-11-16 11:59:22 -06:00
Shawn A 0ae9ca3d55 adds _debugport stream ref
pass stream reference via constructor to use for _debugPort in DEBUG_WM, if someone needs dynamic we can add pointer setter, but seems overkill
2017-11-16 10:02:03 -06:00
Shawn A d6aec20bc3 add debug 2 argument function 2017-11-15 16:14:52 -06:00
Shawn A 3fdf53bf06 adding debug for configportalhastimeout 2017-11-15 11:41:47 -06:00
Shawn A a1050d014f fix some returns 2017-11-03 16:41:17 -05:00
Shawn A 52d5427654 testing erase config polyfill
this is getting rediculous, dev on 2_3_0 has to stop there are so many bugs.
2017-11-01 06:39:30 -05:00
Shawn A e8c0b52470 added ease, stabilize persistent modes, rename some functions 2017-10-28 21:38:13 -05:00
Shawn A 4763783fe1 rename some functions 2017-10-28 11:51:26 -05:00
Shawn A ad6b8bdc86 add local enableSTA for toggling 2017-10-27 20:01:19 -05:00
Shawn A d09aff2f6d fixing some reliability issues, testing 2017-10-27 17:19:43 -05:00
Chris Liebman 0b6341bea4 cleanup readme (removed hint about alternate constructor) 2017-10-26 16:10:34 -07:00
Chris Liebman 6465d72f6e Refactored to use only a default constructor and automatically resize the parameter array each time the size limit is reached.
I used the initial size (WIFI_MANAGER_MAX_PARAMS) as the increment when resizing.
Existing data is coppied to the new array and the old one is free'd.
2017-10-26 15:23:47 -07:00
Chris Liebman 33704176e0 Merge remote-tracking branch 'upstream/master' into allocate-params-array 2017-10-25 18:59:23 -07:00
Shawn A df5857464a adds verbose connection status enum strings 2017-10-18 11:00:02 -05:00
Shawn A eb434a0187 clean up handlexit feature 2017-10-18 09:37:21 -05:00
Shawn A d7e3c8d005 Merge pull request #5 from mrbig/development
uninitialized abort caused immediate exit
2017-10-18 09:02:01 -05:00
Shawn A 3d2453acc5 html for exit 2017-10-18 08:59:35 -05:00
Nagy Attila Gabor 342eacfe37 autoConnect did not return true on successfull connection
This seems like a simple typo to me
2017-10-17 00:20:19 +02:00
Nagy Attila Gabor cf51018512 uninitialized abort caused immediate exit
In some cases this caused the config portal to exit right after
start
2017-10-16 23:16:03 +02:00
Shawn A db2a1336e9 adds exit functionality to shutdown configportal/webportal 2017-09-25 14:11:36 -05:00
Shawn A b151c19b3c add ondemandwebportal example 2017-09-18 12:58:31 -05:00
Shawn A 2aef1344b4 use ip as title if not in captiveportal 2017-09-18 10:19:38 -05:00
Shawn A 4592914fad test ondemand webportal 2017-09-18 08:42:09 -05:00
Shawn A 8e710b9d92 disable ios safari tel links
some numbers might auto link as telephone numbers, this disables it.
2017-09-16 11:07:57 -05:00
Shawn A eee3fb72b2 #418 even more info 2017-09-16 11:02:37 -05:00
Shawn A 12de39135d comments 2017-09-16 10:46:44 -05:00
Shawn A 80470fb553 addd token precheck flags
This helps skip token replacements that are not even used, replace is slow, this is an optimization mostly for large sets of params or aps.
2017-09-16 10:39:51 -05:00
Shawn A 31ab2b67d0 ability to disable captiveportal
Sometimes the redirect to captive portal is unwanted or a nuisance, eg wehn using as a webserver etc.
2017-09-14 17:09:17 -05:00
Shawn A 4d18bfb113 abstracted outputters 2017-09-14 16:34:16 -05:00
Shawn A 37dbd667f4 add staticfield setter 2017-09-14 15:38:42 -05:00
Shawn A e43a7d0b75 modify templates, remove placeholders
adds labels to all inputs, deprecates {p} placeholders, adds {t} to ttitles
2017-09-14 15:38:12 -05:00
Shawn A c6f7ac0012 added uptime to info
still subject to rollover
2017-09-14 10:26:51 -05:00
Shawn A 64798ebbf1 pimped out info pagee
We can simply this later, or make an option string to display specific things
2017-09-10 21:17:07 -05:00
Shawn A 985f8118dd style lists /info 2017-09-08 22:28:13 -05:00
Shawn A 69ddda0ee4 Merge remote-tracking branch 'remotes/tzapu/development' into tzapu/development
removed autoconnect params, still testing valeus are always empty
2017-09-08 17:08:18 -05:00
Shawn A f59c150729 Merge pull request #365 from vyruz1986/master
Allow showing static IP config without predefined value
2017-09-08 16:19:15 -05:00
Shawn A 14ce25081a Merge remote-tracking branch 'remotes/tzapu/development' into tzapu/development 2017-09-08 16:15:20 -05:00
Shawn A 81b37dfffc adds some style, clean up css, adds new tokens
#415
2017-09-08 16:08:35 -05:00
Shawn A 1f4a8fe499 Merge pull request #251 from ayomawdb/development
Adding WiFiManagerParameter implementation with labelPlacement parameter
2017-09-08 15:54:46 -05:00
Germán Martín 7b9804d5a2 Merge branch 'master' into resetConfigCallback 2017-09-04 21:05:49 +02:00
Shawn A a93b601cd7 again 2017-08-31 13:57:23 -05:00
Shawn A 6525a0bd3d fixed comment wording 2017-08-31 13:57:11 -05:00
Shawn A 2c357d7e86 changing non form back to GET
for now #409
2017-08-31 10:21:21 -05:00
Shawn A 5f28843843 Cleaned some html csss 2017-08-30 14:01:37 -05:00
Shawn A 6e43c1eb41 change all forms to POST
#409
2017-08-30 10:24:04 -05:00
Shawn A 66c653ff94 convert to post 2017-08-30 10:00:48 -05:00
Shawn A 606a1c3128 removed escaped quotes 2017-08-30 10:00:29 -05:00
Shawn A 63dd714805 oops missed one pr#244 2017-08-30 09:22:40 -05:00
Shawn A 9160b5bd3b maxlength null string fix
pr#244
2017-08-30 09:15:36 -05:00
Shawn A 04a9dda74b testing mode and persistent presrvation
You should be able to have sta+softap mode with your own softap, and starting config portal will not overwrite your default softap, but i cannot find a way to reconnect other than rebooting the device
2017-08-29 16:31:59 -05:00
Shawn A d1ab6ec6db left in debug 2017-08-28 21:00:15 -05:00
Shawn A b62f488b6b Merge remote-tracking branch 'origin/feature-icons' into development
adds feature icons
2017-08-28 19:18:20 -05:00
Shawn A 8185eaa002 add blocking setter
@todo add example
2017-08-27 11:04:05 -05:00
Shawn A 8592647cbf fraking tabs 2017-08-27 10:57:43 -05:00
Shawn A f2580463e4 fix const char corruptions
#400
 fixing non blocking, non blocking does not handle timeouts for the user
2017-08-27 10:55:26 -05:00
Shawn A c4563802f3 renable blocking 2017-08-27 09:32:31 -05:00
Shawn A 68e3eb5bc8 Merge branch 'master' into development 2017-08-27 09:13:00 -05:00
Shawn A cadf6b4a80 Merge remote-tracking branch 'upstream/master' 2017-08-27 09:05:52 -05:00
Shawn A 75f34d9b59 Merge remote-tracking branch 'tzapu/master' 2017-08-27 08:48:35 -05:00
Shawn A 47d9082e18 testing non blocking portal
calling process in loop not fast enough results in corrupt webpages, not sure why.
2017-08-27 00:11:04 -05:00
Shawn A 0aecffc822 fix configportal loop flow
removed returns for better flow
2017-08-26 23:26:48 -05:00
Shawn A 179c0309a5 comments, autoconnect fix
fix sta+ap mode preservaton in autoconnect
2017-08-26 23:13:37 -05:00
tzapu 89af31245b Merge pull request #398 from Derek123456/Derek123456-patch-1
Fix for issue https://github.com/tzapu/WiFiManager/issues/392
closes #392
thank you very much
2017-08-22 10:12:29 +03:00
Derek123456 68e32a10c0 Update WiFiManager.cpp
https://github.com/tzapu/WiFiManager/issues/392
Increased size of parLength to 5 so the custom parameter length variable can be up to 9999 long.
2017-08-22 10:32:52 +08:00
Derek123456 cee18a7ce3 Update WiFiManager.h
Changed <input ... length={l}>to <input ... maxlength={l}>
2017-08-22 10:30:53 +08:00
tzapu f9c4c87c61 Merge pull request #386 from denisvm/readme-wishlist
Improve wishlist in README
2017-07-13 09:39:40 +03:00
tzapu 06d75bf7b1 Update README.md 2017-07-13 09:39:28 +03:00
Dênis Volpato Martins 9637d9473e Improve wishlist in README 2017-07-12 22:07:33 -03:00
tzapu 0de9d12930 Merge pull request #363 from suculent/fix-content-length
fix for #362 - Setting Content-length explicitly - https://github.com…
2017-07-10 13:41:07 +03:00
tzapu eb4594c8e4 Merge pull request #383 from scop/spelling
Spelling fixes
thanks
2017-07-10 09:38:21 +03:00
Ville Skyttä 58eb7113e7 Spelling fixes 2017-07-09 17:11:31 +03:00
Chris Liebman 898768092c removed un-needed constructor declaration 2017-06-27 16:35:48 -07:00
Chris Liebman c4905c23b7 remove init function as its not needed with one constructor 2017-06-27 16:27:37 -07:00
Chris Liebman 3950a3b859 use single constructor with default value for size 2017-06-27 16:24:23 -07:00
Germán Martín 8f90e0f5d7 Add a callback when reset settings is triggered 2017-06-26 15:04:57 +02:00
vyruz1986 0fc051a445 Merge remote-tracking branch 'refs/remotes/tzapu/master' 2017-06-12 21:21:10 +02:00
tzapu 5e9248651f Merge pull request #334 from camelmasa/fix-broken-links
Fix broken link
2017-06-06 16:04:16 +03:00
Chris Liebman 362a561a35 use malloc/free for WiFiManagerParameter* array instead of hard coding.
add alternate constructor to specifiy max parameter count
origional default constructor uses old hard codded value
2017-06-04 06:41:27 -07:00
Alex Goris 136c0c9cba Also show static IP fields when static IP is passed
Regardless of the boolean, we should always show static IP fields if
actual static IP value is passed. This ensures backwards compatibility
2017-05-04 22:04:05 +02:00
Alex Goris 486ea7db2c Allow showing static IP config without predefined value
Previously a valid predefined static IP had to be passed before the
config page would show the IP, gateway and subnet fields. This did not
allow the config page to show 'optional' static IP fields.
Now a boolean can be passed to the autoConnect() function which will
specify whether the static IP fields should be shown or not.
When this boolean is true but no predefined values are passed and fields
are left blank in config page, wifiManager will revert to DHCP. This
allows user to choose between static IP or DHCP without changing code
2017-05-04 21:59:17 +02:00
Matěj Sychra ada93b721a fix for #362 - Setting Content-length explicitly - https://github.com/tzapu/WiFiManager/issues/362 2017-05-03 14:56:31 +02:00
camelmasa 29b2f02ae4 Fix broken links 2017-03-20 12:58:49 +09:00
Shawn A 004f222f40 do not wait for conx is no ssid 2017-02-10 17:05:07 -06:00
Shawn A 612e18be35 oops deleted a function 2017-02-10 15:40:31 -06:00
Shawn A 0b0eb6159c moving blocks 2017-02-10 15:29:32 -06:00
Shawn A 1a44dd53e6 move apcallback to proper location
This was actually being called before the ap was setup!
2017-02-10 15:21:48 -06:00
Shawn A 65349cb546 fix WL_IDLE_STATUS return values for compatibility
This might need better handling in future, since we only get back a bool
of wether or not we are connected, not if configportal was saved etc.
might be a problem.
2017-02-10 15:13:48 -06:00
Shawn A e9b36f9084 fix breakafterconfig 2017-02-10 15:05:45 -06:00
Shawn A bd9c3b31fb refactoring some larger functions
* broke large functions into smaller , to allow new features to be
hooked in easier
* added persistent test to constructor destructor
* testing turn off sta during portal , causes issues
2017-02-10 14:07:52 -06:00
Shawn A c819d46902 allow for empty password 2017-02-09 17:10:15 -06:00
Shawn A 2edd37eeb8 oops typo 2017-02-09 17:02:33 -06:00
Shawn A 45a325bd34 fix validippassword
abstracted ap password validation
passing a invalid password should be fatal , not fallback to null, but
could be an optional define
2017-02-09 16:57:34 -06:00
Shawn A 9c72bf98f7 cleaning up source, comments 2017-02-09 16:33:10 -06:00
Alex T 628307dbf7 Merge branch 'master' into development 2017-02-09 15:56:51 +02:00
Shawn A c8455f5cd0 Merge remote-tracking branch 'refs/remotes/tzapu/master' 2017-02-08 12:05:04 -06:00
Shawn A 7360be5f60 Merge remote-tracking branch 'refs/remotes/origin/feature_308_configportaltimeouts' 2017-02-08 12:03:32 -06:00
tzapu 3135bc5e89 Merge pull request #310 from tablatronix/feature_308_configportaltimeouts
Feature 308 configportaltimeouts
fixes #308 
thank you very much
2017-02-08 08:55:15 -08:00
Shawn A c810633ee3 reset configportal timeouts after ap disconnect
configportaltimeout now starts at configportalstart if no sta clients,
or after last client disconnects. Will never timeout if ap has sta
client! handle edge case in user code.
2017-02-08 10:34:41 -06:00
Shawn A 0ddb835072 feature #308
only timeout when ap has no client, do not timeout configportal when
user is connected.
2017-02-08 08:18:59 -06:00
Shawn A a8c13a7c96 Merge remote-tracking branch 'refs/remotes/tzapu/master' 2017-02-08 08:07:01 -06:00
Alex T 7a17c98828 Merge branch 'master' into development 2017-02-03 06:17:42 +02:00
tzapu 8ffb4cbfa9 Merge pull request #284 from robertoostenveld/master
use setAPStaticIPConfig instead  of (old?) setAPConfig in first example
2017-02-02 02:57:55 -08:00
tzapu 0cc4487e42 Merge pull request #297 from jorgecis/patch-1
Quotes are missing creating issues.
2017-02-02 02:57:16 -08:00
tzapu b696b2c29a Merge pull request #286 from vyruz1986/master
Don't add custom parameters if array size is exceeded
2017-02-02 02:56:56 -08:00
Jorge Cisneros bd0da6c7a6 Quotes are missing creating issues. 2017-01-16 22:48:09 -06:00
Alex Goris 1f500fddd1 Don't add custom parameters if array size is exceeded
array containing custom parameters is initialised at class
initialization time with a fixed value. When we later try to add more
parameters than the array allows we will now discard the offending
parameters and make a debug logging so the developer knows what's going
on.

Might be further improved as per this answer on StackOverflow:
http://stackoverflow.com/a/12271501
This would allow the array size to be specified at initialisation time,
and would give flexibility to the developer to decide how big the array
should be.

closes tzapu/WiFiManager#285
2017-01-08 23:31:53 +01:00
Robert Oostenveld a231ae5deb use setAPStaticIPConfig instead of (old?) setAPConfig in first example 2017-01-07 22:10:00 +01:00
Ayoma Wijethunga 5f8f1ce5e6 Adding WiFiManagerParameter implementation with labelPlacement parameter 2016-11-26 20:17:41 +05:30
tzapu 022b15d2c8 Merge pull request #250 from ivankravets/patch-5
Update platforms compatibility
Thank you very much
2016-11-22 12:51:52 +02:00
Ivan Kravets 2a0ac55f87 Update platforms compatibility 2016-11-22 12:50:55 +02:00
Alex T abedb61ca1 parameter label 2016-10-15 12:07:48 +03:00
tzapu fd15f986d3 Merge pull request #210 from TaaraLabs/patch-1
startConfigPortal() without any parameters

thank you very much
2016-10-15 08:04:13 +03:00
Alex T 60c22d672f Merge commit 'e0b8acb8dd8e419e378e71abed77fe926c2e5b54' 2016-09-08 13:08:09 +03:00
Alex T 1b261f2371 intial html template parser 2016-09-08 13:07:51 +03:00
TaaraLabs 31887ff36a startConfigPortal() without parameters 2016-08-06 12:45:22 +03:00
TaaraLabs c3d01d33e1 startConfigPortal() without any parameters
startConfigPortal() without any parameters uses auto generated name ESP + ChipID
2016-08-06 12:38:26 +03:00
tzapu e0b8acb8dd Merge pull request #188 from bakrus/patch-1
Fix to allow 5 digit 'mqtt_port'
2016-07-02 15:25:29 +03:00
bakrus 039702327e Fix to allow 5 digit 'mqtt_port'
'WiFiManagerParameter custom_mqtt_port' made consistent with declaration of 'mqtt_port'
2016-07-02 13:27:59 +02:00
Alex T fac1575c96 attempt codecov 2016-06-15 14:35:43 +03:00
tzapu 560d4113f9 Merge pull request #168 from gitgrimbo/staticip-example-improved-comments
Improve comments for AutoConnectWithStaticIP example
thank you very much
2016-05-24 08:32:28 +03:00
gitgrimbo c93cd80f58 Improve comments for AutoConnectWithStaticIP example 2016-05-11 08:21:23 +01:00
Alex T 04d47882a7 ver bump 2016-05-08 11:25:03 +03:00
Alex T 028bdeeb17 removed 204 header response https://github.com/tzapu/WiFiManager/issues/114 2016-05-08 10:14:11 +03:00
Alex T 44e828e77a reverted std::sort that caused problems with isnan and other none namespeced used function calls 2016-05-08 10:07:32 +03:00
Alex T 801ae82ef5 removed extraneous headers 2016-05-08 09:41:06 +03:00
Alex T a209509d98 0.11 readme and ver bump 2016-04-05 09:28:13 +03:00
Shawn A 74bccc04f7 adds better retina support
adds template and layer png master
2016-03-25 14:17:28 -05:00
Shawn A fd27cef1ae remove debug 2016-03-25 09:31:07 -05:00
Shawn A 6708ddf37b remove debug 2016-03-25 08:48:49 -05:00
Shawn A 83c271fed4 initial commit, signal meter and secure icons
Adds sprite based icons, added some accessibility support since this
uses background images.

Can use classes `left` or `right` on parent div to align on either side
of SSID, parent div `invert` css filters the icons to white.

base64 image string has been formatted for easy replacement
2016-03-25 08:19:47 -05:00
Shawn A 8a375ec340 Merge remote-tracking branch 'refs/remotes/tzapu/master' 2016-03-18 14:47:57 -05:00
Alex T f99156e29f added setter for removing duplicate APs 2016-03-16 20:42:47 +02:00
tzapu 413b76cd81 Merge pull request #124 from tablatronix/remove-duplicate-aps
Remove duplicate aps
2016-03-16 20:35:05 +02:00
Alex T d11c763bce update travis yml
another ci test

ci fix

ci attempt 6

stable package json

fixe prefs

fix lib folder

debug

alalalalaalal

try with 1.6.5

try with 1.6.7

verbose build

1.6.7 again

back to 1.6.5

escaped : in url

no save pref

no save pref, one line

and back to working 1.6.5

getting all examples built

added sh include

fix sh

added build

build examples

aded debug output

going insane

beautify

added lib ArduinoJson

try again

1.6.8

get arduino json from github

back to 1.6.5
2016-03-16 18:30:29 +02:00
Alex Tudorache f9cc4b641f added boards manager 2016-03-16 10:43:10 +02:00
Alex Tudorache 852d90beec travis ci 2016-03-16 10:21:53 +02:00
Shawn A 745c3a91fd typo, shrug 2016-03-09 16:13:16 -06:00
Shawn A 276795079e add remove duplicate ap feature fixes #26 2016-03-09 16:03:51 -06:00
Shawn A faf307c7bb Merge remote-tracking branch 'refs/remotes/tzapu/master' 2016-03-09 11:03:50 -06:00
Alex Tudorache 566bcbe063 attempt to fix not connecting issues and endless loops 2016-03-08 07:46:06 +02:00
Alex Tudorache b99487785d fix for auto connect racing issue 2016-03-05 17:47:12 +02:00
Alex Tudorache 0962d718ec Merge commit 'e6217a18fc694b0cd176177d69c500156c3dbacf'
# Conflicts:
#	WiFiManager.h
2016-03-05 17:42:33 +02:00
Alex Tudorache 7f11a5d144 added custom head element, like style/css 2016-03-04 15:01:12 +02:00
Alex Tudorache e6217a18fc added custom head element, like style/css 2016-03-04 15:00:49 +02:00
Alex Tudorache ae007befd0 Merge commit '33a5e5b3cb81e960e10d7ae8d4b3a2940d38660b' 2016-03-04 09:12:39 +02:00
Alex Tudorache 43d8d94dd2 Merge branch 'tablatronix-tablatronix-patch-jumptoform' 2016-03-03 13:46:33 +02:00
Alex Tudorache 53733447ae Merge branch 'tablatronix-patch-jumptoform' of git://github.com/tablatronix/WiFiManager into tablatronix-tablatronix-patch-jumptoform 2016-03-03 13:44:47 +02:00
Alex Tudorache 6f727ff2df new sort 2016-03-02 16:39:03 +02:00
Alex Tudorache 3660ccdda5 updated readme 2016-03-01 15:32:21 +02:00
Shawn A f775d9c22c changing to just #p for now 2016-02-26 16:42:00 -06:00
Shawn A 99031ce133 Jump to form for password entry
If you have a long list of APs, the password field gets focuses on click, but this happens below the fold, this jumps to the form so you can see it. Added id to form instead of jumping to the #p field because it makes the input too close to the top of page, a well known issue of anchor links.
2016-02-26 16:02:35 -06:00
Shawn A b306a5ca72 Merge pull request #2 from tzapu/master
merge in
2016-02-26 15:57:36 -06:00
Pablo Sanchez 33a5e5b3cb Added an option to the WiFiManagerParameter so that a parameter can be read-only. This is done in a way that does not break an existing
program by having a constructor for either way. If a "1" is added to the end of the parameter list then the field becomes readonly.
The HTML will add the "readonly" option.
2016-02-18 23:29:00 -05:00
Alex Tudorache 2582dd8735 version 0.10
ordered networks based on signal quality
2016-02-16 18:24:12 +02:00
Alex Tudorache f82141c98c changed styling 2016-02-16 14:46:18 +02:00
Alex Tudorache 9cde9a8170 added a new version of wait for connect result
added setConnectTimeout
renamed setTimeout to setConfigPortalTimeout
2016-02-16 11:17:34 +02:00
Alex Tudorache 3f617c7455 fixed all pages so they don t return unknown content length, much faster now 2016-02-14 15:46:01 +02:00
Alex Tudorache 6f0c16d74f added flash chip real size to info page 2016-02-14 15:04:20 +02:00
Alex Tudorache 7b23c89204 fixed library manager name 2016-02-09 08:58:35 +02:00
Alex Tudorache 55c751c133 removed some warnings 2016-02-07 12:51:32 +02:00
Alex Tudorache 0f75d745fe 0.9 fixed encoding problems 2016-02-04 14:38:48 +02:00
Alex Tudorache ba1aa5496d added more examples,
updated readme
made it compile on older versions
2016-02-01 12:34:29 +02:00
Alex Tudorache 6217ef8e6a bump ver 2016-01-29 08:48:27 +02:00
Alex Tudorache 6e65f39895 added rescan option
added reset option
added info page
precomposed page for A LOT faster page sending
2016-01-25 10:51:25 +02:00
Alex Tudorache 031b7c97bc added ability of returning even if connection fails
added example that resets after configuration if connection is unsuccessful
2016-01-25 09:25:51 +02:00
Alex Tudorache bdc7da660a updated examples 2016-01-24 14:46:20 +02:00
Alex Tudorache f33cb4fb32 added feedback through LED blink example 2016-01-23 11:35:27 +02:00
Alex Tudorache c1038ea371 fixed check for gateway and subnet 2016-01-22 10:28:31 +02:00
tzapu 7b7a94bb51 Merge pull request #76 from ivankravets/patch-4
Update library.json
2016-01-19 17:25:45 +02:00
tzapu f840442549 Merge pull request #77 from ivankravets/patch-3
Delete typo file
2016-01-19 17:25:28 +02:00
Ivan Kravets 1208e03e61 Update library.json 2016-01-19 17:19:49 +02:00
Ivan Kravets 62c621f783 Delete typo file
Sorry, it was my typo. The file should be named as `library.json`
2016-01-19 17:19:27 +02:00
tzapu f83a482fb3 Merge pull request #74 from ivankravets/patch-1
@PlatformIO Library Registry manifest file
hi guys, 
thanks for this, need to get on the bandwagon 
:d
cheers
alex
2016-01-19 17:12:57 +02:00
Ivan Kravets 5691eb1604 @PlatformIO Library Registry manifest file
* This library in Web Registry: http://platformio.org/#!/lib/show/566/WifiManager
* Specification: [library.json](http://docs.platformio.org/en/latest/librarymanager/config.html)
* Library Manager:  http://docs.platformio.org/en/latest/librarymanager/index.html
2016-01-19 16:19:58 +02:00
tzapu 3eaa24b15a Merge pull request #73 from joagyl/patch-1
Fixed typo in  library.json

thank you.

need to get on platform io myself, so many good things i ve heard about it.

could you tell me how you go about using the lib with platform io without submitting it to them?
2016-01-19 15:36:03 +02:00
Joakim G e71b985c0d Fixed typo in library.json
Added missing comma that made the JSON invalid. Noticed this while trying to use the lib in platformio.
2016-01-19 13:51:48 +01:00
Alex Tudorache 823767cb8b char array would cut off strings that were too small in size 2016-01-18 16:34:25 +02:00
Alex Tudorache 0b06e465ce updated example due to memory issues
added more readme
2016-01-18 15:33:45 +02:00
Alex Tudorache 478d291bd2 more readme 2016-01-18 11:37:00 +02:00
Alex Tudorache 13fa4ffa3a added example on how to save static ip to FS config.json
added static ip to config portal, if set
2016-01-18 11:20:15 +02:00
Alex Tudorache e2bbd527d1 added static mode
thanks @jonathanendersby
renamed private variables for more clarity
readme update
2016-01-17 13:27:24 +02:00
Jonathan Endersby 598baf4451 Adding Static IP Support 2016-01-17 07:40:26 +02:00
Alex Tudorache b4e688a543 changed template
fix for web server returning empty pages in latest github
2016-01-14 20:29:58 +02:00
46 changed files with 9125 additions and 719 deletions
+12
View File
@@ -0,0 +1,12 @@
## Contributing PRs and ISSUES
The development branch is the active branch, no features or bugs will be fixed against master ( hotfixes may be considered ).
Please test against development branch before submitting issues, issues against master will be closed,
PRs against master may be kept open if provides something useful to other members.
Please open issues before sumbitting PRs against development, as commits might be occuring very frequently.
### Documentation is in progress
https://github.com/tzapu/WiFiManager/issues/500
+57
View File
@@ -0,0 +1,57 @@
## PLEASE TRY Latest Master BRANCH before submitting bugs, in case they were already fixed. ##
Issues without basic info will be ignored or closed!
Please fill the info fields, it helps to get you faster support ;)
if you have a stack dump decode it:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.rst
for better debug messages:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.rst
----------------------------- Remove above -----------------------------
### Basic Infos
#### Hardware
WiFimanager Branch/Release: Master
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
Core Version: 2.4.0, staging
### Description
Problem description
### Settings in IDE
Module: NodeMcu, Wemos D1
Additional libraries:
### Sketch
```cpp
#BEGIN
#include <Arduino.h>
void setup() {
}
void loop() {
}
#END
```
### Debug Messages
```
messages here
```
+131
View File
@@ -0,0 +1,131 @@
name: Compile examples
on:
push:
paths-ignore:
- '.github/workflows/cpp_lint.yml'
- '.github/workflows/compile_library.yml'
pull_request:
paths-ignore:
- '.github/workflows/cpp_lint.yml'
- '.github/workflows/compile_library.yml'
jobs:
esp8266:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- "examples/Parameters/SPIFFS/AutoConnectWithFSParametersAndCustomIP/AutoConnectWithFSParametersAndCustomIP.ino"
- "examples/Parameters/SPIFFS/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino"
- "examples/NonBlocking/OnDemandNonBlocking/OnDemandNonBlocking.ino"
- "examples/NonBlocking/AutoConnectNonBlockingwParams/AutoConnectNonBlockingwParams.ino"
- "examples/NonBlocking/AutoConnectNonBlocking/AutoConnectNonBlocking.ino"
- "examples/Basic/Basic.ino"
- "examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino"
- "examples/Advanced/Advanced.ino"
- "examples/Old_examples/AutoConnectWithStaticIP/AutoConnectWithStaticIP.ino"
- "examples/Old_examples/AutoConnectWithFeedback/AutoConnectWithFeedback.ino"
- "examples/Old_examples/AutoConnectWithReset/AutoConnectWithReset.ino"
- "examples/Old_examples/AutoConnectWithTimeout/AutoConnectWithTimeout.ino"
- "examples/ParamsChildClass/ParamsChildClass.ino"
- "examples/OnDemand/OnDemandConfigPortal/OnDemandConfigPortal.ino"
- "examples/OnDemand/OnDemandWebPortal/OnDemandWebPortal.ino"
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-pip-${{ github.ref }}-
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-
${{ runner.os }}-
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Install 3rd party dependencies
run: |
pio lib -g install \
file://. \
https://github.com/bblanchon/ArduinoJson \
https://github.com/knolleary/pubsubclient
- name: Run PlatformIO Examples
run: pio ci --board=nodemcuv2
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
esp32:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- "examples/Parameters/SPIFFS/AutoConnectWithFSParametersAndCustomIP/AutoConnectWithFSParametersAndCustomIP.ino"
- "examples/Parameters/SPIFFS/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino"
- "examples/NonBlocking/OnDemandNonBlocking/OnDemandNonBlocking.ino"
- "examples/NonBlocking/AutoConnectNonBlockingwParams/AutoConnectNonBlockingwParams.ino"
- "examples/NonBlocking/AutoConnectNonBlocking/AutoConnectNonBlocking.ino"
- "examples/Basic/Basic.ino"
- "examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino"
- "examples/Advanced/Advanced.ino"
- "examples/Old_examples/AutoConnectWithStaticIP/AutoConnectWithStaticIP.ino"
- "examples/Old_examples/AutoConnectWithFeedback/AutoConnectWithFeedback.ino"
- "examples/Old_examples/AutoConnectWithReset/AutoConnectWithReset.ino"
- "examples/Old_examples/AutoConnectWithTimeout/AutoConnectWithTimeout.ino"
- "examples/ParamsChildClass/ParamsChildClass.ino"
- "examples/OnDemand/OnDemandConfigPortal/OnDemandConfigPortal.ino"
- "examples/OnDemand/OnDemandWebPortal/OnDemandWebPortal.ino"
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-pip-${{ github.ref }}-
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-
${{ runner.os }}-
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Install 3rd party dependencies
run: |
pio lib -g install \
file://. \
https://github.com/bblanchon/ArduinoJson \
https://github.com/knolleary/pubsubclient
- name: Run PlatformIO Examples
run: pio ci --board=esp32dev
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
+58
View File
@@ -0,0 +1,58 @@
name: Compile Library
on:
push:
paths-ignore:
- '.github/workflows/cpp_lint.yml'
- '.github/workflows/compile_examples.yml'
- 'examples/**'
pull_request:
paths-ignore:
- '.github/workflows/cpp_lint.yml'
- '.github/workflows/compile_examples.yml'
- 'examples/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- "nodemcuv2"
- "lolin32"
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ matrix.board }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.board }}-
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}-${{ matrix.board }}
restore-keys: |
${{ runner.os }}-${{ matrix.board }}-
${{ runner.os }}-
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Create main file
run: |
echo "#include <Arduino.h>" >> main.ino
echo "void setup() {}" >> main.ino
echo "void loop() {}" >> main.ino
- name: Run PlatformIO
run: pio ci --board=${{ matrix.board }} .
+31
View File
@@ -0,0 +1,31 @@
name: cpplint
on:
push:
paths-ignore:
- '.github/workflows/compile_*.yml'
pull_request:
paths-ignore:
- '.github/workflows/compile_*.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: cpplint
uses: reviewdog/action-cpplint@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
flags: --linelength=100
target: .
filter: "-whitespace/tab\
,-readability/braces\
,-whitespace/braces\
,-whitespace/comments\
,-whitespace/indent\
,-whitespace/newline\
,-whitespace/operators\
,-whitespace/parens\
,-whitespace/line_length\
"
+13
View File
@@ -0,0 +1,13 @@
.pio
.cache
.pioenvs
.piolibdeps
.idea
.vscode
!.vscode/extensions.json
/platformio_override.ini
/build_output
.DS_Store
.gitignore
.clang-format
node_modules
+42
View File
@@ -0,0 +1,42 @@
language: c
sudo: false
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-1.8.10-linux64.tar.xz
- tar xf arduino-1.8.10-linux64.tar.xz
- sudo mv arduino-1.8.10 /usr/local/share/arduino
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
install:
- ln -s $PWD /usr/local/share/arduino/libraries/WiFiManager
- arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json,http://dl.espressif.com/dl/package_esp32_index.json" --save-prefs
- arduino --install-library "ArduinoJson:6.18.0"
- arduino --install-boards esp8266:esp8266
- arduino --pref "compiler.warning_level=all" --save-prefs
# install esp32
- arduino --install-boards esp32:esp32
script:
- "echo $PWD"
- "echo $HOME"
- "ls $PWD"
- source $TRAVIS_BUILD_DIR/travis/common.sh
- arduino --board esp8266:esp8266:generic:xtal=80,eesz=4M1M,FlashMode=qio,FlashFreq=80,dbg=Serial,lvl=CORE --save-prefs
- build_examples
- arduino --board esp32:esp32:esp32:FlashFreq=80,FlashSize=4M,DebugLevel=info --save-prefs
# some examples fail (SPIFFS defines differ esp32 vs esp8266) so we exclude them
- build_examples
# - arduino -v --verbose-build --verify $PWD/examples/AutoConnect/AutoConnect.ino
# no coverage generated, no need to run
#
#after_success:
# - bash <(curl -s https://codecov.io/bash)
notifications:
email:
on_success: change
on_failure: change
+9
View File
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.5)
idf_component_register(
SRCS "WiFiManager.cpp"
INCLUDE_DIRS "."
PRIV_REQUIRES arduino
)
project(WiFiManager)
+378 -69
View File
@@ -1,63 +1,125 @@
# WiFiManager
ESP8266 WiFi Connection manager with fallback web configuration portal
# WiFiManager
Espressif ESPx WiFi Connection manager with fallback web configuration portal
:warning: This Documentation is out of date, see notes below
<a name="release"></a>
[![Release](https://img.shields.io/github/v/release/tzapu/WiFiManager?include_prereleases)](#release)
[![Build CI Status](https://github.com/tzapu/WiFiManager/actions/workflows/compile_library.yml/badge.svg)](https://github.com/tzapu/WiFiManager/actions/workflows/compile_library.yml)
[![Build CI Status Examples](https://github.com/tzapu/WiFiManager/actions/workflows/compile_examples.yaml/badge.svg)](https://github.com/tzapu/WiFiManager/actions/workflows/compile_examples.yaml)
[![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiManager.svg?)](https://www.ardu-badge.com/WiFiManager)
[![Build with PlatformIO](https://img.shields.io/badge/PlatformIO-Library-orange?)](https://platformio.org/lib/show/567/WiFiManager/installation)
[![ESP8266](https://img.shields.io/badge/ESP-8266-000000.svg?longCache=true&style=flat&colorA=CC101F)](https://www.espressif.com/en/products/socs/esp8266)
[![ESP32](https://img.shields.io/badge/ESP-32-000000.svg?longCache=true&style=flat&colorA=CC101F)](https://www.espressif.com/en/products/socs/esp32)
[![ESP32](https://img.shields.io/badge/ESP-32S2-000000.svg?longCache=true&style=flat&colorA=CC101F)](https://www.espressif.com/en/products/socs/esp32-s2)
[![ESP32](https://img.shields.io/badge/ESP-32C3-000000.svg?longCache=true&style=flat&colorA=CC101F)](https://www.espressif.com/en/products/socs/esp32-c3)
[![ESP32](https://img.shields.io/badge/ESP-32S3-000000.svg?longCache=true&style=flat&colorA=CC101F)](https://www.espressif.com/en/products/socs/esp32-S3)
Member to Member Support / Chat
[![Join the chat at https://gitter.im/tablatronix/WiFiManager](https://badges.gitter.im/tablatronix/WiFiManager.svg)](https://gitter.im/tablatronix/WiFiManager?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Discord](https://img.shields.io/badge/Discord-WiFiManager-%237289da.svg?logo=discord)](https://discord.gg/nS5WGkaQH5)
The configuration portal is of the captive variety, so on various devices it will present the configuration dialogue as soon as you connect to the created access point.
First attempt at a library. Lots more changes and fixes to do. Contributions are welcome.
Works with the [ESP8266 Arduino](https://github.com/esp8266/Arduino) and [ESP32 Arduino](https://github.com/espressif/arduino-esp32) platforms.
#### This works with the ESP8266 Arduino platform with a recent stable release(2.0.0 or newer) https://github.com/esp8266/Arduino
### Known Issues
* Documentation needs to be updated, see [https://github.com/tzapu/WiFiManager/issues/500](https://github.com/tzapu/WiFiManager/issues/500)
-------
## Contents
- [How it works](#how-it-works)
- [Wishlist](#wishlist)
- [Quick start](#quick-start)
- Installing
- [Through Boards Manager](#install-through-boards-manager)
- [From Github](#checkout-from-github)
- [Arduino - Through Library Manager](#install-through-library-manager)
- [Arduino - From Github](#checkout-from-github)
- [PlatformIO](#install-using-platformio)
- [Using](#using)
- [Documentation](#documentation)
- [Access Point Password](#password-protect-the-configuration-access-point)
- [Callbacks](#callbacks)
- [Timeout](#timeout)
- [Configuration Portal Timeout](#configuration-portal-timeout)
- [On Demand Configuration](#on-demand-configuration-portal)
- [Custom Parameters](#custom-parameters)
- [Custom IP Configuration](#custom-ip-configuration)
- [Filter Low Quality Networks](#filter-networks)
- [Debug Output](#debug)
- [Troubleshooting](#troubleshooting)
- [Releases](#releases)
- [Contributors](#contributions-and-thanks)
## How It Works
- when your ESP starts up, it sets it up in Station mode and tries to connect to a previously saved Access Point
- When your ESP starts up, it sets it up in Station mode and tries to connect to a previously saved Access Point
- if this is unsuccessful (or no previous network saved) it moves the ESP into Access Point mode and spins up a DNS and WebServer (default ip 192.168.4.1)
- using any wifi enabled device with a browser (computer, phone, tablet) connect to the newly created Access Point
- because of the Captive Portal and the DNS server you will either get a 'Join to network' type of popup or get any domain you try to access redirected to the configuration portal
- choose one of the access points scanned, enter password, click save
- ESP will try to connect. If successful, it relinquishes control back to your app. If not, reconnect to AP and reconfigure.
- There are options to change this behavior or manually start the configportal and webportal independantly as well as run them in non blocking mode.
## How It Looks
![ESP8266 WiFi Captive Portal Homepage](http://i.imgur.com/YPvW9eql.png) ![ESP8266 WiFi Captive Portal Configuration](http://i.imgur.com/oicWJ4gl.png)
## Wishlist
- ~~remove dependency on EEPROM library~~
- ~~move HTML Strings to PROGMEM~~
- ~~cleanup and streamline code~~ (although this is ongoing)
- if timeout is set, extend it when a page is fetched in AP mode
- ~~add ability to configure more parameters than ssid/password~~
- maybe allow setting ip of ESP after reboot
- ~~add to Arduino Boards Manager~~
- add to PlatformIO
- add multiple sets of network credentials
- allow users to customize CSS
- [x] remove dependency on EEPROM library
- [x] move HTML Strings to PROGMEM
- [x] cleanup and streamline code (although this is ongoing)
- [x] if timeout is set, extend it when a page is fetched in AP mode
- [x] add ability to configure more parameters than ssid/password
- [x] maybe allow setting ip of ESP after reboot
- [x] add to Arduino Library Manager
- [x] add to PlatformIO
- [ ] add multiple sets of network credentials
- [x] allow users to customize CSS
- [ ] rewrite documentation for simplicity, based on scenarios/goals
### Development
- [x] ESP32 support
- [x] rely on the SDK's built in auto connect more than forcing a connect
- [x] add non blocking mode
- [x] easy customization of strings
- [x] hostname support
- [x] fix various bugs and workarounds for esp SDK issues
- [x] additional info page items
- [x] last status display / faiilure reason
- [x] customizeable menu
- [x] seperate custom params page
- [x] ondemand webportal
- [x] complete refactor of code to segment functions
- [x] wiif scan icons or percentage display
- [x] invert class for dark mode
- [x] more template tokens
- [x] progmem for all strings
- [ ] new callbacks
- [ ] new callouts / filters
- [ ] shared web server instance
- [x] latest esp idf/sdk support
- [x] wm is now non persistent, will not erase or change stored esp config on esp8266
- [x] tons of debugging output / levels
- [ ] disable captiveportal
- [ ] preload wiifscans, faster page loads
- [ ] softap stability fixes when sta is not connected
## Quick Start
### Installing
You can either install through the Arduino Boards Manager or checkout the latest changes or a release from github
You can either install through the Arduino Library Manager or checkout the latest changes or a release from github
#### Install through Boards Manager
__Currently version 0.6 works with release 2.0.0 or newer of the [ESP8266 core for Arduino](https://github.com/esp8266/Arduino)__
#### Install through Library Manager
__Currently version 0.8+ works with release 2.4.0 or newer of the [ESP8266 core for Arduino](https://github.com/esp8266/Arduino)__
- in Arduino IDE got to Sketch/Include Library/Manage Libraries
![Manage Libraries](http://i.imgur.com/9BkEBkR.png)
@@ -67,18 +129,16 @@ __Currently version 0.6 works with release 2.0.0 or newer of the [ESP8266 core f
- click Install and start [using it](#using)
#### Checkout from github
__Github version works with release 2.0.0 or newer of the [ESP8266 core for Arduino](https://github.com/esp8266/Arduino)__
__Github version works with release 2.4.0 or newer of the [ESP8266 core for Arduino](https://github.com/esp8266/Arduino)__
- Checkout library to your Arduino libraries folder
### Using
- Include in your sketch
```cpp
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager WiFi Configuration Magic
```
- Initialize library, in your setup function add
- Initialize library, in your setup function add, NOTEif you are using non blocking you will make sure you create this in global scope or handle appropriatly , it will not work if in setup and using non blocking mode.
```cpp
WiFiManager wifiManager;
```
@@ -102,6 +162,30 @@ While in AP mode, connect to it then open a browser to the gateway IP, default 1
Also see [examples](https://github.com/tzapu/WiFiManager/tree/master/examples).
#### Install Using PlatformIO
[PlatformIO](https://platformio.org/) is an emerging ecosystem for IoT development, and
is an alternative to using the Arduino IDE. Install `WiFiManager`
using the platformio [library manager](https://docs.platformio.org/en/latest/librarymanager/index.html#librarymanager) in your editor,
or using the [PlatformIO Core CLI](https://docs.platformio.org/en/latest/core/index.html),
or by adding it to your `platformio.ini` as shown below (recommended approach).
The simplest way is to open the `platformio.ini` file at the root of your project, and `WifiManager` to the common top-level env
`lib_deps` key like so:
```
[env]
lib_deps =
WiFiManager
```
```
[env]
lib_deps =
https://github.com/tzapu/WiFiManager.git
```
## Documentation
#### Password protect the configuration Access Point
@@ -130,7 +214,17 @@ void configModeCallback (WiFiManager *myWiFiManager) {
```
##### Save settings
This gets called when custom parameters have been set **AND** a connection has been established. Use it to set a flag, so when all the configuration finishes, you can save the extra parameters somewhere. See [AutoConnectWithFSParameters Example](https://github.com/tzapu/WiFiManager/tree/master/examples/AutoConnectWithFSParameters).
This gets called when custom parameters have been set **AND** a connection has been established. Use it to set a flag, so when all the configuration finishes, you can save the extra parameters somewhere.
IF YOU NEED TO SAVE PARAMETERS EVEN ON WIFI FAIL OR EMPTY, you must set `setBreakAfterConfig` to true, or else saveConfigCallback will not be called.
```C++
//if this is set, it will exit after config, even if connection is unsuccessful.
void setBreakAfterConfig(boolean shouldBreak);
```
See [AutoConnectWithFSParameters Example](https://github.com/tzapu/WiFiManager/tree/master/examples/Parameters/SPIFFS/AutoConnectWithFSParameters).
```cpp
wifiManager.setSaveConfigCallback(saveConfigCallback);
```
@@ -146,10 +240,10 @@ void saveConfigCallback () {
}
```
#### Timeout
#### Configuration Portal Timeout
If you need to set a timeout so the ESP doesn't hang waiting to be configured, for instance after a power failure, you can add
```cpp
wifiManager.setTimeout(180);
wifiManager.setConfigPortalTimeout(180);
```
which will wait 3 minutes (180 seconds). When the time passes, the autoConnect function will return, no matter the outcome.
Check for connection and if it's still not established do whatever is needed (on some modules I restart them to retry, on others I enter deep sleep)
@@ -157,7 +251,8 @@ Check for connection and if it's still not established do whatever is needed (on
#### On Demand Configuration Portal
If you would rather start the configuration portal on demand rather than automatically on a failed connection attempt, then this is for you.
Instead of calling `autoConnect()` which does all the connecting and failover configuration portal setup for you, you need to use `startConfigPortal()`
Instead of calling `autoConnect()` which does all the connecting and failover configuration portal setup for you, you need to use `startConfigPortal()`. __Do not use BOTH.__
Example usage
```cpp
void loop() {
@@ -169,99 +264,313 @@ void loop() {
}
}
```
See example for a more complex version. [OnDemandConfigPortal](https://github.com/tzapu/WiFiManager/tree/master/examples/OnDemandConfigPortal)
See example for a more complex version. [OnDemandConfigPortal](https://github.com/tzapu/WiFiManager/tree/master/examples/OnDemand/OnDemandConfigPortal)
### Custom Parameters
#### Exiting from the Configuration Portal
Normally, once entered, the configuration portal will continue to loop until WiFi credentials have been successfully entered or a timeout is reached.
If you'd prefer to exit without joining a WiFi network, say becuase you're going to put the ESP into AP mode, then press the "Exit" button
on the main webpage.
If started via `autoConnect` or `startConfigPortal` then it will return `false (portalAbortResult)`
#### Custom Parameters
You can use WiFiManager to collect more parameters than just SSID and password.
This could be helpful for configuring stuff like MQTT host and port, [blynk](http://www.blynk.cc) or [emoncms](http://emoncms.org) tokens, just to name a few.
**You are responsible for saving and loading these custom values.** The library just collects and displays the data for you as a convenience.
Usage scenario would be:
- load values from somewhere (EEPROM/FS) or generate some defaults
- add the custom parameters to WiFiManager using
```cpp
```cpp
// id/name, placeholder/prompt, default, length
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 40);
wifiManager.addParameter(&custom_mqtt_server);
```
```
- if connection to AP fails, configuration portal starts and you can set /change the values (or use on demand configuration portal)
- once configuration is done and connection is established [save config callback]() is called
- once configuration is done and connection is established save config callback() is called
- once WiFiManager returns control to your application, read and save the new values using the `WiFiManagerParameter` object.
```cpp
```cpp
mqtt_server = custom_mqtt_server.getValue();
```
This feature is a lot more involved than all the others, so here are some examples to fully show how it is done
- Save and load custom parameters to file system in json form [AutoConnectWithFSParameters](https://github.com/tzapu/WiFiManager/tree/master/examples/AutoConnectWithFSParameters)
```
This feature is a lot more involved than all the others, so here are some examples to fully show how it is done.
You should also take a look at adding custom HTML to your form.
- Save and load custom parameters to file system in json form [AutoConnectWithFSParameters](https://github.com/tzapu/WiFiManager/tree/master/examples/Parameters/SPIFFS/AutoConnectWithFSParameters)
- *Save and load custom parameters to EEPROM* (not done yet)
#### Custom IP Configuration
You can set a custom IP for both AP (access point, config mode) and STA (station mode, client mode, normal project state)
### Custom IP Configuration
##### Custom Access Point IP Configuration
This will set your captive portal to a specific IP should you need/want such a feature. Add the following snippet before `autoConnect()`
```cpp
//set custom ip for portal
wifiManager.setAPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
```
##### Custom Station (client) Static IP Configuration
This will make use the specified IP configuration instead of using DHCP in station mode.
```cpp
wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,99), IPAddress(192,168,0,1), IPAddress(255,255,255,0)); // optional DNS 4th argument
```
There are a couple of examples in the examples folder that show you how to set a static IP and even how to configure it through the web configuration portal.
NOTE: You should fill DNS server if you have HTTP requests with hostnames or syncronize time (NTP). It's the same as gateway ip or a popular (Google DNS: 8.8.8.8).
#### Custom HTML, CSS, Javascript
There are various ways in which you can inject custom HTML, CSS or Javascript into the configuration portal.
The options are:
- inject custom head element
You can use this to any html bit to the head of the configuration portal. If you add a `<style>` element, bare in mind it overwrites the included css, not replaces.
```cpp
wifiManager.setCustomHeadElement("<style>html{filter: invert(100%); -webkit-filter: invert(100%);}</style>");
```
- inject a custom bit of html in the configuration/param form
```cpp
WiFiManagerParameter custom_text("<p>This is just a text paragraph</p>");
wifiManager.addParameter(&custom_text);
```
- inject a custom bit of html in a configuration form element
Just add the bit you want added as the last parameter to the custom parameter constructor.
```cpp
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", "iot.eclipse", 40, " readonly");
wifiManager.addParameter(&custom_mqtt_server);
```
#### Theming
You can customize certain elements of the default template with some builtin classes
```CPP
wifiManager.setClass("invert"); // dark theme
wifiManager.setScanDispPerc(true); // display percentages instead of graphs for RSSI
```
There are additional classes in the css you can use in your custom html , see the example template.
#### Filter Networks
If you would like to filter low signal quality networks you can tell WiFiManager to not show networks below an arbitrary quality %;
```
You can filter networks based on signal quality and show/hide duplicate networks.
- If you would like to filter low signal quality networks you can tell WiFiManager to not show networks below an arbitrary quality %;
```cpp
wifiManager.setMinimumSignalQuality(10);
```
will not show networks under 10% signal quality. If you omit the parameter it defaults to 8%;
- You can also remove or show duplicate networks (default is remove).
Use this function to show (or hide) all networks.
```cpp
wifiManager.setRemoveDuplicateAPs(false);
```
#### Debug
Debug is enabled by default on Serial. To disable add before autoConnect
Debug is enabled by default on `Serial` in non-stable releases. To disable add before autoConnect/startConfigPortal
```cpp
wifiManager.setDebugOutput(false);
```
You can pass in a custom stream via constructor
```CPP
WiFiManager wifiManager(Serial1);
```
You can customize the debug level by changing `_debugLevel` in source
options are:
* DEBUG_ERROR
* DEBUG_NOTIFY
* DEBUG_VERBOSE
* DEBUG_DEV
* DEBUG_MAX
## Troubleshooting
If you get compilation errors, more often than not, you may need to install a newer version of the ESP8266 core for Arduino.
Changes added on 0.8 should make the latest trunk work without compilation errors. Tested down to ESP8266 core 2.0.0. **Please update to version 0.8**
I am trying to keep releases working with release versions of the core, so they can be installed through boards manager, but if you checkout the latest version directly from github, sometimes, the library will only work if you update the ESP8266 core to the latest version because I am using some newly added function.
If you connect to the created configuration Access Point but the configuration portal does not show up, just open a browser and type in the IP of the web portal, by default `192.168.4.1`.
If trying to connect ends up in an endless loop, try to add `setConnectTimeout(60)` before `autoConnect();`. The parameter is timeout to try connecting in seconds.
I get stuck in ap mode when the power goes out or modem resets, try a setConfigPortalTimeout(seconds). This will cause the configportal to close after no activity, and you can reboot or attempt reconnection in your code.
## Releases
#### 0.6
- custom parameters
- prettier
- on demand config portal
- commit #100 :D
### 1.0.1
##### 0.5
- Added to Arduino Boards Manager - Thanks Max
- moved most stuff to PROGMEM
- added signal quality and a nice little padlock to show which networks are encrypted
### Development Overview
##### v0.4 - all of it user contributed changes - Thank you
- added ability to password protect the configuration Access Point
- callback for enter configuration mode
- memory allocation improvements
#### Added Public Methods
`setConfigPortalBlocking`
##### v0.3
- removed the need for EEPROM and works with the 2.0.0 and above stable release of the ESP8266 for Arduino IDE package
- removed restart on save of credentials
- updated examples
`setShowStaticFields`
##### v0.2
needs the latest staging version (or at least a recent release of the staging version) to work
This is jsut random textTo show the lagginess.
[the editor is completly](behing the typing)
`setCaptivePortalEnable`
##### v0.1
works with the staging release ver. 1.6.5-1044-g170995a, built on Aug 10, 2015 of the ESP8266 Arduino library.
`setRestorePersistent`
`setCaptivePortalClientCheck`
`setWebPortalClientCheck`
`startWebPortal`
`stopWebPortal`
`process`
`disconnect`
`erase`
` debugSoftAPConfig`
` debugPlatformInfo`
`setScanDispPerc`
`setHostname`
`setMenu(menu_page_t[])`
`setWiFiAutoReconnect`
` setSTAStaticIPConfig(..,dns)`
`setShowDnsFields`
`getLastConxResult`
`getWLStatusString`
`getModeString`
`getWiFiIsSaved`
`setShowInfoErase`
`setEnableConfigPortal`
`setCountry`
`setClass`
`htmleEtities`
#### WiFiManagerParameter
`WiFiManagerParameter(id,label)`
`WiFiManagerParameter.setValue(value,length)`
`getParameters`
`getParametersCount`
#### Constructors
`WiFiManager(Stream& consolePort)`
#### define flags
❗️ **Defines cannot be set in user sketches**
`#define WM_MDNS // use MDNS`
`#define WM_FIXERASECONFIG // use erase flash fix, esp8266 2.4.0`
`#define WM_ERASE_NVS // esp32 erase(true) will erase NVS`
`#include <rom/rtc.h> // esp32 info page will show last reset reasons if this file is included`
#### Changes Overview
- ESP32 support ( fairly stable )
- complete refactor of strings `strings_en.h`
- adds new tokens for wifiscan, and some classes (left , invert icons, MSG color)
- adds status callout panel default, primary, special colors
- adds tons of info on info page, and erase capability
- adds signal icons, replaces percentage ( has hover titles )
- adds labels to all inputs (replaces placeholders)
- all html ( and eventually all strings except debug) moved to `strings_en.h`
- added additional debugging, compressed debug lines, debuglevels
- persistent disabled, and restored via de/con-stuctor (uses `setRestorePersistent`)
- should retain all user modes including AP, should not overwrite or persist user modes or configs,even STA (`storeSTAmode`) (BUGGY)
- ⚠️ return values may have changed depending on portal abort, or timeout ( `portalTimeoutResult`,`portalAbortResult`)
- params memory is auto allocated by increment of `WIFI_MANAGER_MAX_PARAMS(5)` when exceeded, user no longer needs to specify this at all.
- addparameter now returns bool, and it returns false if param ID is not alphanum [0-9,A-Z,a-z,_]
- param field ids allow {I} token to use param_n instead of string in case someones wants to change this due to i18n or character issues
- provides `#DEFINE FIXERASECONFIG` to help deal with https://github.com/esp8266/Arduino/pull/3635
- failure reason reporting on portal
- set esp8266 sta hostname, esp32 sta+ap hostname ( DHCP client id)
- pass in debug stream in constructor WiFiManager(Stream& consolePort)
- you can force ip fields off with showxfields(false) if you set _disableIpFields=true
- param menu/page (setup) added to separate params from wifi page, handled automatically by setMenu
- set custom root menu
- disable configportal on autoconnect
- wm parameters init is now protected, allowing child classes, example included
- wifiscans are precached and async for faster page loads, refresh forces rescan
- adds esp32 gettemperature ( currently commented out, useful for relative measurement only )
#### 0.12
- removed 204 header response
- fixed incompatibility with other libs using isnan and other std:: functions without namespace
##### 0.11
- a lot more reliable reconnecting to networks
- custom html in custom parameters (for read only params)
- custom html in custom parameter form (like labels)
- custom head element (like custom css)
- sort networks based on signal quality
- remove duplicate networks
##### 0.10
- some css changes
- bug fixes and speed improvements
- added an alternative to waitForConnectResult() for debugging
- changed `setTimeout(seconds)` to `setConfigPortalTimeout(seconds)`
### Contributions and thanks
The support and help I got from the community has been nothing short of phenomenal. I can't thank you guys enough. This is my first real attept in developing open source stuff and I must say, now I understand why people are so dedicated to it, it is because of all the wonderful people involved.
__THANK YOU__
The esp8266 and esp32 arduino and idf maintainers!
[Shawn A aka tablatronix](https://github.com/tablatronix)
[liebman](https://github.com/liebman)
[Evgeny Dontsov](https://github.com/dontsovcmc)
[Chris Marrin](https://github.com/cmarrin)
[bbx10](https://github.com/bbx10)
[kentaylor](https://github.com/kentaylor)
[Maximiliano Duarte](https://github.com/domonetic)
[alltheblinkythings](https://github.com/alltheblinkythings)
[Niklas Wall](https://github.com/niklaswall)
[Jakub Piasecki](https://github.com/zaporylie)
[Peter Allan](https://github.com/alwynallan)
[John Little](https://github.com/j0hnlittle)
[markaswift](https://github.com/markaswift)
[franklinvv](https://github.com/franklinvv)
[Alberto Ricci Bitti](https://github.com/riccibitti)
[SebiPanther](https://github.com/SebiPanther)
Sorry if i have missed anyone.
[jonathanendersby](https://github.com/jonathanendersby)
[walthercarsten](https://github.com/walthercarsten)
And countless others
#### Inspiration
- http://www.esp8266.com/viewtopic.php?f=29&t=2520
* http://www.esp8266.com/viewtopic.php?f=29&t=2520
* https://github.com/chriscook8/esp-arduino-apboot
* https://github.com/esp8266/Arduino/tree/master/libraries/DNSServer/examples/CaptivePortalAdvanced
* Built by AlexT https://github.com/tzapu
+3905 -381
View File
File diff suppressed because it is too large Load Diff
+795 -88
View File
@@ -1,155 +1,862 @@
/**************************************************************
WiFiManager is a library for the ESP8266/Arduino platform
(https://github.com/esp8266/Arduino) to enable easy
configuration and reconfiguration of WiFi credentials using a Captive Portal
inspired by:
http://www.esp8266.com/viewtopic.php?f=29&t=2520
https://github.com/chriscook8/esp-arduino-apboot
https://github.com/esp8266/Arduino/tree/esp8266/hardware/esp8266com/esp8266/libraries/DNSServer/examples/CaptivePortalAdvanced
Built by AlexT https://github.com/tzapu
Licensed under MIT license
**************************************************************/
/**
* WiFiManager.h
*
* WiFiManager, a library for the ESP8266/Arduino platform
* for configuration of WiFi credentials using a Captive Portal
*
* @author Creator tzapu
* @author tablatronix
* @version 0.0.0
* @license MIT
*/
#ifndef WiFiManager_h
#define WiFiManager_h
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#if defined(ESP8266) || defined(ESP32)
#ifdef ESP8266
#include <core_version.h>
#endif
#include <vector>
// #define WM_MDNS // includes MDNS, also set MDNS with sethostname
// #define WM_FIXERASECONFIG // use erase flash fix
// #define WM_ERASE_NVS // esp32 erase(true) will erase NVS
// #define WM_RTC // esp32 info page will include reset reasons
// #define WM_JSTEST // build flag for enabling js xhr tests
// #define WIFI_MANAGER_OVERRIDE_STRINGS // build flag for using own strings include
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
#warning "ARDUINO_ESP8266_RELEASE_2_3_0, some WM features disabled"
// @todo check failing on platform = espressif8266@1.7.3
#define WM_NOASYNC // esp8266 no async scan wifi
#define WM_NOCOUNTRY // esp8266 no country
#define WM_NOAUTH // no httpauth
#define WM_NOSOFTAPSSID // no softapssid() @todo shim
#endif
// #ifdef CONFIG_IDF_TARGET_ESP32S2
// #warning ESP32S2
// #endif
// #ifdef CONFIG_IDF_TARGET_ESP32C3
// #warning ESP32C3
// #endif
// #ifdef CONFIG_IDF_TARGET_ESP32S3
// #warning ESP32S3
// #endif
// #if defined(ARDUINO_ESP32S3_DEV) || defined(CONFIG_IDF_TARGET_ESP32S3)
// #warning "WM_NOTEMP"
// #define WM_NOTEMP // disabled temp sensor, have to determine which chip we are on
// #endif
// #include "soc/efuse_reg.h" // include to add efuse chip rev to info, getChipRevision() is almost always the same though, so not sure why it matters.
// #define esp32autoreconnect // implement esp32 autoreconnect event listener kludge, @DEPRECATED
// autoreconnect is WORKING https://github.com/espressif/arduino-esp32/issues/653#issuecomment-405604766
#define WM_WEBSERVERSHIM // use webserver shim lib
#define WM_G(string_literal) (String(FPSTR(string_literal)).c_str())
#ifdef ESP8266
extern "C" {
#include "user_interface.h"
}
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#ifdef WM_MDNS
#include <ESP8266mDNS.h>
#endif
#define WIFI_getChipId() ESP.getChipId()
#define WM_WIFIOPEN ENC_TYPE_NONE
#elif defined(ESP32)
#include <WiFi.h>
#include <esp_wifi.h>
#include <Update.h>
#define WIFI_getChipId() (uint32_t)ESP.getEfuseMac()
#define WM_WIFIOPEN WIFI_AUTH_OPEN
#ifndef WEBSERVER_H
#ifdef WM_WEBSERVERSHIM
#include <WebServer.h>
#else
#include <ESP8266WebServer.h>
// Forthcoming official ? probably never happening
// https://github.com/esp8266/ESPWebServer
#endif
#endif
#ifdef WM_ERASE_NVS
#include <nvs.h>
#include <nvs_flash.h>
#endif
#ifdef WM_MDNS
#include <ESPmDNS.h>
#endif
#ifdef WM_RTC
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/rtc.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/rtc.h"
#endif
#endif
#else
#endif
#include <DNSServer.h>
#include <memory>
const char HTTP_200[] PROGMEM = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
//const char HTTP_HEAD[] PROGMEM = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/><title>{v}</title>";
const char HTTP_STYLE[] PROGMEM = "<style>div,input{padding:5px;font-size:1em;} input{width:95%;} body{text-align:center;font-family:verdana;} button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;}</style>";
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();}</script>";
const char HTTP_HEAD_END[] PROGMEM = "</head><body><div style='text-align: left; display: inline-block;'>";
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action=\"/wifi\" method=\"get\"><button>Configure WiFi</button></form><br/><form action=\"/0wifi\" method=\"get\"><button>Configure WiFi (No Scan)</button></form>";
const char HTTP_ITEM[] PROGMEM = "<div><a href='#' onclick='c(this)'>{v}</a> {r}% {i}</div>";
const char HTTP_ITEM_PADLOCK[] PROGMEM = "<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAALVBMVEX///8EBwfBwsLw8PAzNjaCg4NTVVUjJiZDRUUUFxdiZGSho6OSk5Pg4eFydHTCjaf3AAAAZElEQVQ4je2NSw7AIAhEBamKn97/uMXEGBvozkWb9C2Zx4xzWykBhFAeYp9gkLyZE0zIMno9n4g19hmdY39scwqVkOXaxph0ZCXQcqxSpgQpONa59wkRDOL93eAXvimwlbPbwwVAegLS1HGfZAAAAABJRU5ErkJggg==' width='13px'/>";
const char HTTP_FORM_START[] PROGMEM = "<form method='get' action='wifisave'><input id='s' name='s' length=32 placeholder='SSID'><br/><input id='p' name='p' length=64 type='password' placeholder='password'><br/>";
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' length={l} placeholder='{p}' value='{v}'>";
const char HTTP_FORM_END[] PROGMEM = "<br/><button type='submit'>save</button></form>";
// Include wm strings vars
// Pass in strings env override via WM_STRINGS_FILE
#ifndef WM_STRINGS_FILE
#define WM_STRINGS_FILE "wm_strings_en.h" // this includes constants as dependency
#endif
#include WM_STRINGS_FILE
const char HTTP_SAVED[] PROGMEM = "<div>Credentials Saved<br />Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>";
const char HTTP_END[] PROGMEM = "</div></body></html>";
// prep string concat vars
#define WM_STRING2(x) #x
#define WM_STRING(x) WM_STRING2(x)
#define WIFI_MANAGER_MAX_PARAMS 10
// #include <esp_idf_version.h>
#ifdef ESP_IDF_VERSION
// #pragma message "ESP_IDF_VERSION_MAJOR = " WM_STRING(ESP_IDF_VERSION_MAJOR)
// #pragma message "ESP_IDF_VERSION_MINOR = " WM_STRING(ESP_IDF_VERSION_MINOR)
// #pragma message "ESP_IDF_VERSION_PATCH = " WM_STRING(ESP_IDF_VERSION_PATCH)
#define VER_IDF_STR WM_STRING(ESP_IDF_VERSION_MAJOR) "." WM_STRING(ESP_IDF_VERSION_MINOR) "." WM_STRING(ESP_IDF_VERSION_PATCH)
#else
#define VER_IDF_STR "Unknown"
#endif
#ifdef Arduino_h
#ifdef ESP32
// #include "esp_arduino_version.h" // esp32 arduino > 2.x
#endif
// esp_get_idf_version
#ifdef ESP_ARDUINO_VERSION
// #pragma message "ESP_ARDUINO_VERSION_MAJOR = " WM_STRING(ESP_ARDUINO_VERSION_MAJOR)
// #pragma message "ESP_ARDUINO_VERSION_MINOR = " WM_STRING(ESP_ARDUINO_VERSION_MINOR)
// #pragma message "ESP_ARDUINO_VERSION_PATCH = " WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#ifdef ESP_ARDUINO_VERSION_MAJOR
#define VER_ARDUINO_STR WM_STRING(ESP_ARDUINO_VERSION_MAJOR) "." WM_STRING(ESP_ARDUINO_VERSION_MINOR) "." WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#else
#define VER_ARDUINO_STR "Unknown"
#endif
#else
#include <core_version.h>
// #pragma message "ESP_ARDUINO_VERSION_GIT = " WM_STRING(ARDUINO_ESP32_GIT_VER)// 0x46d5afb1
// #pragma message "ESP_ARDUINO_VERSION_DESC = " WM_STRING(ARDUINO_ESP32_GIT_DESC) // 1.0.6
// #pragma message "ESP_ARDUINO_VERSION_REL = " WM_STRING(ARDUINO_ESP32_RELEASE) //"1_0_6"
#ifdef ESP_ARDUINO_VERSION_MAJOR
#define VER_ARDUINO_STR WM_STRING(ESP_ARDUINO_VERSION_MAJOR) "." WM_STRING(ESP_ARDUINO_VERSION_MINOR) "." WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#else
#define VER_ARDUINO_STR "Unknown"
#endif
#endif
#else
#define VER_ARDUINO_STR "Unknown"
#endif
// #pragma message "VER_IDF_STR = " WM_STRING(VER_IDF_STR)
// #pragma message "VER_ARDUINO_STR = " WM_STRING(VER_ARDUINO_STR)
#ifndef WIFI_MANAGER_MAX_PARAMS
#define WIFI_MANAGER_MAX_PARAMS 5 // params will autoincrement and realloc by this amount when max is reached
#endif
#define WFM_LABEL_BEFORE 1
#define WFM_LABEL_AFTER 2
#define WFM_NO_LABEL 0
#define WFM_LABEL_DEFAULT 1
class WiFiManagerParameter {
public:
WiFiManagerParameter(const char *id, const char *placeholder, const char *defaultValue, int length);
/**
Create custom parameters that can be added to the WiFiManager setup web page
@id is used for HTTP queries and must not contain spaces nor other special characters
*/
WiFiManagerParameter();
WiFiManagerParameter(const char *custom);
WiFiManagerParameter(const char *id, const char *label);
WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length);
WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length, const char *custom);
WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length, const char *custom, int labelPlacement);
~WiFiManagerParameter();
// WiFiManagerParameter& operator=(const WiFiManagerParameter& rhs);
const char* getID();
const char* getValue();
const char* getPlaceholder();
int getValueLength();
private:
const char* _id;
const char* _placeholder;
char* _value;
int _length;
const char *getID() const;
const char *getValue() const;
const char *getLabel() const;
const char *getPlaceholder() const; // @deprecated, use getLabel
int getValueLength() const;
int getLabelPlacement() const;
virtual const char *getCustomHTML() const;
void setValue(const char *defaultValue, int length);
protected:
void init(const char *id, const char *label, const char *defaultValue, int length, const char *custom, int labelPlacement);
WiFiManagerParameter& operator=(const WiFiManagerParameter&);
const char *_id;
const char *_label;
char *_value;
int _length;
int _labelPlacement;
const char *_customHTML;
friend class WiFiManager;
};
// debugging
typedef enum {
WM_DEBUG_SILENT = 0, // debug OFF but still compiled for runtime
WM_DEBUG_ERROR = 1, // error only
WM_DEBUG_NOTIFY = 2, // default stable,INFO
WM_DEBUG_VERBOSE = 3, // move verbose info
WM_DEBUG_DEV = 4, // development useful debugging info
WM_DEBUG_MAX = 5 // MAX extra dev auditing, var dumps etc (MAX+1 will print timing,mem and frag info)
} wm_debuglevel_t;
class WiFiManager
{
public:
WiFiManager(Print& consolePort);
WiFiManager();
~WiFiManager();
void WiFiManagerInit();
// auto connect to saved wifi, or custom, and start config portal on failures
boolean autoConnect();
boolean autoConnect(char const *apName, char const *apPassword = NULL);
//if you want to always start the config portal, without trying to connect first
//manually start the config portal, autoconnect does this automatically on connect failure
boolean startConfigPortal(); // auto generates apname
boolean startConfigPortal(char const *apName, char const *apPassword = NULL);
String getSSID();
String getPassword();
//manually stop the config portal if started manually, stop immediatly if non blocking, flag abort if blocking
bool stopConfigPortal();
//manually start the web portal, autoconnect does this automatically on connect failure
void startWebPortal();
//manually stop the web portal if started manually
void stopWebPortal();
// Run webserver processing, if setConfigPortalBlocking(false)
boolean process();
// get the AP name of the config portal, so it can be used in the callback
String getConfigPortalSSID();
int getRSSIasQuality(int RSSI);
// erase wifi credentials
void resetSettings();
//for convenience
String urldecode(const char*);
//sets timeout before webserver loop ends and exits even if there has been no setup.
//usefully for devices that failed to connect at some point and got stuck in a webserver loop
//in seconds
void setTimeout(unsigned long seconds);
// reboot esp
void reboot();
// disconnect wifi, without persistent saving or erasing
bool disconnect();
// erase esp
bool erase();
bool erase(bool opt);
//adds a custom parameter, returns false on failure
bool addParameter(WiFiManagerParameter *p);
//returns the list of Parameters
WiFiManagerParameter** getParameters();
// returns the Parameters Count
int getParametersCount();
// SET CALLBACKS
//called after AP mode and config portal has started
void setAPCallback( std::function<void(WiFiManager*)> func );
//called after webserver has started
void setWebServerCallback( std::function<void()> func );
//called when settings reset have been triggered
void setConfigResetCallback( std::function<void()> func );
//called when wifi settings have been changed and connection was successful ( or setBreakAfterConfig(true) )
void setSaveConfigCallback( std::function<void()> func );
//called when saving params-in-wifi or params before anything else happens (eg wifi)
void setPreSaveConfigCallback( std::function<void()> func );
//called when saving params before anything else happens
void setPreSaveParamsCallback( std::function<void()> func );
//called when saving either params-in-wifi or params page
void setSaveParamsCallback( std::function<void()> func );
//called just before doing OTA update
void setPreOtaUpdateCallback( std::function<void()> func );
//called when config portal is timeout
void setConfigPortalTimeoutCallback( std::function<void()> func );
//sets timeout before AP,webserver loop ends and exits even if there has been no setup.
//useful for devices that failed to connect at some point and got stuck in a webserver loop
//in seconds setConfigPortalTimeout is a new name for setTimeout, ! not used if setConfigPortalBlocking
void setConfigPortalTimeout(unsigned long seconds);
void setTimeout(unsigned long seconds); // @deprecated, alias
//sets timeout for which to attempt connecting, useful if you get a lot of failed connects
void setConnectTimeout(unsigned long seconds);
// sets number of retries for autoconnect, force retry after wait failure exit
void setConnectRetries(uint8_t numRetries); // default 1
//sets timeout for which to attempt connecting on saves, useful if there are bugs in esp waitforconnectloop
void setSaveConnectTimeout(unsigned long seconds);
// lets you disable automatically connecting after save from webportal
void setSaveConnect(bool connect = true);
// toggle debug output
void setDebugOutput(boolean debug);
//defaults to not showing anything under 8% signal quality if called
void setDebugOutput(boolean debug, String prefix); // log line prefix, default "*wm:"
void setDebugOutput(boolean debug, wm_debuglevel_t level ); // log line prefix, default "*wm:"
//set min quality percentage to include in scan, defaults to 8% if not specified
void setMinimumSignalQuality(int quality = 8);
//sets a custom ip /gateway /subnet configuration
void setAPConfig(IPAddress ip, IPAddress gw, IPAddress sn);
//called when AP mode and config portal is started
void setAPCallback( void (*func)(WiFiManager*) );
//called when settings have been changed and connection was successful
void setSaveConfigCallback( void (*func)(void) );
void setAPStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn);
//sets config for a static IP
void setSTAStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn);
//sets config for a static IP with DNS
void setSTAStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn, IPAddress dns);
//if this is set, it will exit after config, even if connection is unsuccessful.
void setBreakAfterConfig(boolean shouldBreak);
// if this is set, portal will be blocking and wait until save or exit,
// is false user must manually `process()` to handle config portal,
// setConfigPortalTimeout is ignored in this mode, user is responsible for closing configportal
void setConfigPortalBlocking(boolean shouldBlock);
//add custom html at inside <head> for all pages
void setCustomHeadElement(const char* html);
//add custom html at start of <body> for all pages
void setCustomBodyHeader(const char* html);
//add custom html at end of <body> for all pages
void setCustomBodyFooter(const char* html);
//if this is set, customise style
void setCustomMenuHTML(const char* html);
//if this is true, remove duplicated Access Points - defaut true
void setRemoveDuplicateAPs(boolean removeDuplicates);
//setter for ESP wifi.persistent so we can remember it and restore user preference, as WIFi._persistent is protected
void setRestorePersistent(boolean persistent);
//if true, always show static net inputs, IP, subnet, gateway, else only show if set via setSTAStaticIPConfig
void setShowStaticFields(boolean alwaysShow);
//if true, always show static dns, esle only show if set via setSTAStaticIPConfig
void setShowDnsFields(boolean alwaysShow);
// toggle showing the saved wifi password in wifi form, could be a security issue.
void setShowPassword(boolean show);
//if false, disable captive portal redirection
void setCaptivePortalEnable(boolean enabled);
//if false, timeout captive portal even if a STA client connected to softAP (false), suggest disabling if captiveportal is open
void setAPClientCheck(boolean enabled);
//if true, reset timeout when webclient connects (true), suggest disabling if captiveportal is open
void setWebPortalClientCheck(boolean enabled);
// if true, enable autoreconnecting
void setWiFiAutoReconnect(boolean enabled);
// if true, wifiscan will show percentage instead of quality icons, until we have better templating
void setScanDispPerc(boolean enabled);
// if true (default) then start the config portal from autoConnect if connection failed
void setEnableConfigPortal(boolean enable);
// if true (default) then stop the config portal from autoConnect when wifi is saved
void setDisableConfigPortal(boolean enable);
// set a custom hostname, sets sta and ap dhcp client id for esp32, and sta for esp8266
bool setHostname(const char * hostname);
bool setHostname(String hostname);
// show erase wifi onfig button on info page, true
void setShowInfoErase(boolean enabled);
// show OTA upload button on info page
void setShowInfoUpdate(boolean enabled);
// set ap channel
void setWiFiAPChannel(int32_t channel);
// set ap hidden
void setWiFiAPHidden(bool hidden); // default false
// clean connect, always disconnect before connecting
void setCleanConnect(bool enable); // default false
// set custom menu items and order, vector or arr
// see _menutokens for ids
void setMenu(std::vector<const char*>& menu);
void setMenu(const char* menu[], uint8_t size);
// set the webapp title, default WiFiManager
void setTitle(String title);
// add params to its own menu page and remove from wifi, NOT TO BE COMBINED WITH setMenu!
void setParamsPage(bool enable);
// get last connection result, includes autoconnect and wifisave
uint8_t getLastConxResult();
// get a status as string
String getWLStatusString(uint8_t status);
String getWLStatusString();
// get wifi mode as string
String getModeString(uint8_t mode);
// check if the module has a saved ap to connect to
bool getWiFiIsSaved();
// helper to get saved password, if persistent get stored, else get current if connected
String getWiFiPass(bool persistent = true);
// helper to get saved ssid, if persistent get stored, else get current if connected
String getWiFiSSID(bool persistent = true);
// debug output the softap config
void debugSoftAPConfig();
// debug output platform info and versioning
void debugPlatformInfo();
// helper for html
String htmlEntities(String str, bool whitespace = false);
// set the country code for wifi settings, CN
void setCountry(String cc);
// set body class (invert), may be used for hacking in alt classes
void setClass(String str);
// set dark mode via invert class
void setDarkMode(bool enable);
// get default ap esp uses , esp_chipid etc
String getDefaultAPName();
// set port of webserver, 80
void setHttpPort(uint16_t port);
// check if config portal is active (true)
bool getConfigPortalActive();
// check if web portal is active (true)
bool getWebPortalActive();
// to preload autoconnect for test fixtures or other uses that skip esp sta config
bool preloadWiFi(String ssid, String pass);
// get hostname helper
String getWiFiHostname();
//adds a custom parameter
void addParameter(WiFiManagerParameter *p);
private:
std::unique_ptr<DNSServer> dnsServer;
std::unique_ptr<ESP8266WebServer> server;
const int WM_DONE = 0;
const int WM_WAIT = 10;
#if defined(ESP32) && defined(WM_WEBSERVERSHIM)
using WM_WebServer = WebServer;
#else
using WM_WebServer = ESP8266WebServer;
#endif
std::unique_ptr<WM_WebServer> server;
const String HTTP_HEAD = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/><title>{v}</title>";
protected:
// vars
std::vector<uint8_t> _menuIds;
std::vector<const char *> _menuIdsParams = {"wifi","param","info","exit"};
std::vector<const char *> _menuIdsUpdate = {"wifi","param","info","update","exit"};
std::vector<const char *> _menuIdsDefault = {"wifi","info","exit","sep","update"};
// ip configs @todo struct ?
IPAddress _ap_static_ip;
IPAddress _ap_static_gw;
IPAddress _ap_static_sn;
IPAddress _sta_static_ip;
IPAddress _sta_static_gw;
IPAddress _sta_static_sn;
IPAddress _sta_static_dns;
unsigned long _configPortalStart = 0; // ms config portal start time (updated for timeouts)
unsigned long _webPortalAccessed = 0; // ms last web access time
uint8_t _lastconxresult = WL_IDLE_STATUS; // store last result when doing connect operations
int _numNetworks = 0; // init index for numnetworks wifiscans
unsigned long _lastscan = 0; // ms for timing wifi scans
unsigned long _startscan = 0; // ms for timing wifi scans
unsigned long _startconn = 0; // ms for timing wifi connects
// defaults
const uint8_t DNS_PORT = 53;
String _apName = "no-net";
String _apPassword = "";
String _ssid = ""; // var temp ssid
String _pass = ""; // var temp psk
String _defaultssid = ""; // preload ssid
String _defaultpass = ""; // preload pass
// options flags
unsigned long _configPortalTimeout = 0; // ms close config portal loop if set (depending on _cp/webClientCheck options)
unsigned long _connectTimeout = 0; // ms stop trying to connect to ap if set
unsigned long _saveTimeout = 0; // ms stop trying to connect to ap on saves, in case bugs in esp waitforconnectresult
WiFiMode_t _usermode = WIFI_STA; // Default user mode
String _wifissidprefix = FPSTR(S_ssidpre); // auto apname prefix prefix+chipid
int _cpclosedelay = 2000; // delay before wifisave, prevents captive portal from closing to fast.
bool _cleanConnect = false; // disconnect before connect in connectwifi, increases stability on connects
bool _connectonsave = true; // connect to wifi when saving creds
bool _disableSTA = false; // disable sta when starting ap, always
bool _disableSTAConn = true; // disable sta when starting ap, if sta is not connected ( stability )
bool _channelSync = false; // use same wifi sta channel when starting ap
int32_t _apChannel = 0; // default channel to use for ap, 0 for auto
bool _apHidden = false; // store softap hidden value
uint16_t _httpPort = 80; // port for webserver
// uint8_t _retryCount = 0; // counter for retries, probably not needed if synchronous
uint8_t _connectRetries = 1; // number of sta connect retries, force reconnect, wait loop (connectimeout) does not always work and first disconnect bails
bool _aggresiveReconn = false; // use an agrressive reconnect strategy, WILL delay conxs
// on some conn failure modes will add delays and many retries to work around esp and ap bugs, ie, anti de-auth protections
// https://github.com/tzapu/WiFiManager/issues/1067
bool _allowExit = true; // allow exit in nonblocking, else user exit/abort calls will be ignored including cptimeout
#ifdef ESP32
wifi_event_id_t wm_event_id = 0;
static uint8_t _lastconxresulttmp; // tmp var for esp32 callback
#endif
#ifndef WL_STATION_WRONG_PASSWORD
uint8_t WL_STATION_WRONG_PASSWORD = 7; // @kludge define a WL status for wrong password
#endif
// parameter options
int _minimumQuality = -1; // filter wifiscan ap by this rssi
int _staShowStaticFields = 0; // ternary 1=always show static ip fields, 0=only if set, -1=never(cannot change ips via web!)
int _staShowDns = 0; // ternary 1=always show dns, 0=only if set, -1=never(cannot change dns via web!)
boolean _removeDuplicateAPs = true; // remove dup aps from wifiscan
boolean _showPassword = false; // show or hide saved password on wifi form, might be a security issue!
boolean _shouldBreakAfterConfig = false; // stop configportal on save failure
boolean _configPortalIsBlocking = true; // configportal enters blocking loop
boolean _enableCaptivePortal = true; // enable captive portal redirection
boolean _userpersistent = true; // users preffered persistence to restore
boolean _wifiAutoReconnect = true; // there is no platform getter for this, we must assume its true and make it so
boolean _apClientCheck = false; // keep cp alive if ap have station
boolean _webClientCheck = true; // keep cp alive if web have client
boolean _scanDispOptions = false; // show percentage in scans not icons
boolean _paramsInWifi = true; // show custom parameters on wifi page
boolean _showInfoErase = true; // info page erase button
boolean _showInfoUpdate = true; // info page update button
boolean _showBack = false; // show back button
boolean _enableConfigPortal = true; // FOR autoconnect - start config portal if autoconnect failed
boolean _disableConfigPortal = true; // FOR autoconnect - stop config portal if cp wifi save
String _hostname = ""; // hostname for esp8266 for dhcp, and or MDNS
const char* _customHeadElement = ""; // store custom head element html from user inside <head>
const char* _customBodyHeader = ""; // store custom top body element html from user inside <body>
const char* _customBodyFooter = ""; // store custom bottom body element html from user inside <body>
const char* _customMenuHTML = ""; // store custom menu html from user
String _bodyClass = ""; // class to add to body
String _title = FPSTR(S_brand); // app title - default WiFiManager
// internal options
// wifiscan notes
// currently disabled due to issues with caching, sometimes first scan is empty esp32 wifi not init yet race, or portals hit server nonstop flood
// The following are background wifi scanning optimizations
// experimental to make scans faster, preload scans after starting cp, and visiting home page, so when you click wifi its already has your list
// ideally we would add async and xhr here but I am holding off on js requirements atm
// might be slightly buggy since captive portals hammer the home page, @todo workaround this somehow.
// cache time helps throttle this
// async enables asyncronous scans, so they do not block anything
// the refresh button bypasses cache
// no aps found is problematic as scans are always going to want to run, leading to page load delays
//
// These settings really only make sense with _preloadwifiscan true
// but not limited to, we could run continuous background scans on various page hits, or xhr hits
// which would be better coupled with asyncscan
// atm preload is only done on root hit and startcp
//
// preload scanning causes AP to delay showing for users, but also caches and lets the cp load faster once its open
// my scan takes 7-10 seconds
public:
boolean _preloadwifiscan = false; // preload wifiscan if true
unsigned int _scancachetime = 30000; // ms cache time for preload scans
boolean _asyncScan = false; // perform wifi network scan async
protected:
boolean _autoforcerescan = false; // automatically force rescan if scan networks is 0, ignoring cache
boolean _disableIpFields = false; // modify function of setShow_X_Fields(false), forces ip fields off instead of default show if set, eg. _staShowStaticFields=-1
String _wificountry = ""; // country code, @todo define in strings lang
// wrapper functions for handling setting and unsetting persistent for now.
bool esp32persistent = false;
bool _hasBegun = false; // flag wm loaded,unloaded
void _begin();
void _end();
void setupConfigPortal();
bool shutdownConfigPortal();
bool setupHostname(bool restart);
#ifdef NO_EXTRA_4K_HEAP
boolean _tryWPS = false; // try WPS on save failure, unsupported
void startWPS();
#endif
int _eepromStart;
const char* _apName = "no-net";
const char* _apPassword = NULL;
String _ssid = "";
String _pass = "";
unsigned long timeout = 0;
unsigned long start = 0;
IPAddress _ip;
IPAddress _gw;
IPAddress _sn;
int _paramsCount = 0;
int _minimumQuality = -1;
bool startAP();
void setupDNSD();
void setupHTTPServer();
//String getEEPROMString(int start, int len);
//void setEEPROMString(int start, int len, String string);
uint8_t connectWifi(String ssid, String pass, bool connect = true);
bool setSTAConfig();
bool wifiConnectDefault();
bool wifiConnectNew(String ssid, String pass,bool connect = true);
int status = WL_IDLE_STATUS;
int connectWifi(String ssid, String pass);
uint8_t waitForConnectResult();
uint8_t waitForConnectResult(uint32_t timeout);
void updateConxResult(uint8_t status);
// webserver handlers
public:
void handleNotFound();
protected:
void HTTPSend(const String &content);
void handleRoot();
void handleWifi(boolean scan);
void handleWifiSave();
void handleNotFound();
void handle204();
void handleInfo();
void handleReset();
void handleExit();
void handleClose();
// void handleErase();
void handleErase(boolean opt);
void handleParam();
void handleWiFiStatus();
void handleRequest();
void handleParamSave();
void doParamSave();
boolean captivePortal();
boolean configPortalHasTimeout();
uint8_t processConfigPortal();
void stopCaptivePortal();
// OTA Update handler
void handleUpdate();
void handleUpdating();
void handleUpdateDone();
// DNS server
const byte DNS_PORT = 53;
// wifi platform abstractions
bool WiFi_Mode(WiFiMode_t m);
bool WiFi_Mode(WiFiMode_t m,bool persistent);
bool WiFi_Disconnect();
bool WiFi_enableSTA(bool enable);
bool WiFi_enableSTA(bool enable,bool persistent);
bool WiFi_eraseConfig();
uint8_t WiFi_softap_num_stations();
bool WiFi_hasAutoConnect();
void WiFi_autoReconnect();
String WiFi_SSID(bool persistent = true) const;
String WiFi_psk(bool persistent = true) const;
bool WiFi_scanNetworks();
bool WiFi_scanNetworks(bool force,bool async);
bool WiFi_scanNetworks(unsigned int cachetime,bool async);
bool WiFi_scanNetworks(unsigned int cachetime);
void WiFi_scanComplete(int networksFound);
bool WiFiSetCountry();
#ifdef ESP32
// check for arduino or system event system, handle esp32 arduino v2 and IDF
#if defined(ESP_ARDUINO_VERSION) && defined(ESP_ARDUINO_VERSION_VAL)
#define WM_ARDUINOVERCHECK ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0)
#define WM_ARDUINOVERCHECK_204 ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 5)
#ifdef WM_ARDUINOVERCHECK
#define WM_ARDUINOEVENTS
#else
#define WM_NOSOFTAPSSID
#define WM_NOCOUNTRY
#endif
#ifdef WM_ARDUINOVERCHECK_204
#define WM_DISCONWORKAROUND
#endif
#else
#define WM_NOCOUNTRY
#endif
#ifdef WM_NOCOUNTRY
#warning "ESP32 set country unavailable"
#endif
#ifdef WM_ARDUINOEVENTS
void WiFiEvent(WiFiEvent_t event, arduino_event_info_t info);
#else
void WiFiEvent(WiFiEvent_t event, system_event_info_t info);
#endif
#endif
// output helpers
String getParamOut();
String getIpForm(String id, String title, String value);
String getScanItemOut();
String getStaticOut();
String getHTTPHead(String title, String classes = "");
String getHTTPEnd();
String getMenuOut();
//helpers
int getRSSIasQuality(int RSSI);
boolean isIp(String str);
String toStringIp(IPAddress ip);
boolean validApPassword();
String encryptionTypeStr(uint8_t authmode);
void reportStatus(String &page);
String getInfoData(String id);
boolean connect;
boolean _debug = true;
// flags
boolean connect = false;
boolean abort = false;
boolean reset = false;
boolean configPortalActive = false;
void (*_apcallback)(WiFiManager*) = NULL;
void (*_savecallback)(void) = NULL;
WiFiManagerParameter* _params[WIFI_MANAGER_MAX_PARAMS];
// these are state flags for portal mode, we are either in webportal mode(STA) or configportal mode(AP)
// these are mutually exclusive as STA+AP mode is not supported due to channel restrictions and stability
// if we decide to support this, these checks will need to be replaced with something client aware to check if client origin is ap or web
// These state checks are critical and used for internal function checks
boolean webPortalActive = false;
boolean portalTimeoutResult = false;
boolean portalAbortResult = false;
boolean storeSTAmode = true; // option store persistent STA mode in connectwifi
int timer = 0; // timer for debug throttle for numclients, and portal timeout messages
// WiFiManagerParameter
int _paramsCount = 0;
int _max_params;
WiFiManagerParameter** _params = NULL;
boolean _debug = true;
String _debugPrefix = FPSTR(S_debugPrefix);
wm_debuglevel_t debugLvlShow = WM_DEBUG_VERBOSE; // at which level start showing [n] level tags
// build debuglevel support
// @todo use DEBUG_ESP_x?
// Set default debug level
#ifndef WM_DEBUG_LEVEL
#define WM_DEBUG_LEVEL WM_DEBUG_NOTIFY
#endif
// override debug level OFF
#ifdef WM_NODEBUG
#undef WM_DEBUG_LEVEL
#endif
#ifdef WM_DEBUG_LEVEL
uint8_t _debugLevel = (uint8_t)WM_DEBUG_LEVEL;
#else
uint8_t _debugLevel = 0; // default debug level
#endif
// @todo use DEBUG_ESP_PORT ?
#ifdef WM_DEBUG_PORT
Print& _debugPort = WM_DEBUG_PORT;
#else
Print& _debugPort = Serial; // debug output stream ref
#endif
template <typename Generic>
void DEBUG_WM(Generic text);
void DEBUG_WM(Generic text);
template <typename Generic>
void DEBUG_WM(wm_debuglevel_t level,Generic text);
template <typename Generic, typename Genericb>
void DEBUG_WM(Generic text,Genericb textb);
template <typename Generic, typename Genericb>
void DEBUG_WM(wm_debuglevel_t level, Generic text,Genericb textb);
// callbacks
// @todo use cb list (vector) maybe event ids, allow no return value
std::function<void(WiFiManager*)> _apcallback;
std::function<void()> _webservercallback;
std::function<void()> _savewificallback;
std::function<void()> _presavewificallback;
std::function<void()> _presaveparamscallback;
std::function<void()> _saveparamscallback;
std::function<void()> _resetcallback;
std::function<void()> _preotaupdatecallback;
std::function<void()> _configportaltimeoutcallback;
template <class T>
auto optionalIPFromString(T *obj, const char *s) -> decltype( obj->fromString(s) ) {
return obj->fromString(s);
}
auto optionalIPFromString(...) -> bool {
// DEBUG_WM("NO fromString METHOD ON IPAddress, you need ESP8266 core 2.1.0 or newer for Custom IP configuration to work.");
return false;
}
};
#endif
#endif
+141
View File
@@ -0,0 +1,141 @@
/**
* WiFiManager advanced demo, contains advanced configurartion options
* Implements TRIGGEN_PIN button press, press for ondemand configportal, hold for 3 seconds for reset settings.
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#define TRIGGER_PIN 0
// wifimanager can run in a blocking mode or a non blocking mode
// Be sure to know how to process loops with no delay() if using non blocking
bool wm_nonblocking = false; // change to true to use non blocking
WiFiManager wm; // global wm instance
WiFiManagerParameter custom_field; // global param ( for non blocking w params )
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
Serial.begin(115200);
Serial.setDebugOutput(true);
delay(3000);
Serial.println("\n Starting");
pinMode(TRIGGER_PIN, INPUT);
// wm.resetSettings(); // wipe settings
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
// add a custom input field
int customFieldLength = 40;
// new (&custom_field) WiFiManagerParameter("customfieldid", "Custom Field Label", "Custom Field Value", customFieldLength,"placeholder=\"Custom Field Placeholder\"");
// test custom html input type(checkbox)
// new (&custom_field) WiFiManagerParameter("customfieldid", "Custom Field Label", "Custom Field Value", customFieldLength,"placeholder=\"Custom Field Placeholder\" type=\"checkbox\""); // custom html type
// test custom html(radio)
const char* custom_radio_str = "<br/><label for='customfieldid'>Custom Field Label</label><input type='radio' name='customfieldid' value='1' checked> One<br><input type='radio' name='customfieldid' value='2'> Two<br><input type='radio' name='customfieldid' value='3'> Three";
new (&custom_field) WiFiManagerParameter(custom_radio_str); // custom html input
wm.addParameter(&custom_field);
wm.setSaveParamsCallback(saveParamCallback);
// custom menu via array or vector
//
// menu tokens, "wifi","wifinoscan","info","param","close","sep","erase","restart","exit" (sep is seperator) (if param is in menu, params will not show up in wifi page!)
// const char* menu[] = {"wifi","info","param","sep","restart","exit"};
// wm.setMenu(menu,6);
std::vector<const char *> menu = {"wifi","info","param","sep","restart","exit"};
wm.setMenu(menu);
// set dark theme
wm.setClass("invert");
//set static ip
// wm.setSTAStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); // set static ip,gw,sn
// wm.setShowStaticFields(true); // force show static ip fields
// wm.setShowDnsFields(true); // force show dns field always
// wm.setConnectTimeout(20); // how long to try to connect for before continuing
wm.setConfigPortalTimeout(30); // auto close configportal after n seconds
// wm.setCaptivePortalEnable(false); // disable captive portal redirection
// wm.setAPClientCheck(true); // avoid timeout if client connected to softap
// wifi scan settings
// wm.setRemoveDuplicateAPs(false); // do not remove duplicate ap names (true)
// wm.setMinimumSignalQuality(20); // set min RSSI (percentage) to show in scans, null = 8%
// wm.setShowInfoErase(false); // do not show erase button on info page
// wm.setScanDispPerc(true); // show RSSI as percentage not graph icons
// wm.setBreakAfterConfig(true); // always exit configportal even if wifi save fails
bool res;
// res = wm.autoConnect(); // auto generated AP name from chipid
// res = wm.autoConnect("AutoConnectAP"); // anonymous ap
res = wm.autoConnect("AutoConnectAP","password"); // password protected ap
if(!res) {
Serial.println("Failed to connect or hit timeout");
// ESP.restart();
}
else {
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
}
void checkButton(){
// check for button press
if ( digitalRead(TRIGGER_PIN) == LOW ) {
// poor mans debounce/press-hold, code not ideal for production
delay(50);
if( digitalRead(TRIGGER_PIN) == LOW ){
Serial.println("Button Pressed");
// still holding button for 3000 ms, reset settings, code not ideaa for production
delay(3000); // reset delay hold
if( digitalRead(TRIGGER_PIN) == LOW ){
Serial.println("Button Held");
Serial.println("Erasing Config, restarting");
wm.resetSettings();
ESP.restart();
}
// start portal w delay
Serial.println("Starting config portal");
wm.setConfigPortalTimeout(120);
if (!wm.startConfigPortal("OnDemandAP","password")) {
Serial.println("failed to connect or hit timeout");
delay(3000);
// ESP.restart();
} else {
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
}
}
}
String getParam(String name){
//read parameter from server, for customhmtl input
String value;
if(wm.server->hasArg(name)) {
value = wm.server->arg(name);
}
return value;
}
void saveParamCallback(){
Serial.println("[CALLBACK] saveParamCallback fired");
Serial.println("PARAM customfieldid = " + getParam("customfieldid"));
}
void loop() {
if(wm_nonblocking) wm.process(); // avoid delays() in loop when non-blocking and other long running code
checkButton();
// put your main code here, to run repeatedly:
}
-38
View File
@@ -1,38 +0,0 @@
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
//reset saved settings
//wifiManager.resetSettings();
//set custom ip for portal
//wifiManager.setAPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
//fetches ssid and pass from eeprom and tries to connect
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
wifiManager.autoConnect("AutoConnectAP");
//or use this for auto generated name ESP + ChipID
//wifiManager.autoConnect();
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
void loop() {
// put your main code here, to run repeatedly:
}
+41
View File
@@ -0,0 +1,41 @@
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
void setup() {
// WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// it is a good practice to make sure your code sets wifi mode how you want it.
// put your setup code here, to run once:
Serial.begin(115200);
//WiFiManager, Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wm;
// reset settings - wipe stored credentials for testing
// these are stored by the esp library
// wm.resetSettings();
// Automatically connect using saved credentials,
// if connection fails, it starts an access point with the specified name ( "AutoConnectAP"),
// if empty will auto generate SSID, if password is blank it will be anonymous AP (wm.autoConnect())
// then goes into a blocking loop awaiting configuration and will return success result
bool res;
// res = wm.autoConnect(); // auto generated AP name from chipid
// res = wm.autoConnect("AutoConnectAP"); // anonymous ap
res = wm.autoConnect("AutoConnectAP","password"); // password protected ap
if(!res) {
Serial.println("Failed to connect");
// ESP.restart();
}
else {
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
}
void loop() {
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,27 @@
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
WiFiManager wm;
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// put your setup code here, to run once:
Serial.begin(115200);
//reset settings - wipe credentials for testing
//wm.resetSettings();
wm.setConfigPortalBlocking(false);
wm.setConfigPortalTimeout(60);
//automatically connect using saved credentials if they exist
//If connection fails it starts an access point with the specified name
if(wm.autoConnect("AutoConnectAP")){
Serial.println("connected...yeey :)");
}
else {
Serial.println("Configportal running");
}
}
void loop() {
wm.process();
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,36 @@
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
WiFiManager wm;
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", "", 40);
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// put your setup code here, to run once:
Serial.begin(115200);
//reset settings - wipe credentials for testing
//wm.resetSettings();
wm.addParameter(&custom_mqtt_server);
wm.setConfigPortalBlocking(false);
wm.setSaveParamsCallback(saveParamsCallback);
//automatically connect using saved credentials if they exist
//If connection fails it starts an access point with the specified name
if(wm.autoConnect("AutoConnectAP")){
Serial.println("connected...yeey :)");
}
else {
Serial.println("Configportal running");
}
}
void loop() {
wm.process();
// put your main code here, to run repeatedly:
}
void saveParamsCallback () {
Serial.println("Get Params:");
Serial.print(custom_mqtt_server.getID());
Serial.print(" : ");
Serial.println(custom_mqtt_server.getValue());
}
@@ -0,0 +1,85 @@
/**
* OnDemandNonBlocking.ino
* example of running the webportal or configportal manually and non blocking
* trigger pin will start a webportal for 120 seconds then turn it off.
* startAP = true will start both the configportal AP and webportal
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
// include MDNS
#ifdef ESP8266
#include <ESP8266mDNS.h>
#elif defined(ESP32)
#include <ESPmDNS.h>
#endif
// select which pin will trigger the configuration portal when set to LOW
#define TRIGGER_PIN 0
WiFiManager wm;
unsigned int timeout = 120; // seconds to run for
unsigned int startTime = millis();
bool portalRunning = false;
bool startAP = false; // start AP and webserver if true, else start only webserver
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// put your setup code here, to run once
Serial.begin(115200);
Serial.setDebugOutput(true);
delay(1000);
Serial.println("\n Starting");
pinMode(TRIGGER_PIN, INPUT_PULLUP);
// wm.resetSettings();
wm.setHostname("MDNSEXAMPLE");
// wm.setEnableConfigPortal(false);
// wm.setConfigPortalBlocking(false);
wm.autoConnect();
}
void loop() {
#ifdef ESP8266
MDNS.update();
#endif
doWiFiManager();
// put your main code here, to run repeatedly:
}
void doWiFiManager(){
// is auto timeout portal running
if(portalRunning){
wm.process(); // do processing
// check for timeout
if((millis()-startTime) > (timeout*1000)){
Serial.println("portaltimeout");
portalRunning = false;
if(startAP){
wm.stopConfigPortal();
}
else{
wm.stopWebPortal();
}
}
}
// is configuration portal requested?
if(digitalRead(TRIGGER_PIN) == LOW && (!portalRunning)) {
if(startAP){
Serial.println("Button Pressed, Starting Config Portal");
wm.setConfigPortalBlocking(false);
wm.startConfigPortal();
}
else{
Serial.println("Button Pressed, Starting Web Portal");
wm.startWebPortal();
}
portalRunning = true;
startTime = millis();
}
}
@@ -1,9 +1,4 @@
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include "WiFiManager.h" //https://github.com/tzapu/WiFiManager
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
void configModeCallback (WiFiManager *myWiFiManager) {
Serial.println("Entered config mode");
@@ -32,7 +27,7 @@ void setup() {
if(!wifiManager.autoConnect()) {
Serial.println("failed to connect and hit timeout");
//reset and try again, or maybe put it to deep sleep
ESP.reset();
ESP.restart();
delay(1000);
}
@@ -0,0 +1,43 @@
#include <FS.h> // this needs to be first, or it all crashes and burns...
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println();
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
//exit after config instead of connecting
wifiManager.setBreakAfterConfig(true);
//reset settings - for testing
//wifiManager.resetSettings();
//tries to connect to last known settings
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP" with password "password"
//and goes into a blocking loop awaiting configuration
if (!wifiManager.autoConnect("AutoConnectAP", "password")) {
Serial.println("failed to connect, we should reset as see if it connects");
delay(3000);
ESP.restart();
delay(5000);
}
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
Serial.println("local ip");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,71 @@
#include <FS.h> // this needs to be first, or it all crashes and burns...
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
/**************************************************************************************
* this example shows how to set a static IP configuration for the ESP
* although the IP shows in the config portal, the changes will revert
* to the IP set in the source file.
* if you want the ability to configure and persist the new IP configuration
* look at the FS examples, which save the config to file
*************************************************************************************/
//default custom static IP
//char static_ip[16] = "10.0.1.59";
//char static_gw[16] = "10.0.1.1";
//char static_sn[16] = "255.255.255.0";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println();
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
//reset settings - for testing
//wifiManager.resetSettings();
//set static ip
//block1 should be used for ESP8266 core 2.1.0 or newer, otherwise use block2
//start-block1
//IPAddress _ip,_gw,_sn;
//_ip.fromString(static_ip);
//_gw.fromString(static_gw);
//_sn.fromString(static_sn);
//end-block1
//start-block2
IPAddress _ip = IPAddress(10, 0, 1, 78);
IPAddress _gw = IPAddress(10, 0, 1, 1);
IPAddress _sn = IPAddress(255, 255, 255, 0);
//end-block2
wifiManager.setSTAStaticIPConfig(_ip, _gw, _sn);
//tries to connect to last known settings
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP" with password "password"
//and goes into a blocking loop awaiting configuration
if (!wifiManager.autoConnect("AutoConnectAP", "password")) {
Serial.println("failed to connect, we should reset as see if it connects");
delay(3000);
ESP.restart();
delay(5000);
}
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
Serial.println("local ip");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}
@@ -1,11 +1,4 @@
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
void setup() {
// put your setup code here, to run once:
@@ -20,7 +13,7 @@ void setup() {
//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep
//in seconds
wifiManager.setTimeout(180);
wifiManager.setConfigPortalTimeout(180);
//fetches ssid and pass and tries to connect
//if it does not connect it starts an access point with the specified name
@@ -30,7 +23,7 @@ void setup() {
Serial.println("failed to connect and hit timeout");
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.reset();
ESP.restart();
delay(5000);
}
@@ -0,0 +1,47 @@
/**
* OnDemandConfigPortal.ino
* example of running the configPortal AP manually, independantly from the captiveportal
* trigger pin will start a configPortal AP for 120 seconds then turn it off.
*
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
// select which pin will trigger the configuration portal when set to LOW
#define TRIGGER_PIN 0
int timeout = 120; // seconds to run for
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("\n Starting");
pinMode(TRIGGER_PIN, INPUT_PULLUP);
}
void loop() {
// is configuration portal requested?
if ( digitalRead(TRIGGER_PIN) == LOW) {
WiFiManager wm;
//reset settings - for testing
//wm.resetSettings();
// set configportal timeout
wm.setConfigPortalTimeout(timeout);
if (!wm.startConfigPortal("OnDemandAP")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.restart();
delay(5000);
}
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,51 @@
/**
* OnDemandWebPortal.ino
* example of running the webportal (always NON blocking)
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
// select which pin will trigger the configuration portal when set to LOW
#define TRIGGER_PIN 0
WiFiManager wm;
bool portalRunning = false;
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// put your setup code here, to run once
Serial.begin(115200);
Serial.println("\n Starting");
pinMode(TRIGGER_PIN, INPUT_PULLUP);
}
void loop() {
checkButton();
// put your main code here, to run repeatedly:
}
void checkButton(){
// is auto timeout portal running
if(portalRunning){
wm.process();
}
// is configuration portal requested?
if(digitalRead(TRIGGER_PIN) == LOW) {
delay(50);
if(digitalRead(TRIGGER_PIN) == LOW) {
if(!portalRunning){
Serial.println("Button Pressed, Starting Portal");
wm.startWebPortal();
portalRunning = true;
}
else{
Serial.println("Button Pressed, Stopping Portal");
wm.stopWebPortal();
portalRunning = false;
}
}
}
}
@@ -1,60 +0,0 @@
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
// select wich pin will trigger the configuraton portal when set to LOW
// ESP-01 users please note: the only pins available (0 and 2), are shared
// with the bootloader, so always set them HIGH at power-up
#define TRIGGER_PIN 0
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("\n Starting");
pinMode(TRIGGER_PIN, INPUT);
}
void loop() {
// is configuration portal requested?
if ( digitalRead(TRIGGER_PIN) == LOW ) {
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
//reset settings - for testing
//wifiManager.resetSettings();
//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep
//in seconds
//wifiManager.setTimeout(120);
//it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
//WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1
//WiFi.mode(WIFI_STA);
if (!wifiManager.startConfigPortal("OnDemandAP")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.reset();
delay(5000);
}
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,79 @@
/**
* Basic example using LittleFS to store data
*/
#include <Arduino.h>
#include <LittleFS.h>
#include <FS.h>
String readFile(fs::FS &fs, const char * path){
Serial.printf("Reading file: %s\r\n", path);
File file = fs.open(path, "r");
if(!file || file.isDirectory()){
Serial.println("- empty file or failed to open file");
return String();
}
Serial.println("- read from file:");
String fileContent;
while(file.available()){
fileContent+=String((char)file.read());
}
file.close();
Serial.println(fileContent);
return fileContent;
}
void writeFile(fs::FS &fs, const char * path, const char * message){
Serial.printf("Writing file: %s\r\n", path);
File file = fs.open(path, "w");
if(!file){
Serial.println("- failed to open file for writing");
return;
}
if(file.print(message)){
Serial.println("- file written");
} else {
Serial.println("- write failed");
}
file.close();
}
int data = 4;
#include <WiFiManager.h>
#define TRIGGER_PIN 2
int timeout = 120; // seconds to run for
void setup() {
if (!LittleFS.begin()) { //to start littlefs
Serial.println("LittleFS mount failed");
return;
}
data = readFile(LittleFS, "/data.txt").toInt();
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
// put your setup code here, to run once:
pinMode(TRIGGER_PIN, INPUT_PULLUP);
WiFiManager wm;
//wm.resetSettings();
bool res;
res = wm.autoConnect("Setup");
if(!res) {
Serial.println("Failed to connect");
// ESP.restart();
}
}
void loop() {
if ( digitalRead(TRIGGER_PIN) == LOW) {
WiFiManager wm;
//wm.resetSettings();
wm.setConfigPortalTimeout(timeout);
if (!wm.startConfigPortal("Sharmander")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
ESP.restart();
delay(5000);
}
Serial.println("connected...yeey :)");
}
}
@@ -1,18 +1,16 @@
#include <FS.h> //this needs to be first, or it all crashes and burns...
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#ifdef ESP32
#include <SPIFFS.h>
#endif
#include <ArduinoJson.h> //https://github.com/bblanchon/ArduinoJson
//define your default values here, if there are different values in config.json, they are overwritten.
const char *mqtt_server = NULL;
const char *mqtt_port = "8080";
const char *blynk_token = "YOUR_BLYNK_TOKEN";
char mqtt_server[40];
char mqtt_port[6] = "8080";
char api_token[34] = "YOUR_API_TOKEN";
//flag for saving data
bool shouldSaveConfig = false;
@@ -23,7 +21,6 @@ void saveConfigCallback () {
shouldSaveConfig = true;
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
@@ -48,18 +45,26 @@ void setup() {
std::unique_ptr<char[]> buf(new char[size]);
configFile.readBytes(buf.get(), size);
StaticJsonBuffer<200> jsonBuffer;
#if defined(ARDUINOJSON_VERSION_MAJOR) && ARDUINOJSON_VERSION_MAJOR >= 6
DynamicJsonDocument json(1024);
auto deserializeError = deserializeJson(json, buf.get());
serializeJson(json, Serial);
if ( ! deserializeError ) {
#else
DynamicJsonBuffer jsonBuffer;
JsonObject& json = jsonBuffer.parseObject(buf.get());
json.printTo(Serial);
if (json.success()) {
#endif
Serial.println("\nparsed json");
mqtt_server = json["mqtt_server"];
mqtt_port = json["mqtt_port"];
blynk_token = json["blynk_token"];
strcpy(mqtt_server, json["mqtt_server"]);
strcpy(mqtt_port, json["mqtt_port"]);
strcpy(api_token, json["api_token"]);
} else {
Serial.println("failed to load json config");
}
configFile.close();
}
}
} else {
@@ -67,14 +72,12 @@ void setup() {
}
//end read
// The extra parameters to be configured (can be either global or just in the setup)
// After connecting, parameter.getValue() will get you the configured value
// id/name placeholder/prompt default length
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 40);
WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port, 8);
WiFiManagerParameter custom_blynk_token("blynk", "blynk token", blynk_token, 32);
WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port, 6);
WiFiManagerParameter custom_api_token("apikey", "API token", api_token, 32);
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
@@ -83,18 +86,21 @@ void setup() {
//set config save notify callback
wifiManager.setSaveConfigCallback(saveConfigCallback);
//set static ip
wifiManager.setSTAStaticIPConfig(IPAddress(10, 0, 1, 99), IPAddress(10, 0, 1, 1), IPAddress(255, 255, 255, 0));
//add all your parameters here
wifiManager.addParameter(&custom_mqtt_server);
wifiManager.addParameter(&custom_mqtt_port);
wifiManager.addParameter(&custom_blynk_token);
wifiManager.addParameter(&custom_api_token);
//reset settings - for testing
wifiManager.resetSettings();
//wifiManager.resetSettings();
//set minimu quality of signal so it ignores AP's under that quality
//defaults to 8%
wifiManager.setMinimumSignalQuality();
//wifiManager.setMinimumSignalQuality();
//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep
//in seconds
@@ -108,7 +114,7 @@ void setup() {
Serial.println("failed to connect and hit timeout");
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.reset();
ESP.restart();
delay(5000);
}
@@ -116,33 +122,48 @@ void setup() {
Serial.println("connected...yeey :)");
//read updated parameters
mqtt_server = custom_mqtt_server.getValue();
mqtt_port = custom_mqtt_port.getValue();
blynk_token = custom_blynk_token.getValue();
strcpy(mqtt_server, custom_mqtt_server.getValue());
strcpy(mqtt_port, custom_mqtt_port.getValue());
strcpy(api_token, custom_api_token.getValue());
Serial.println("The values in the file are: ");
Serial.println("\tmqtt_server : " + String(mqtt_server));
Serial.println("\tmqtt_port : " + String(mqtt_port));
Serial.println("\tapi_token : " + String(api_token));
//save the custom parameters to FS
if (shouldSaveConfig) {
Serial.println("saving config");
StaticJsonBuffer<200> jsonBuffer;
#if defined(ARDUINOJSON_VERSION_MAJOR) && ARDUINOJSON_VERSION_MAJOR >= 6
DynamicJsonDocument json(1024);
#else
DynamicJsonBuffer jsonBuffer;
JsonObject& json = jsonBuffer.createObject();
#endif
json["mqtt_server"] = mqtt_server;
json["mqtt_port"] = mqtt_port;
json["blynk_token"] = blynk_token;
json["api_token"] = api_token;
File configFile = SPIFFS.open("/config.json", "w");
if (!configFile) {
Serial.println("failed to open config file for writing");
}
#if defined(ARDUINOJSON_VERSION_MAJOR) && ARDUINOJSON_VERSION_MAJOR >= 6
serializeJson(json, Serial);
serializeJson(json, configFile);
#else
json.printTo(Serial);
json.printTo(configFile);
#endif
configFile.close();
//end save
}
Serial.println("local ip");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,194 @@
#include <FS.h> //this needs to be first, or it all crashes and burns...
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#ifdef ESP32
#include <SPIFFS.h>
#endif
#include <ArduinoJson.h> //https://github.com/bblanchon/ArduinoJson
//define your default values here, if there are different values in config.json, they are overwritten.
//length should be max size + 1
char mqtt_server[40];
char mqtt_port[6] = "8080";
char api_token[34] = "YOUR_APITOKEN";
//default custom static IP
char static_ip[16] = "10.0.1.56";
char static_gw[16] = "10.0.1.1";
char static_sn[16] = "255.255.255.0";
//flag for saving data
bool shouldSaveConfig = false;
//callback notifying us of the need to save config
void saveConfigCallback () {
Serial.println("Should save config");
shouldSaveConfig = true;
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println();
//clean FS, for testing
//SPIFFS.format();
//read configuration from FS json
Serial.println("mounting FS...");
if (SPIFFS.begin()) {
Serial.println("mounted file system");
if (SPIFFS.exists("/config.json")) {
//file exists, reading and loading
Serial.println("reading config file");
File configFile = SPIFFS.open("/config.json", "r");
if (configFile) {
Serial.println("opened config file");
size_t size = configFile.size();
// Allocate a buffer to store contents of the file.
std::unique_ptr<char[]> buf(new char[size]);
configFile.readBytes(buf.get(), size);
#if defined(ARDUINOJSON_VERSION_MAJOR) && ARDUINOJSON_VERSION_MAJOR >= 6
DynamicJsonDocument json(1024);
auto deserializeError = deserializeJson(json, buf.get());
serializeJson(json, Serial);
if ( ! deserializeError ) {
#else
DynamicJsonBuffer jsonBuffer;
JsonObject& json = jsonBuffer.parseObject(buf.get());
json.printTo(Serial);
if (json.success()) {
#endif
Serial.println("\nparsed json");
strcpy(mqtt_server, json["mqtt_server"]);
strcpy(mqtt_port, json["mqtt_port"]);
strcpy(api_token, json["api_token"]);
if (json["ip"]) {
Serial.println("setting custom ip from config");
strcpy(static_ip, json["ip"]);
strcpy(static_gw, json["gateway"]);
strcpy(static_sn, json["subnet"]);
Serial.println(static_ip);
} else {
Serial.println("no custom ip in config");
}
} else {
Serial.println("failed to load json config");
}
}
}
} else {
Serial.println("failed to mount FS");
}
//end read
Serial.println(static_ip);
Serial.println(api_token);
Serial.println(mqtt_server);
// The extra parameters to be configured (can be either global or just in the setup)
// After connecting, parameter.getValue() will get you the configured value
// id/name placeholder/prompt default length
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 40);
WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port, 5);
WiFiManagerParameter custom_api_token("apikey", "API token", api_token, 34);
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
//set config save notify callback
wifiManager.setSaveConfigCallback(saveConfigCallback);
//set static ip
IPAddress _ip, _gw, _sn;
_ip.fromString(static_ip);
_gw.fromString(static_gw);
_sn.fromString(static_sn);
wifiManager.setSTAStaticIPConfig(_ip, _gw, _sn);
//add all your parameters here
wifiManager.addParameter(&custom_mqtt_server);
wifiManager.addParameter(&custom_mqtt_port);
wifiManager.addParameter(&custom_api_token);
//reset settings - for testing
//wifiManager.resetSettings();
//set minimu quality of signal so it ignores AP's under that quality
//defaults to 8%
wifiManager.setMinimumSignalQuality();
//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep
//in seconds
//wifiManager.setTimeout(120);
//fetches ssid and pass and tries to connect
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
if (!wifiManager.autoConnect("AutoConnectAP", "password")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.restart();
delay(5000);
}
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
//read updated parameters
strcpy(mqtt_server, custom_mqtt_server.getValue());
strcpy(mqtt_port, custom_mqtt_port.getValue());
strcpy(api_token, custom_api_token.getValue());
//save the custom parameters to FS
if (shouldSaveConfig) {
Serial.println("saving config");
#if defined(ARDUINOJSON_VERSION_MAJOR) && ARDUINOJSON_VERSION_MAJOR >= 6
DynamicJsonDocument json(1024);
#else
DynamicJsonBuffer jsonBuffer;
JsonObject& json = jsonBuffer.createObject();
#endif
json["mqtt_server"] = mqtt_server;
json["mqtt_port"] = mqtt_port;
json["api_token"] = api_token;
json["ip"] = WiFi.localIP().toString();
json["gateway"] = WiFi.gatewayIP().toString();
json["subnet"] = WiFi.subnetMask().toString();
File configFile = SPIFFS.open("/config.json", "w");
if (!configFile) {
Serial.println("failed to open config file for writing");
}
#if defined(ARDUINOJSON_VERSION_MAJOR) && ARDUINOJSON_VERSION_MAJOR >= 6
serializeJson(json, Serial);
serializeJson(json, configFile);
#else
json.printTo(Serial);
json.printTo(configFile);
#endif
configFile.close();
//end save
}
Serial.println("local ip");
Serial.println(WiFi.localIP());
Serial.println(WiFi.gatewayIP());
Serial.println(WiFi.subnetMask());
}
void loop() {
// put your main code here, to run repeatedly:
}
@@ -0,0 +1,143 @@
/**
* WiFiManagerParameter child class example
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <Arduino.h>
#include <EEPROM.h>
#define SETUP_PIN 0
class IPAddressParameter : public WiFiManagerParameter {
public:
IPAddressParameter(const char *id, const char *placeholder, IPAddress address)
: WiFiManagerParameter("") {
init(id, placeholder, address.toString().c_str(), 16, "", WFM_LABEL_BEFORE);
}
bool getValue(IPAddress &ip) {
return ip.fromString(WiFiManagerParameter::getValue());
}
};
class IntParameter : public WiFiManagerParameter {
public:
IntParameter(const char *id, const char *placeholder, long value, const uint8_t length = 10)
: WiFiManagerParameter("") {
init(id, placeholder, String(value).c_str(), length, "", WFM_LABEL_BEFORE);
}
long getValue() {
return String(WiFiManagerParameter::getValue()).toInt();
}
};
class FloatParameter : public WiFiManagerParameter {
public:
FloatParameter(const char *id, const char *placeholder, float value, const uint8_t length = 10)
: WiFiManagerParameter("") {
init(id, placeholder, String(value).c_str(), length, "", WFM_LABEL_BEFORE);
}
float getValue() {
return String(WiFiManagerParameter::getValue()).toFloat();
}
};
struct Settings {
float f;
int i;
char s[20];
uint32_t ip;
} sett;
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
pinMode(SETUP_PIN, INPUT_PULLUP);
Serial.begin(115200);
//Delay to push SETUP button
Serial.println("Press setup button");
for (int sec = 3; sec > 0; sec--) {
Serial.print(sec);
Serial.print("..");
delay(1000);
}
// warning for example only, this will initialize empty memory into your vars
// always init flash memory or add some checksum bits
EEPROM.begin( 512 );
EEPROM.get(0, sett);
Serial.println("Settings loaded");
if (digitalRead(SETUP_PIN) == LOW) {
// Button pressed
Serial.println("SETUP");
WiFiManager wm;
sett.s[19] = '\0'; //add null terminator at the end cause overflow
WiFiManagerParameter param_str( "str", "param_string", sett.s, 20);
FloatParameter param_float( "float", "param_float", sett.f);
IntParameter param_int( "int", "param_int", sett.i);
IPAddress ip(sett.ip);
IPAddressParameter param_ip("ip", "param_ip", ip);
wm.addParameter( &param_str );
wm.addParameter( &param_float );
wm.addParameter( &param_int );
wm.addParameter( &param_ip );
//SSID & password parameters already included
wm.startConfigPortal();
strncpy(sett.s, param_str.getValue(), 20);
sett.s[19] = '\0';
sett.f = param_float.getValue();
sett.i = param_int.getValue();
Serial.print("String param: ");
Serial.println(sett.s);
Serial.print("Float param: ");
Serial.println(sett.f);
Serial.print("Int param: ");
Serial.println(sett.i, DEC);
if (param_ip.getValue(ip)) {
sett.ip = ip;
Serial.print("IP param: ");
Serial.println(ip);
} else {
Serial.println("Incorrect IP");
}
EEPROM.put(0, sett);
if (EEPROM.commit()) {
Serial.println("Settings saved");
} else {
Serial.println("EEPROM error");
}
}
else {
Serial.println("WORK");
//connect to saved SSID
WiFi.begin();
//do smth
Serial.print("String param: ");
Serial.println(sett.s);
Serial.print("Float param: ");
Serial.println(sett.f);
Serial.print("Int param: ");
Serial.println(sett.i, DEC);
Serial.print("IP param: ");
IPAddress ip(sett.ip);
Serial.println(ip);
}
}
void loop() {
}
@@ -0,0 +1,444 @@
/**
* This is a kind of unit test for DEV for now
* It contains many of the public methods
*
*/
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <time.h>
#include <stdio.h>
#define USEOTA
// enable OTA
#ifdef USEOTA
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#endif
const char* modes[] = { "NULL", "STA", "AP", "STA+AP" };
unsigned long mtime = 0;
WiFiManager wm;
// TEST OPTION FLAGS
bool TEST_CP = false; // always start the configportal, even if ap found
int TESP_CP_TIMEOUT = 90; // test cp timeout
bool TEST_NET = true; // do a network test after connect, (gets ntp time)
bool ALLOWONDEMAND = true; // enable on demand
int ONDDEMANDPIN = 0; // gpio for button
bool WMISBLOCKING = true; // use blocking or non blocking mode, non global params wont work in non blocking
uint8_t BUTTONFUNC = 1; // 0 resetsettings, 1 configportal, 2 autoconnect
// char ssid[] = "*************"; // your network SSID (name)
// char pass[] = "********"; // your network password
//callbacks
// called after AP mode and config portal has started
// setAPCallback( std::function<void(WiFiManager*)> func );
// called after webserver has started
// setWebServerCallback( std::function<void()> func );
// called when settings reset have been triggered
// setConfigResetCallback( std::function<void()> func );
// called when wifi settings have been changed and connection was successful ( or setBreakAfterConfig(true) )
// setSaveConfigCallback( std::function<void()> func );
// called when saving either params-in-wifi or params page
// setSaveParamsCallback( std::function<void()> func );
// called when saving params-in-wifi or params before anything else happens (eg wifi)
// setPreSaveConfigCallback( std::function<void()> func );
// called just before doing OTA update
// setPreOtaUpdateCallback( std::function<void()> func );
void saveWifiCallback(){
Serial.println("[CALLBACK] saveCallback fired");
}
//gets called when WiFiManager enters configuration mode
void configModeCallback (WiFiManager *myWiFiManager) {
Serial.println("[CALLBACK] configModeCallback fired");
// myWiFiManager->setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
// Serial.println(WiFi.softAPIP());
//if you used auto generated SSID, print it
// Serial.println(myWiFiManager->getConfigPortalSSID());
//
// esp_wifi_set_bandwidth(WIFI_IF_AP, WIFI_BW_HT20);
}
void saveParamCallback(){
Serial.println("[CALLBACK] saveParamCallback fired");
// wm.stopConfigPortal();
}
void bindServerCallback(){
wm.server->on("/custom",handleRoute);
// you can override wm route endpoints, I have not found a way to remove handlers, but this would let you disable them or add auth etc.
// wm.server->on("/info",handleNotFound);
// wm.server->on("/update",handleNotFound);
wm.server->on("/erase",handleNotFound); // disable erase
}
void handleRoute(){
Serial.println("[HTTP] handle custom route");
wm.server->send(200, "text/plain", "hello from user code");
}
void handleNotFound(){
Serial.println("[HTTP] override handle route");
wm.handleNotFound();
}
void handlePreOtaUpdateCallback(){
Update.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("CUSTOM Progress: %u%%\r", (progress / (total / 100)));
});
}
void setup() {
// WiFi.mode(WIFI_STA); // explicitly set mode, esp can default to STA+AP
// put your setup code here, to run once:
Serial.begin(115200);
delay(3000);
// Serial.setDebugOutput(true);
// WiFi.setTxPower(WIFI_POWER_8_5dBm);
Serial.println("\n Starting");
// WiFi.setSleepMode(WIFI_NONE_SLEEP); // disable sleep, can improve ap stability
Serial.println("Error - TEST");
Serial.println("Information- - TEST");
Serial.println("[ERROR] TEST");
Serial.println("[INFORMATION] TEST");
// WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); // wifi_scan_method_t scanMethod
// WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL); // wifi_sort_method_t sortMethod - WIFI_CONNECT_AP_BY_SIGNAL,WIFI_CONNECT_AP_BY_SECURITY
// WiFi.setMinSecurity(WIFI_AUTH_WPA2_PSK);
wm.setDebugOutput(true, WM_DEBUG_DEV);
wm.debugPlatformInfo();
//reset settings - for testing
// wm.resetSettings();
// wm.erase();
// setup some parameters
WiFiManagerParameter custom_html("<p style=\"color:pink;font-weight:Bold;\">This Is Custom HTML</p>"); // only custom html
WiFiManagerParameter custom_mqtt_server("server", "mqtt server", "", 40);
WiFiManagerParameter custom_mqtt_port("port", "mqtt port", "", 6);
WiFiManagerParameter custom_token("api_token", "api token", "", 16);
WiFiManagerParameter custom_tokenb("invalid token", "invalid token", "", 0); // id is invalid, cannot contain spaces
WiFiManagerParameter custom_ipaddress("input_ip", "input IP", "", 15,"pattern='\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}'"); // custom input attrs (ip mask)
WiFiManagerParameter custom_input_type("input_pwd", "input pass", "", 15,"type='password'"); // custom input attrs (ip mask)
const char _customHtml_checkbox[] = "type=\"checkbox\"";
WiFiManagerParameter custom_checkbox("my_checkbox", "My Checkbox", "T", 2, _customHtml_checkbox, WFM_LABEL_AFTER);
const char *bufferStr = R"(
<!-- INPUT CHOICE -->
<br/>
<p>Select Choice</p>
<input style='display: inline-block;' type='radio' id='choice1' name='program_selection' value='1'>
<label for='choice1'>Choice1</label><br/>
<input style='display: inline-block;' type='radio' id='choice2' name='program_selection' value='2'>
<label for='choice2'>Choice2</label><br/>
<!-- INPUT SELECT -->
<br/>
<label for='input_select'>Label for Input Select</label>
<select name="input_select" id="input_select" class="button">
<option value="0">Option 1</option>
<option value="1" selected>Option 2</option>
<option value="2">Option 3</option>
<option value="3">Option 4</option>
</select>
)";
WiFiManagerParameter custom_html_inputs(bufferStr);
// callbacks
wm.setAPCallback(configModeCallback);
wm.setWebServerCallback(bindServerCallback);
wm.setSaveConfigCallback(saveWifiCallback);
wm.setSaveParamsCallback(saveParamCallback);
wm.setPreOtaUpdateCallback(handlePreOtaUpdateCallback);
// add all your parameters here
wm.addParameter(&custom_html);
wm.addParameter(&custom_mqtt_server);
wm.addParameter(&custom_mqtt_port);
wm.addParameter(&custom_token);
wm.addParameter(&custom_tokenb);
wm.addParameter(&custom_ipaddress);
wm.addParameter(&custom_checkbox);
wm.addParameter(&custom_input_type);
wm.addParameter(&custom_html_inputs);
// set values later if you want
custom_html.setValue("test",4);
custom_token.setValue("test",4);
// const char* icon = "
// <link rel='icon' type='image/png' sizes='16x16' href='data:image/png;base64,
// iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAMFBMVEU0OkArMjhobHEoPUPFEBIu
// O0L+AAC2FBZ2JyuNICOfGx7xAwTjCAlCNTvVDA1aLzQ3COjMAAAAVUlEQVQI12NgwAaCDSA0888G
// CItjn0szWGBJTVoGSCjWs8TleQCQYV95evdxkFT8Kpe0PLDi5WfKd4LUsN5zS1sKFolt8bwAZrCa
// GqNYJAgFDEpQAAAzmxafI4vZWwAAAABJRU5ErkJggg==' />";
// set custom html head content , inside <head>
// examples of favicon, or meta tags etc
// const char* headhtml = "<link rel='icon' type='image/png' href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADQElEQVRoQ+2YjW0VQQyE7Q6gAkgFkAogFUAqgFQAVACpAKiAUAFQAaECQgWECggVGH1PPrRvn3dv9/YkFOksoUhhfzwz9ngvKrc89JbnLxuA/63gpsCmwCADWwkNEji8fVNgotDM7osI/x777x5l9F6JyB8R4eeVql4P0y8yNsjM7KGIPBORp558T04A+CwiH1UVUItiUQmZ2XMReSEiAFgjAPBeVS96D+sCYGaUx4cFbLfmhSpnqnrZuqEJgJnd8cQplVLciAgX//Cf0ToIeOB9wpmloLQAwpnVmAXgdf6pwjpJIz+XNoeZQQZlODV9vhc1Tuf6owrAk/8qIhFbJH7eI3eEzsvydQEICqBEkZwiALfF70HyHPpqScPV5HFjeFu476SkRA0AzOfy4hYwstj2ZkDgaphE7m6XqnoS7Q0BOPs/sw0kDROzjdXcCMFCNwzIy0EcRcOvBACfh4k0wgOmBX4xjfmk4DKTS31hgNWIKBCI8gdzogTgjYjQWFMw+o9LzJoZ63GUmjWm2wGDc7EvDDOj/1IVMIyD9SUAL0WEhpriRlXv5je5S+U1i2N88zdPuoVkeB+ls4SyxCoP3kVm9jsjpEsBLoOBNC5U9SwpGdakFkviuFP1keblATkTENTYcxkzgxTKOI3jyDxqLkQT87pMA++H3XvJBYtsNbBN6vuXq5S737WqHkW1VgMQNXJ0RshMqbbT33sJ5kpHWymzcJjNTeJIymJZtSQd9NHQHS1vodoFoTMkfbJzpRnLzB2vi6BZAJxWaCr+62BC+jzAxVJb3dmmiLzLwZhZNPE5e880Suo2AZgB8e8idxherqUPnT3brBDTlPxO3Z66rVwIwySXugdNd+5ejhqp/+NmgIwGX3Py3QBmlEi54KlwmjkOytQ+iJrLJj23S4GkOeecg8G091no737qvRRdzE+HLALQoMTBbJgBsCj5RSWUlUVJiZ4SOljb05eLFWgoJ5oY6yTyJp62D39jDANoKKcSocPJD5dQYzlFAFZJflUArgTPZKZwLXAnHmerfJquUkKZEgyzqOb5TuDt1P3nwxobqwPocZA11m4A1mBx5IxNgRH21ti7KbAGiyNn3HoF/gJ0w05A8xclpwAAAABJRU5ErkJggg==' />";
// const char* headhtml = "<meta name='color-scheme' content='dark light'><style></style><script></script>";
// wm.setCustomHeadElement(headhtml);
// set custom html menu content , inside menu item "custom", see setMenu()
const char* menuhtml = "<form action='/custom' method='get'><button>Custom</button></form><br/>\n";
wm.setCustomMenuHTML(menuhtml);
// invert theme, dark
wm.setDarkMode(true);
// show scan RSSI as percentage, instead of signal stength graphic
// wm.setScanDispPerc(true);
/*
Set cutom menu via menu[] or vector
const char* menu[] = {"wifi","wifinoscan","info","param","close","sep","erase","restart","exit"};
wm.setMenu(menu,9); // custom menu array must provide length
*/
std::vector<const char *> menu = {"wifi","wifinoscan","info","param","custom","close","sep","erase","update","restart","exit"};
// wm.setMenu(menu); // custom menu, pass vector
// wm.setParamsPage(true); // move params to seperate page, not wifi, do not combine with setmenu!
// set STA static ip
// wm.setSTAStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
// wm.setShowStaticFields(false);
// wm.setShowDnsFields(false);
// set AP static ip
// wm.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
// wm.setAPStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
// set country
// setting wifi country seems to improve OSX soft ap connectivity,
// may help others as well, default is CN which has different channels
// wm.setCountry("US"); // crashing on esp32 2.0
// set Hostname
// wm.setHostname(("WM_"+wm.getDefaultAPName()).c_str());
// wm.setHostname("WM_RANDO_1234");
// set custom channel
// wm.setWiFiAPChannel(13);
// set AP hidden
// wm.setAPHidden(true);
// show password publicly in form
// wm.setShowPassword(true);
// sets wether wm configportal is a blocking loop(legacy) or not, use wm.process() in loop if false
// wm.setConfigPortalBlocking(false);
if(!WMISBLOCKING){
wm.setConfigPortalBlocking(false);
}
//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep in seconds
wm.setConfigPortalTimeout(TESP_CP_TIMEOUT);
// set min quality to show in web list, default 8%
// wm.setMinimumSignalQuality(50);
// set connection timeout
// wm.setConnectTimeout(20);
// set wifi connect retries
// wm.setConnectRetries(2);
// connect after portal save toggle
// wm.setSaveConnect(false); // do not connect, only save
// show static ip fields
// wm.setShowStaticFields(true);
// wm.startConfigPortal("AutoConnectAP", "password");
// This is sometimes necessary, it is still unknown when and why this is needed but it may solve some race condition or bug in esp SDK/lib
// wm.setCleanConnect(true); // disconnect before connect, clean connect
wm.setBreakAfterConfig(true); // needed to use saveWifiCallback
// set custom webserver port, automatic captive portal does not work with custom ports!
// wm.setHttpPort(8080);
//fetches ssid and pass and tries to connect
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
// use autoconnect, but prevent configportal from auto starting
// wm.setEnableConfigPortal(false);
wifiInfo();
// to preload autoconnect with credentials
// wm.preloadWiFi("ssid","password");
if(!wm.autoConnect("WM_AutoConnectAP","12345678")) {
Serial.println("failed to connect and hit timeout");
}
else if(TEST_CP) {
// start configportal always
delay(1000);
Serial.println("TEST_CP ENABLED");
wm.setConfigPortalTimeout(TESP_CP_TIMEOUT);
wm.startConfigPortal("WM_ConnectAP","12345678");
}
else {
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
wifiInfo();
pinMode(ONDDEMANDPIN, INPUT_PULLUP);
#ifdef USEOTA
ArduinoOTA.begin();
#endif
}
void wifiInfo(){
// can contain gargbage on esp32 if wifi is not ready yet
Serial.println("[WIFI] WIFI_INFO DEBUG");
WiFi.printDiag(Serial);
Serial.println("[WIFI] MODE: " + (String)(wm.getModeString(WiFi.getMode())));
Serial.println("[WIFI] SAVED: " + (String)(wm.getWiFiIsSaved() ? "YES" : "NO"));
Serial.println("[WIFI] SSID: " + (String)wm.getWiFiSSID());
Serial.println("[WIFI] PASS: " + (String)wm.getWiFiPass());
// Serial.println("[WIFI] HOSTNAME: " + (String)WiFi.getHostname());
}
void loop() {
if(!WMISBLOCKING){
wm.process();
}
#ifdef USEOTA
ArduinoOTA.handle();
#endif
// is configuration portal requested?
if (ALLOWONDEMAND && digitalRead(ONDDEMANDPIN) == LOW ) {
delay(100);
if ( digitalRead(ONDDEMANDPIN) == LOW || BUTTONFUNC == 2){
Serial.println("BUTTON PRESSED");
// button reset/reboot
if(BUTTONFUNC == 0){
wm.resetSettings();
wm.reboot();
delay(200);
return;
}
// start configportal
if(BUTTONFUNC == 1){
if (!wm.startConfigPortal("OnDemandAP","12345678")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
}
return;
}
//test autoconnect as reconnect etc.
if(BUTTONFUNC == 2){
wm.setConfigPortalTimeout(TESP_CP_TIMEOUT);
wm.autoConnect();
return;
}
}
else {
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
getTime();
}
}
// every 10 seconds
if(millis()-mtime > 10000 ){
if(WiFi.status() == WL_CONNECTED){
getTime();
}
else Serial.println("No Wifi");
mtime = millis();
}
// put your main code here, to run repeatedly:
delay(100);
}
void getTime() {
int tz = -5;
int dst = 0;
time_t now = time(nullptr);
unsigned timeout = 5000; // try for timeout
unsigned start = millis();
configTime(tz * 3600, dst * 3600, "pool.ntp.org", "time.nist.gov");
Serial.print("Waiting for NTP time sync: ");
while (now < 8 * 3600 * 2 ) { // what is this ?
delay(100);
Serial.print(".");
now = time(nullptr);
if((millis() - start) > timeout){
Serial.println("\n[ERROR] Failed to get NTP time.");
return;
}
}
Serial.println("");
struct tm timeinfo;
gmtime_r(&now, &timeinfo);
Serial.print("Current time: ");
Serial.print(asctime(&timeinfo));
}
void debugchipid(){
// WiFi.mode(WIFI_STA);
// WiFi.printDiag(Serial);
// Serial.println(modes[WiFi.getMode()]);
// ESP.eraseConfig();
// wm.resetSettings();
// wm.erase(true);
WiFi.mode(WIFI_AP);
// WiFi.softAP();
WiFi.enableAP(true);
delay(500);
// esp_wifi_start();
delay(1000);
WiFi.printDiag(Serial);
delay(60000);
ESP.restart();
// AP esp_267751
// 507726A4AE30
// ESP32 Chip ID = 507726A4AE30
}
@@ -0,0 +1,51 @@
// wifi_basic.ino
#include <Arduino.h>
#include <WiFi.h>
// #define NVSERASE
#ifdef NVSERASE
#include <nvs.h>
#include <nvs_flash.h>
#endif
void setup(){
Serial.begin(115200);
delay(2000);
Serial.println("Startup....");
#ifdef NVSERASE
esp_err_t err;
err = nvs_flash_init();
err = nvs_flash_erase();
#endif
Serial.setDebugOutput(true);
WiFi.begin("hellowifi","noonehere");
while (WiFi.status() != WL_CONNECTED && millis()<15000) {
delay(500);
Serial.print(".");
}
if(WiFi.status() == WL_CONNECTED){
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
// Serial.println(WiFi.localIP());
}
else {
Serial.println("WiFi NOT CONNECTED, starting ap");
///////////////
/// BUG
// WiFi.enableSTA(false); // BREAKS softap start, says ok BUT no ap found
delay(2000);
WiFi.softAP("espsoftap","12345678");
}
}
void loop(){
}
+26
View File
@@ -0,0 +1,26 @@
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
bool _enteredConfigMode = false;
void setup(){
Serial.begin(115200);
WiFiManager wifiManager;
// wifiManager.setAPCallback([this](WiFiManager* wifiManager) {
wifiManager.setAPCallback([&](WiFiManager* wifiManager) {
Serial.printf("Entered config mode:ip=%s, ssid='%s'\n",
WiFi.softAPIP().toString().c_str(),
wifiManager->getConfigPortalSSID().c_str());
_enteredConfigMode = true;
});
wifiManager.resetSettings();
if (!wifiManager.autoConnect()) {
Serial.printf("*** Failed to connect and hit timeout\n");
ESP.restart();
delay(1000);
}
}
void loop(){
}
+399 -16
View File
@@ -1,17 +1,400 @@
<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/><title>{v}</title>
<style>div,input{padding:5px;font-size:1em;} input{width:95%;} body{text-align: center;} button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;}</style>
<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();}</script>
</head><body><div style="text-align: left; display: inline-block;">
<div><a href='#' onclick='c(this)'>{v}</a> {r}% {i}</div>
<div><a href='#' onclick='c(this)'>{v}</a> 100% <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAKCAMAAAC+Ge+yAAAACVBMVEUAAAC7u7v///9etNz6AAAAI0lEQVQI133GsQ3AMAAEoXv2H9qNJacKFbEaWTQJ+uQB/nMdEaYAXeJkZ9AAAAAASUVORK5CYII='/></div>
<div><a href='#' onclick='c(this)'>Vila17</a> 95% <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAADFBMVEUAAAAAtgD///8AAADV1YIHAAAAA3RSTlMAAAD6dsTeAAAAHUlEQVR4AWMAAmYgYGBkArHAAMoEYnQmMxSQywQAKvMA3+mlSFAAAAAASUVORK5CYII='/></div>
<div><a href='#'>LilRidingHoodz</a> 100% <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAABlBMVEUAAAD///+l2Z/dAAAAIklEQVR4AWNgZGRkAAIQBURQDEZAgM5kgAJGEAQDwkxkbQAOhgBBk64+mQAAAABJRU5ErkJggg=='/></div>
<div><a href='#'>Marcelica</a> 100% <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAACVBMVEUAAAC7u7v///9etNz6AAAAJ0lEQVR4AY3GsREAIBSDUD77D63x4tlKw0MdmD0ijTO9f6SFnv7YXB4qAIVn0xoMAAAAAElFTkSuQmCC'/></div>
<div><a href='#'>PMica</a> 110% <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEUAAAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADl82K3AAAAEXRSTlMAABUbPD94e7G3vcDD5PD5/Mw7MxAAAABQSURBVHgBrck5FoAgEATRBmQBZen7X1acN6KJmRX+gsHMp1qTx8wIBErhBj96dC72sSkc8hC4KzTaCyybAgmJ/IDCVRHgKwVov8KTQOYqw5weJgaXesJX/wAAAABJRU5ErkJggg=='/></div>
<br/>
<form method='get' action='wifisave'><input id='s' name='s' length=32 placeholder='SSID'><br/><input id='p' name='p' length=64 placeholder='password'><br/><button type='submit'>save</button></form>
<br/>
<form action=\"/wifi\" method=\"get\"><button>Configure WiFi</button></form><br/>
<form action=\"/0wifi\" method=\"get\"><button>Configure WiFi (No Scan)</button></form>
<!-- HTTP_HEAD -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/>
<title>{v}</title>
<!-- /HTTP_HEAD -->
<!-- HTTP_STYLE -->
<style>
:root{
/* CSS VARIABLE THEME COLOR */
/*--primarycolor:#9933CC;*/
--primarycolor:#1fa3ec;
}
body.invert,
body.invert a,
body.invert h1 {
background-color:#060606;
color:white;
}
body.invert .msg{
background-color: #282828;
border-top: 1px solid #555;
border-right: 1px solid #555;
border-bottom: 1px solid #555;
color:#fff;
}
body.invert .q[role=img] {
-webkit-filter: invert(1);
filter: invert(1);
}
.c,
body {
text-align: center;
font-family: verdana
}
.wrap {
text-align:left;
display:inline-block;
min-width:260px;
max-width:500px;
}
div,
input,select {
padding: 5px;
font-size: 1em;
/*width: 100%;*/
/*/*margin: 3px 0 10px 0; // BEFORE spacing shows label closer to input, but need to do same for AFTER*/
margin: 5px 0;
box-sizing: border-box;
}
div{
margin: 5px 0;
}
input,button,select,.msg{
border-radius:.3rem;
width: 100%;
}
input[type=radio],input[type=checkbox]{
width: auto;
}
button,input[type="button"],input[type="submit"] {
border: 0;
background-color: var(--primarycolor);
color: #fff;
line-height: 2.4rem;
font-size: 1.2rem;
}
input[type="file"]{
border: 1px solid var(--primarycolor);
}
a {
color: #000;
font-weight: 700;
text-decoration: none;
}
a:hover {
color: var(--primarycolor);
text-decoration: underline;
}
.h {
display: none;
}
.q {
height: 16px;
margin: 0;
padding: 0 5px;
text-align: right;
min-width: 38px;
float:right;
}
.q.q-0:after {
background-position-x: 0;
}
.q.q-1:after {
background-position-x: -16px;
}
.q.q-2:after {
background-position-x: -32px;
}
.q.q-3:after {
background-position-x: -48px;
}
.q.q-4:after {
background-position-x: -64px;
}
.q.l:before {
background-position-x: -80px;
padding-right: 5px
}
.ql .q {
float: left;
}
.q:after,
.q:before {
content: '';width:16px;height:16px;display:inline-block;background-repeat:no-repeat;background-position: 16px 0;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
.q:before,
.q:after {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');
background-size: 95px 16px;
}
}
.msg {
padding: 20px;
margin: 20px 0;
border: 1px solid #eee;
border-left-width: 5px;
border-left-color: #777;
}
.msg h4 {
margin-top: 0;
margin-bottom: 5px;
}
.msg.P {
border-left-color: var(--primarycolor);
}
.msg.P h4 {
color: var(--primarycolor);
}
.msg.S {
border-left-color: #5cb85c;
}
.msg.S h4 {
color: #5cb85c;
}
.msg.D {
border-left-color: #dc3630;
}
.msg.D h4 {
color: #dc3630;
}
dt {
font-weight: bold;
}
dd {
margin: 0;
padding: 0 0 0.5em 0;
}
td {
vertical-align: top;
}
button.D{
background-color:#dc3630;
}
button{
/*transition: 0s filter;*/
transition: 0s opacity;
transition-delay: 3s;
transition-duration: 0s;
cursor: pointer;
}
button:active{
opacity: 50% !important;
/*filter: brightness(50%);*/
cursor: wait;
transition-delay: 0s;
}
button:hover{
/*opacity: 80%;*/
}
:disabled {
opacity: 0.5;
}
</style>
<!-- /HTTP_STYLE -->
<!-- HTTP_SCRIPT -->
<script>
function c(l){document.getElementById('s').value=l.innerText||l.textContent;
p = l.nextElementSibling.classList.contains('l');
document.getElementById('p').disabled = !p;
if(p)document.getElementById('p').focus()};
function f() {var x = document.getElementById('p');x.type==='password'?x.type='text':x.type='password';}
</script>
<!-- /HTTP_SCRIPT -->
<!-- HTTP_HEAD_END -->
</head>
<body class="invert">
<div class='wrap'>
<!-- <div class='wrap ql qinv'> -->
<!-- /HTTP_HEAD_END -->
<!-- SAMPLE -->
<h2>/</h2><hR>
<!-- /SAMPLE -->
<!-- HTTP_PORTAL_OPTIONS -->
<!-- /HTTP_PORTAL_OPTIONS -->
<!-- HTTP_PORTAL_MENU[] -->
<form action='/wifi' method='get'><button>Configure WiFi</button></form><br/>
<form action='/0wifi' method='get'><button>Configure WiFi (No Scan)</button></form><br/>
<form action='/info' method='get'><button>Info</button></form><br/>
<form action='/param' method='get'><button>Setup</button></form><br/>
<Hr><br/>
<form action='/close' method='post'><button>Close</button></form><br/>
<form action='/erase' method='post'><button class='D'>Erase</button></form><br/>
<form action='/restart' method='post'><button>Restart</button></form><br/>
<form action='/exit' method='post'><button>Exit</button></form><br/>
<form action='/exit' method='post'><button>Update</button></form><br/>
<form action='/' method='post'><button>Back</button></form><br/>
<!-- /HTTP_PORTAL_MENU -->
<!-- SAMPLE -->
<h2>/wifi</h2><hr>
<div><a href='#p' onclick='c(this)'>Access Point 01</a><div role='img' aria-label='88%' title='88%' class='q q-4 l'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 02</a><div role='img' aria-label='88%' title='88%' class='q q-4'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 03</a><div role='img' aria-label='60%' title='60%' class='q q-3 l'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 04</a><div role='img' aria-label='60%' title='60%' class='q q-3'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 05</a><div role='img' aria-label='60%' title='60%' class='q q-3'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 06</a><div role='img' aria-label='40%' title='40%' class='q q-2'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 07</a><div role='img' aria-label='40%' title='40%' class='q q-2 l'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 08</a><div role='img' aria-label='20%' title='20%' class='q q-1'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 09</a><div role='img' aria-label='20%' title='20%' class='q q-1'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 10</a><div role='img' aria-label='20%' title='20%' class='q q-4 l'></div><div class='q '>100%</div></div>
<div><a href='#p' onclick='c(this)'>Access Point 11</a><div role='img' aria-label='10%' title='10%' class='q q-3'></div><div class='q '>70%</div></div>
<div><a href='#p' onclick='c(this)'>Access Point 12</a><div role='img' aria-label='10%' title='10%' class='q q-1 l'></div><div class='q '>10%</div></div>
<div><a href='#p' onclick='c(this)'>Access Point 13</a><div role='img' aria-label='10%' title='10%' class='q q-0 h'></div><div class='q '>100%</div></div>
<div><a href='#p' onclick='c(this)'>Access Point 14</a><div class='q'>66%</div></div>
<div><a href='#p' onclick='c(this)'>Access Point 15</a><div class='q'>56%</div></div>
<!-- /SAMPLE -->
<!-- HTTP_ITEM -->
<div><a href='#p' onclick='c(this)'>{v}</a><div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i}'></div></div>
<!-- /HTTP_ITEM -->
<!-- HTTP_FORM_START -->
<form method='get' action='wifisave'><label for='s'>SSID</label><br/><input id='s' name='s' length=32 placeholder='SSID'><br/><label for='p'>Password</label><input id='p' name='p' length=64 type='password' placeholder='password'><input type='checkbox' id='show-password' onclick='f()'> <label for='show-password'>Show Password</label><br/>
<!-- /HTTP_FORM_START -->
<!-- SAMPLE -->
<h3>custom parameter</h3><hr>
<br/><label for='custom'>Label for Custom Param</label>
<br/><input id='custom' name='custom' length='255' placeholder='placeholder' value='' {c}>
<!-- /SAMPLE -->
<!-- HTTP_FORM_LABEL -->
<br/><label for='{i}'>{p}</label>
<!-- /HTTP_FORM_LABEL -->
<!-- HTTP_FORM_PARAM -->
<br/><input id='{i}' name='{n}' length='{l}' placeholder='{p}' value='{v}' {c}>
<!-- /HTTP_FORM_PARAM -->
<!-- HTTP_FORM_END -->
<br/><button type='submit'>Save</button></form>
<!-- /HTTP_FORM_END -->
<!-- HTTP_SCAN_LINK -->
<br/><form action='/wifi' method='get'><button>Refresh</button></form>
<!-- /HTTP_SCAN_LINK -->
<!-- HTTP_SAVED -->
<div class='msg'><h4>Saving Credentials</h4>Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>
<!-- /HTTP_SAVED -->
<!-- HTTP_STATUS_ON -->
<div class='msg P'><strong>Connected</strong> to {v}<br/><em><small>with IP {i}</small></em></div>
<!-- /HTTP_STATUS_ON -->
<!-- HTTP_STATUS_OFF -->
<div class='msg {c}'><strong>Not Connected</strong> to {v}{r}</div>
<!-- /HTTP_STATUS_OFF -->
<!-- sample -->
<div class='msg D'><strong>Not Connected</strong> to apname
<!-- /sample -->
<!-- HTTP_STATUS_OFFPW -->
<br/>Authentication Failure
<!-- /HTTP_STATUS_OFFPW -->
<!-- HTTP_STATUS_OFFNOAP -->
<br/>AP not found
<!-- /HTTP_STATUS_OFFNOAP -->
<!-- HTTP_STATUS_OFFFAIL -->
<br/>Could not Connect
<!-- /HTTP_STATUS_OFFFAIL -->
</div>
<!-- HTTP_STATUS_NONE -->
<div class='msg'>No AP set</div>
<!-- /HTTP_STATUS_NONE -->
<!-- SAMPLE -->
<div class='msg P'><h4>H4 Color Header P</h4>content</div>
<!-- /SAMPLE -->
<!-- SAMPLE -->
<div class='msg S'><h4>H4 Color Header S</h4>content</div>
<!-- /SAMPLE -->
<!-- SAMPLE -->
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h3>WIFI HEAD <small><em>(WIFI_OFF)</em></small></h3><hr>
<dl>
<dt>Chip ID</dt><dd>123456</dd>
<dt>Flash Chip ID</dt><dd>1234556</dd>
<dt>IDE Flash Size</dt><dd>4194304 bytes</dd>
<dt>Real Flash Size</dt><dd>4194304 bytes</dd>
<dt>Empty</dt><dd></dd>
<dt>Soft AP IP</dt><dd>192.168.4.1</dd>
<dt>Soft AP MAC</dt><dd>00:00:00:00:00:00</dd>
<dt>Station MAC</dt><dd>00:00:00:00:00:00</dd>
</dl>
<!-- /SAMPLE -->
<!-- HTTP_HELP -->
<br/><h3>Available Pages</h3><hr>
<table class='table'>
<thead><tr><th>Page</th><th>Function</th></tr></thead><tbody>
<tr><td><a href='/'>/</a></td>
<td>Menu page.</td></tr>
<tr><td><a href='/wifi'>/wifi</a></td>
<td>Show WiFi scan results and enter WiFi configuration.(/0wifi noscan)</td></tr>
<tr><td><a href='/wifisave'>/wifisave</a></td>
<td>Save WiFi configuration information and configure device. Needs variables supplied.</td></tr>
<tr><td><a href='/close'>/close</a></td>
<td>Close the configuration server and configuration WiFi network.</td></tr>
<tr><td><a href='/info'>/info</a></td>
<td>Information page</td></tr>
<tr><td><a href='/close'>/close</a></td>
<td>Close the captiveportal popup,configportal will remain active</td></tr>
<tr><td><a href='/exit'>/exit</a></td>
<td>Exit Config Portal, configportal will close</td></tr>
<tr><td><a href='/restart'>/restart</a></td>
<td>Reboot the device</td></tr>
<tr><td><a href='/erase'>/erase</a></td>
<td>Erase WiFi configuration and reboot Device. Device will not reconnect to a network until new WiFi configuration data is entered.</td></tr>
</table>
<h3>About</h3><hr>
Version v1.x.x-xxxxx<Br/>
Build_date<br/>
Build_file<br/>
Arduino_version<br/>
<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>
<!-- /HTTP_HELP -->
<!-- FORM_UPLOAD -->
<Br/><br/>Form UPLOAD<br/>
<form method='POST' action='u' enctype='multipart/form-data'>
<input type='file' name='update' accept='.bin,application/octet-stream' onchange="(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)">
<button id='uploadbin' class="h">Submit</button>
<a href='http://192.168.4.1' target='_blank'><small>* Upload may not function inside captive portal, Open in browser - http://192.168.4.1</a></small>
<!-- /FORM_UPLOAD -->
<!-- FORM_EXTRAS -->
<br/><br/><br/><hr>
<br/>
<label for='custom'>Label for Custom Param</label>
<br/>
<input id='custom' name='custom' length='255' placeholder='placeholder' value='' {c}>
<br/>
<!-- INOUT CHECKBOX -->
<!-- <label for='input_checkbox'>Label for Input Checkbox</label> -->
<input id='input_checkbox' name='input_checkbox' placeholder='placeholder' value='' type="checkbox" {c}>
<label for='input_checkbox'>Label for Input Checkbox</label>
<br/>
<!-- INPUT CHOICE -->
<p>Select Choice</p>
<input style='display: inline-block;' type='radio' id='choice1' name='program_selection' value='1'>
<label for='choice1'>Choice1</label><br>
<input style='display: inline-block;' type='radio' id='choice2' name='program_selection' value='2'>
<label for='choice2'>Choice2</label><br>
<!-- INPUT SELECT -->
<br/>
<label for='input_select'>Label for Input Select</label>
<select name="input_select" id="input_select" class="button">
<option value="0">Option 1</option>
<option value="1" selected>Option 2</option>
<option value="2">Option 3</option>
<option value="3">Option 4</option>
</select>
</form>
<!-- /FORM_EXTRAS -->
<!-- HTTP_END -->
</div>
</body></html>
</body>
</html>
<!-- /HTTP_END -->
+60
View File
@@ -0,0 +1,60 @@
'use strict';
const fs = require('fs');
console.log('starting');
const inFile = 'WiFiManager.template.html';
const outFile = 'template.h';
const defineRegEx = /<!-- ([A-Z_]+) -->/gm;
console.log('parsing', inFile);
fs.readFile(inFile, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
//console.log(data);
let defines = data.match(defineRegEx);
//console.log(defines);
var stream = fs.createWriteStream(outFile);
stream.once('open', function(fd) {
for (const i in defines) {
const start = defines[i];
const end = start.replace('<!-- ', '<!-- /')
defineRegEx.lastIndex = 0;
const constantName = defineRegEx.exec(start)[1];
console.log(constantName);
var extractRE = new RegExp(start + '([\\s\\S]+)' + end, 'gm');
let extractArray = extractRE.exec(data);
if(extractArray.length > 1) {
let def = extractArray[1];
//console.log(def);
//minimise a bit
def = def.replace(/\s+/g, ' ');
def = def.replace(/>\s+</g, '><');
def = def.trim();
//more extraneous spaces - possible bad results, needs to be checked
//def = def.replace(/(\w)\s(\W)|(\W)\s(\w)|(\W)\s(\W)/g, '$1$2$3$4$5$6');
def = def.replace(/(\w)\s(\W)|(\W)\s(\w)/g, '$1$2$3$4');
//escape double quotes
def = def.replace(/\\([\s\S])|(")/g, "\\$1$2");
console.log(def);
//const char HTTP_HEAD[] PROGMEM =
let string = 'const char ' + constantName + '[] PROGMEM';
for (let i = string.length; i < 42; i++) {
string += ' ';
}
string += '= "' + def + '";\n';
stream.write(string);
}
}
stream.end();
});
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

+12
View File
@@ -0,0 +1,12 @@
const char HTTP_HEAD[] PROGMEM = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\"content=\"width=device-width,initial-scale=1,user-scalable=no\"/><title>{v}</title>";
const char HTTP_STYLE[] PROGMEM = "<style> .c{text-align:center;}div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align:center;font-family:verdana;}button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;} .q{float:right;width:64px;text-align:right;} .l{background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAALVBMVEX///8EBwfBwsLw8PAzNjaCg4NTVVUjJiZDRUUUFxdiZGSho6OSk5Pg4eFydHTCjaf3AAAAZElEQVQ4je2NSw7AIAhEBamKn97/uMXEGBvozkWb9C2Zx4xzWykBhFAeYp9gkLyZE0zIMno9n4g19hmdY39scwqVkOXaxph0ZCXQcqxSpgQpONa59wkRDOL93eAXvimwlbPbwwVAegLS1HGfZAAAAABJRU5ErkJggg==\")no-repeat left center;background-size:1em;} </style>";
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();} </script>";
const char HTTP_HEAD_END[] PROGMEM = "</head><body><div style=\"text-align:left;display:inline-block;min-width:260px;\">";
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action=\"/wifi\"method=\"get\"><button>Configure WiFi</button></form><br/><form action=\"/0wifi\"method=\"get\"><button>Configure WiFi(No Scan)</button></form><br/><form action=\"/i\"method=\"get\"><button>Info</button></form><br/><form action=\"/r\"method=\"post\"><button>Reset</button></form>";
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p'onclick='c(this)'>{v}</a>&nbsp;<span class='q{i}'>{r}%</span></div>";
const char HTTP_FORM_START[] PROGMEM = "<form method='get'action='wifisave'><input id='s'name='s'length=32 placeholder='SSID'><br/><input id='p'name='p'length=64 type='password'placeholder='password'><br/>";
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}'name='{n}'length={l}placeholder='{p}'value='{v}' {c}>";
const char HTTP_FORM_END[] PROGMEM = "<br/><button type='submit'>save</button></form>";
const char HTTP_SCAN_LINK[] PROGMEM = "<br/><div class=\"c\"><a href=\"/wifi\">Scan</a></div>";
const char HTTP_SAVED[] PROGMEM = "<div>Credentials Saved<br/>Trying to connect ESP to network.<br/>If it fails reconnect to AP to try again</div>";
const char HTTP_END[] PROGMEM = "</div></body></html>";
+182
View File
@@ -0,0 +1,182 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<title>Config ESP</title>
<script>
function c(l,e) {
console.log(l);
// preventDefault();
document.getElementById('s').value = l.innerText || l.textContent;
// document.location.href = document.location +"#wmform";
p = l.nextElementSibling.classList.contains("l");
document.getElementById('p').disabled = !p;
if(p)document.getElementById('p').focus();
return false;
}
</script>
<style>
.c,
body {
text-align: center
}
div,
input {
padding: 5px;
font-size: 1em
}
input {
width: 95%
}
body {
font-family: verdana
}
button {
border: 0;
border-radius: .3rem;
background-color: #1fa3ec;
color: #fff;
line-height: 2.4rem;
font-size: 1.2rem;
width: 100%
}
a {
color: #000;
font-weight: 700;
text-decoration: none
}
a:hover {
color: #1fa3ec;
text-decoration: underline
}
.q {
height: 16px;
margin: 0;
padding: 0 5px;
text-align: right;
min-width: 38px
}
.q.q-0:after {
background-position-x: 0
}
.q.q-1:after {
background-position-x: -16px
}
.q.q-2:after {
background-position-x: -32px
}
.q.q-3:after {
background-position-x: -48px
}
.q.q-4:after {
background-position-x: -64px
}
.q.l:before {
background-position-x: -80px;
padding-right: 5px
}
.ql .q {
float: left
}
.qr .q {
float: right
}
.qinv .q {
-webkit-filter: invert(1);
filter: invert(1)
}
.q:after,
.q:before {
content: '';
width: 16px;
height: 16px;
display: inline-block;
background-repeat: no-repeat;
background-position: 16px 0;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
.q:before,
.q:after {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');
background-size: 95px 16px;
}
}
input:disabled {
opacity: 0.5;
}
</style>
</head>
<body>
<!-- classes, left/right invert -->
<div class="qr" style='text-align:left;display:inline-block;min-width:260px;'>
<div><a href='#p' onclick='c(this)'>Access Point 01</a><div role='img' aria-label='88%' title='88%' class='q q-4 l'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 02</a><div role='img' aria-label='88%' title='88%' class='q q-4'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 03</a><div role='img' aria-label='88%' title='88%' class='q q-3'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 04</a><div role='img' aria-label='88%' title='88%' class='q q-3'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 05</a><div role='img' aria-label='88%' title='88%' class='q q-3'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 06</a><div role='img' aria-label='88%' title='88%' class='q q-2'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 07</a><div role='img' aria-label='88%' title='88%' class='q q-2'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 08</a><div role='img' aria-label='88%' title='88%' class='q q-1'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 09</a><div role='img' aria-label='88%' title='88%' class='q q-1'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 10</a><div role='img' aria-label='88%' title='88%' class='q q-1'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 11</a><div role='img' aria-label='88%' title='88%' class='q q-0'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 12</a><div role='img' aria-label='88%' title='88%' class='q q-0'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 13</a><div role='img' aria-label='88%' title='88%' class='q q-0'></div></div>
<div><a href='#p' onclick='c(this)'>Access Point 14</a><div role='img' aria-label='88%' title='88%' class='q q-0 l'></div></div>
<br/>
<form id="wmform" method='get' action='wifisave'>
<input id='s' name='s' length=32 placeholder='SSID'>
<br/>
<input id='p' name='p' length=64 type='password' placeholder='password'>
<br/>
<br/>
<input id='server' name='server' length=4 placeholder='mqtt server' value=''>
<br/>
<input id='port' name='port' length=5 placeholder='mqtt port' value='8080'>
<br/>
<input id='blynk' name='blynk' length=3 placeholder='blynk token' value='YOUR_BLYNK_TOKEN'>
<br/>
<br/>
<input id='ip' name='ip' length=15 placeholder='Static IP' value='10.0.1.56'>
<br/>
<input id='gw' name='gw' length=15 placeholder='Static Gateway' value='10.0.1.1'>
<br/>
<input id='sn' name='sn' length=15 placeholder='Subnet' value='255.255.255.0'>
<br/>
<br/>
<button type='submit'>save</button>
</form>
<br/>
<div class="c"><a href="/wifi">Scan</a></div>
</div>
</body>
</html>
+13 -3
View File
@@ -7,6 +7,7 @@
#######################################
WiFiManager KEYWORD1
WiFiManagerParameter KEYWORD1
#######################################
@@ -15,12 +16,21 @@ WiFiManager KEYWORD1
autoConnect KEYWORD2
getSSID KEYWORD2
getPassword KEYWORD2
getConfigPortalSSID KEYWORD2
resetSettings KEYWORD2
urldecode KEYWORD2
setTimeout KEYWORD2
setConfigPortalTimeout KEYWORD2
setConnectTimeout KEYWORD2
setDebugOutput KEYWORD2
setAPConfig KEYWORD2
setMinimumSignalQuality KEYWORD2
setAPStaticIPConfig KEYWORD2
setSTAStaticIPConfig KEYWORD2
setAPCallback KEYWORD2
setSaveConfigCallback KEYWORD2
addParameter KEYWORD2
getID KEYWORD2
getValue KEYWORD2
getPlaceholder KEYWORD2
getValueLength KEYWORD2
#######################################
# Constants (LITERAL1)
+22 -12
View File
@@ -1,19 +1,29 @@
{
"name": "WifiManager",
"keywords": "wifi, wi-fi, ESP8266",
"description": "ESP8266 WiFi Connection manager with fallback web configuration portal",
"name": "WiFiManager",
"version": "2.0.17",
"keywords": "wifi,wi-fi,esp,esp8266,esp32,espressif8266,espressif32,nodemcu,wemos,arduino",
"description": "WiFi Configuration manager with web configuration portal for ESP boards",
"authors":
[
{
"name": "tzapu",
"url": "https://github.com/tzapu"
},
{
"name": "tablatronix",
"url": "https://github.com/tablatronix",
"maintainer": true
}
],
"repository":
{
"type": "git",
"url": "https://github.com/tzapu/WiFiManager.git"
},
"authors":
{
"name": "tzapu",
"url": "http://tzapu.com"
},
"frameworks": "arduino",
"platforms": "esp8266"
"version": "0.6",
"architecture": "esp8266",
}
"platforms":
[
"espressif8266",
"espressif32"
]
}
+5 -5
View File
@@ -1,9 +1,9 @@
name=WiFiManager
version=0.6
version=2.0.17
author=tzapu
maintainer=tzapu
sentence=ESP8266 WiFi Connection manager with fallback web configuration portal
paragraph=Library for configuring ESP8266 modules WiFi credentials at runtime.
maintainer=tablatronix
sentence=WiFi Configuration manager with web configuration portal for Espressif ESPx boards, by tzapu
paragraph=Library for configuring ESP8266/ESP32 modules WiFi credentials and custom parameters at runtime with captive portal.
category=Communication
url=https://github.com/tzapu/WiFiManager.git
architectures=esp8266
architectures=esp8266,esp32
+15
View File
@@ -0,0 +1,15 @@
/**
* Contents of this file have moved to 2 new locations
* wm_strings_nn.h
* wm_consts_nn.h
*/
#warning "This file is deprecated"
#ifndef _STRINGS_EN_H_
#define _STRINGS_EN_H_
// strings files must include a consts file!
#include "wm_strings_en.h" // include constants, tokens, routes
#endif
+60
View File
@@ -0,0 +1,60 @@
#!/bin/bash
function build_examples()
{
excludes=("$@")
# track the exit code for this platform
local exit_code=0
# loop through results and add them to the array
examples=($(find $PWD/examples/ -name "*.pde" -o -name "*.ino"))
# get the last example in the array
local last="${examples[@]:(-1)}"
# loop through example sketches
for example in "${examples[@]}"; do
# store the full path to the example's sketch directory
local example_dir=$(dirname $example)
# store the filename for the example without the path
local example_file=$(basename $example)
# skip files listed as excludes
for exclude in "${excludes[@]}"; do
if [ "${example_file}" == "${exclude}" ] ; then
echo ">>>>>>>>>>>>>>>>>>>>>>>> Skipping ${example_file} <<<<<<<<<<<<<<<<<<<<<<<<<<"
continue 2
fi
done
echo "$example_file: "
local sketch="$example_dir/$example_file"
echo "$sketch"
#arduino -v --verbose-build --verify $sketch
# verify the example, and save stdout & stderr to a variable
# we have to avoid reading the exit code of local:
# "when declaring a local variable in a function, the local acts as a command in its own right"
local build_stdout
build_stdout=$(arduino --verify $sketch 2>&1)
# echo output if the build failed
if [ $? -ne 0 ]; then
# heavy X
echo -e "\xe2\x9c\x96"
echo -e "----------------------------- DEBUG OUTPUT -----------------------------\n"
echo "$build_stdout"
echo -e "\n------------------------------------------------------------------------\n"
# mark as fail
exit_code=1
else
# heavy checkmark
echo -e "\xe2\x9c\x93"
fi
done
return $exit_code
}
+278
View File
@@ -0,0 +1,278 @@
/**
* wm_consts.h
* internal const strings/tokens
* WiFiManager, a library for the ESP8266/Arduino platform
* for configuration of WiFi credentials using a Captive Portal
*
* @author Creator tzapu
* @author tablatronix
* @version 0.0.0
* @license MIT
*/
#ifndef _WM_CONSTS_H
#define _WM_CONSTS_H
// -----------------------------------------------------------------------------------------------
// TOKENS
const char WM_VERSION_STR[] PROGMEM = "v2.0.17";
static const char _wifi_token[] PROGMEM = "wifi";
static const char _wifinoscan_token[] PROGMEM = "wifinoscan";
static const char _info_token[] PROGMEM = "info";
static const char _param_token[] PROGMEM = "param";
static const char _close_token[] PROGMEM = "close";
static const char _restart_token[] PROGMEM = "restart";
static const char _exit_token[] PROGMEM = "exit";
static const char _erase_token[] PROGMEM = "erase";
static const char _update_token[] PROGMEM = "update";
static const char _sep_token[] PROGMEM = "sep";
static const char _custom_token[] PROGMEM = "custom";
static PGM_P _menutokens[] PROGMEM = {
_wifi_token,
_wifinoscan_token,
_info_token,
_param_token,
_close_token,
_restart_token,
_exit_token,
_erase_token,
_update_token,
_sep_token,
_custom_token
};
const uint8_t _nummenutokens = (sizeof(_menutokens) / sizeof(PGM_P));
// Routes
const char R_root[] PROGMEM = "/";
const char R_wifi[] PROGMEM = "/wifi";
const char R_wifinoscan[] PROGMEM = "/0wifi";
const char R_wifisave[] PROGMEM = "/wifisave";
const char R_info[] PROGMEM = "/info";
const char R_param[] PROGMEM = "/param";
const char R_paramsave[] PROGMEM = "/paramsave";
const char R_restart[] PROGMEM = "/restart";
const char R_exit[] PROGMEM = "/exit";
const char R_close[] PROGMEM = "/close";
const char R_erase[] PROGMEM = "/erase";
const char R_status[] PROGMEM = "/status";
const char R_update[] PROGMEM = "/update";
const char R_updatedone[] PROGMEM = "/u";
// Classes
const char C_root[] PROGMEM = "home";
const char C_wifi[] PROGMEM = "wifi";
const char C_info[] PROGMEM = "info";
const char C_param[] PROGMEM = "param";
const char C_close[] PROGMEM = "close";
const char C_restart[] PROGMEM = "restart";
const char C_exit[] PROGMEM = "exit";
const char C_erase[] PROGMEM = "erase";
const char C_update[] PROGMEM = "update";
//Strings
const char S_ip[] PROGMEM = "ip";
const char S_gw[] PROGMEM = "gw";
const char S_sn[] PROGMEM = "sn";
const char S_dns[] PROGMEM = "dns";
//Tokens
//@todo consolidate and reduce
const char T_ss[] PROGMEM = "{"; // token start sentinel
const char T_es[] PROGMEM = "}"; // token end sentinel
const char T_1[] PROGMEM = "{1}"; // @token 1
const char T_2[] PROGMEM = "{2}"; // @token 2
const char T_3[] PROGMEM = "{3}"; // @token 2
const char T_v[] PROGMEM = "{v}"; // @token v
const char T_V[] PROGMEM = "{V}"; // @token v
const char T_I[] PROGMEM = "{I}"; // @token I
const char T_i[] PROGMEM = "{i}"; // @token i
const char T_n[] PROGMEM = "{n}"; // @token n
const char T_p[] PROGMEM = "{p}"; // @token p
const char T_t[] PROGMEM = "{t}"; // @token t
const char T_l[] PROGMEM = "{l}"; // @token l
const char T_c[] PROGMEM = "{c}"; // @token c
const char T_e[] PROGMEM = "{e}"; // @token e
const char T_q[] PROGMEM = "{q}"; // @token q
const char T_r[] PROGMEM = "{r}"; // @token r
const char T_R[] PROGMEM = "{R}"; // @token R
const char T_h[] PROGMEM = "{h}"; // @token h
// http
const char HTTP_HEAD_CL[] PROGMEM = "Content-Length";
const char HTTP_HEAD_CT[] PROGMEM = "text/html";
const char HTTP_HEAD_CT2[] PROGMEM = "text/plain";
const char HTTP_HEAD_CORS[] PROGMEM = "Access-Control-Allow-Origin";
const char HTTP_HEAD_CORS_ALLOW_ALL[] PROGMEM = "*";
const char * const WIFI_STA_STATUS[] PROGMEM
{
"WL_IDLE_STATUS", // 0 STATION_IDLE
"WL_NO_SSID_AVAIL", // 1 STATION_NO_AP_FOUND
"WL_SCAN_COMPLETED", // 2
"WL_CONNECTED", // 3 STATION_GOT_IP
"WL_CONNECT_FAILED", // 4 STATION_CONNECT_FAIL, STATION_WRONG_PASSWORD(NI)
"WL_CONNECTION_LOST", // 5
"WL_DISCONNECTED", // 6
"WL_STATION_WRONG_PASSWORD" // 7 KLUDGE
};
#ifdef ESP32
const char * const AUTH_MODE_NAMES[] PROGMEM
{
"OPEN",
"WEP",
"WPA_PSK",
"WPA2_PSK",
"WPA_WPA2_PSK",
"WPA2_ENTERPRISE",
"MAX"
};
#elif defined(ESP8266)
const char * const AUTH_MODE_NAMES[] PROGMEM
{
"",
"",
"WPA_PSK", // 2 ENC_TYPE_TKIP
"",
"WPA2_PSK", // 4 ENC_TYPE_CCMP
"WEP", // 5 ENC_TYPE_WEP
"",
"OPEN", //7 ENC_TYPE_NONE
"WPA_WPA2_PSK", // 8 ENC_TYPE_AUTO
};
#endif
const char* const WIFI_MODES[] PROGMEM = { "NULL", "STA", "AP", "STA+AP" };
#ifdef ESP32
// as 2.5.2
// typedef struct {
// char cc[3]; /**< country code string */
// uint8_t schan; /**< start channel */
// uint8_t nchan; /**< total channel number */
// int8_t max_tx_power; /**< This field is used for getting WiFi maximum transmitting power, call esp_wifi_set_max_tx_power to set the maximum transmitting power. */
// wifi_country_policy_t policy; /**< country policy */
// } wifi_country_t;
const wifi_country_t WM_COUNTRY_US{"US",1,11,CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_CN{"CN",1,13,CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
#elif defined(ESP8266) && !defined(WM_NOCOUNTRY)
// typedef struct {
// char cc[3]; /**< country code string */
// uint8_t schan; /**< start channel */
// uint8_t nchan; /**< total channel number */
// uint8_t policy; /**< country policy */
// } wifi_country_t;
const wifi_country_t WM_COUNTRY_US{"US",1,11,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_CN{"CN",1,13,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,WIFI_COUNTRY_POLICY_AUTO};
#endif
/*
* ESP32 WiFi Events
0 SYSTEM_EVENT_WIFI_READY < ESP32 WiFi ready
1 SYSTEM_EVENT_SCAN_DONE < ESP32 finish scanning AP
2 SYSTEM_EVENT_STA_START < ESP32 station start
3 SYSTEM_EVENT_STA_STOP < ESP32 station stop
4 SYSTEM_EVENT_STA_CONNECTED < ESP32 station connected to AP
5 SYSTEM_EVENT_STA_DISCONNECTED < ESP32 station disconnected from AP
6 SYSTEM_EVENT_STA_AUTHMODE_CHANGE < the auth mode of AP connected by ESP32 station changed
7 SYSTEM_EVENT_STA_GOT_IP < ESP32 station got IP from connected AP
8 SYSTEM_EVENT_STA_LOST_IP < ESP32 station lost IP and the IP is reset to 0
9 SYSTEM_EVENT_STA_WPS_ER_SUCCESS < ESP32 station wps succeeds in enrollee mode
10 SYSTEM_EVENT_STA_WPS_ER_FAILED < ESP32 station wps fails in enrollee mode
11 SYSTEM_EVENT_STA_WPS_ER_TIMEOUT < ESP32 station wps timeout in enrollee mode
12 SYSTEM_EVENT_STA_WPS_ER_PIN < ESP32 station wps pin code in enrollee mode
13 SYSTEM_EVENT_AP_START < ESP32 soft-AP start
14 SYSTEM_EVENT_AP_STOP < ESP32 soft-AP stop
15 SYSTEM_EVENT_AP_STACONNECTED < a station connected to ESP32 soft-AP
16 SYSTEM_EVENT_AP_STADISCONNECTED < a station disconnected from ESP32 soft-AP
17 SYSTEM_EVENT_AP_STAIPASSIGNED < ESP32 soft-AP assign an IP to a connected station
18 SYSTEM_EVENT_AP_PROBEREQRECVED < Receive probe request packet in soft-AP interface
19 SYSTEM_EVENT_GOT_IP6 < ESP32 station or ap or ethernet interface v6IP addr is preferred
20 SYSTEM_EVENT_ETH_START < ESP32 ethernet start
21 SYSTEM_EVENT_ETH_STOP < ESP32 ethernet stop
22 SYSTEM_EVENT_ETH_CONNECTED < ESP32 ethernet phy link up
23 SYSTEM_EVENT_ETH_DISCONNECTED < ESP32 ethernet phy link down
24 SYSTEM_EVENT_ETH_GOT_IP < ESP32 ethernet got IP from connected AP
25 SYSTEM_EVENT_MAX
typedef enum {
ARDUINO_EVENT_WIFI_READY = 0,
ARDUINO_EVENT_WIFI_SCAN_DONE,
ARDUINO_EVENT_WIFI_STA_START,
ARDUINO_EVENT_WIFI_STA_STOP,
ARDUINO_EVENT_WIFI_STA_CONNECTED,
ARDUINO_EVENT_WIFI_STA_DISCONNECTED,
ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE,
ARDUINO_EVENT_WIFI_STA_GOT_IP,
ARDUINO_EVENT_WIFI_STA_GOT_IP6,
ARDUINO_EVENT_WIFI_STA_LOST_IP,
ARDUINO_EVENT_WIFI_AP_START,
ARDUINO_EVENT_WIFI_AP_STOP,
ARDUINO_EVENT_WIFI_AP_STACONNECTED,
ARDUINO_EVENT_WIFI_AP_STADISCONNECTED,
ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED,
ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED,
ARDUINO_EVENT_WIFI_AP_GOT_IP6,
ARDUINO_EVENT_WIFI_FTM_REPORT,
ARDUINO_EVENT_ETH_START,
ARDUINO_EVENT_ETH_STOP,
ARDUINO_EVENT_ETH_CONNECTED,
ARDUINO_EVENT_ETH_DISCONNECTED,
ARDUINO_EVENT_ETH_GOT_IP,
ARDUINO_EVENT_ETH_GOT_IP6,
ARDUINO_EVENT_WPS_ER_SUCCESS,
ARDUINO_EVENT_WPS_ER_FAILED,
ARDUINO_EVENT_WPS_ER_TIMEOUT,
ARDUINO_EVENT_WPS_ER_PIN,
ARDUINO_EVENT_WPS_ER_PBC_OVERLAP,
ARDUINO_EVENT_SC_SCAN_DONE,
ARDUINO_EVENT_SC_FOUND_CHANNEL,
ARDUINO_EVENT_SC_GOT_SSID_PSWD,
ARDUINO_EVENT_SC_SEND_ACK_DONE,
ARDUINO_EVENT_PROV_INIT,
ARDUINO_EVENT_PROV_DEINIT,
ARDUINO_EVENT_PROV_START,
ARDUINO_EVENT_PROV_END,
ARDUINO_EVENT_PROV_CRED_RECV,
ARDUINO_EVENT_PROV_CRED_FAIL,
ARDUINO_EVENT_PROV_CRED_SUCCESS,
ARDUINO_EVENT_MAX
} arduino_event_id_t;
typedef union {
wifi_event_sta_scan_done_t wifi_scan_done;
wifi_event_sta_authmode_change_t wifi_sta_authmode_change;
wifi_event_sta_connected_t wifi_sta_connected;
wifi_event_sta_disconnected_t wifi_sta_disconnected;
wifi_event_sta_wps_er_pin_t wps_er_pin;
wifi_event_sta_wps_fail_reason_t wps_fail_reason;
wifi_event_ap_probe_req_rx_t wifi_ap_probereqrecved;
wifi_event_ap_staconnected_t wifi_ap_staconnected;
wifi_event_ap_stadisconnected_t wifi_ap_stadisconnected;
wifi_event_ftm_report_t wifi_ftm_report;
ip_event_ap_staipassigned_t wifi_ap_staipassigned;
ip_event_got_ip_t got_ip;
ip_event_got_ip6_t got_ip6;
smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd;
esp_eth_handle_t eth_connected;
wifi_sta_config_t prov_cred_recv;
wifi_prov_sta_fail_reason_t prov_fail_reason;
} arduino_event_info_t;
*/
#endif
+279
View File
@@ -0,0 +1,279 @@
/**
* wm_consts.h
* internal const strings/tokens
* WiFiManager, a library for the ESP8266/Arduino platform
* for configuration of WiFi credentials using a Captive Portal
*
* @author Creator tzapu
* @author tablatronix
* @version 0.0.1
* @translated AByGCreation
* @license MIT
*/
#ifndef _WM_CONSTS_H
#define _WM_CONSTS_H
// -----------------------------------------------------------------------------------------------
// TOKENS
const char WM_VERSION_STR[] PROGMEM = "v2.0.17";
static const char _wifi_token[] PROGMEM = "wifi";
static const char _wifinoscan_token[] PROGMEM = "wifinoscan";
static const char _info_token[] PROGMEM = "info";
static const char _param_token[] PROGMEM = "param";
static const char _close_token[] PROGMEM = "close";
static const char _restart_token[] PROGMEM = "restart";
static const char _exit_token[] PROGMEM = "exit";
static const char _erase_token[] PROGMEM = "erase";
static const char _update_token[] PROGMEM = "update";
static const char _sep_token[] PROGMEM = "sep";
static const char _custom_token[] PROGMEM = "custom";
static PGM_P _menutokens[] PROGMEM = {
_wifi_token,
_wifinoscan_token,
_info_token,
_param_token,
_close_token,
_restart_token,
_exit_token,
_erase_token,
_update_token,
_sep_token,
_custom_token
};
const uint8_t _nummenutokens = (sizeof(_menutokens) / sizeof(PGM_P));
// Routes
const char R_root[] PROGMEM = "/";
const char R_wifi[] PROGMEM = "/wifi";
const char R_wifinoscan[] PROGMEM = "/0wifi";
const char R_wifisave[] PROGMEM = "/wifisave";
const char R_info[] PROGMEM = "/info";
const char R_param[] PROGMEM = "/param";
const char R_paramsave[] PROGMEM = "/paramsave";
const char R_restart[] PROGMEM = "/restart";
const char R_exit[] PROGMEM = "/exit";
const char R_close[] PROGMEM = "/close";
const char R_erase[] PROGMEM = "/erase";
const char R_status[] PROGMEM = "/status";
const char R_update[] PROGMEM = "/update";
const char R_updatedone[] PROGMEM = "/u";
// Classes
const char C_root[] PROGMEM = "home";
const char C_wifi[] PROGMEM = "wifi";
const char C_info[] PROGMEM = "info";
const char C_param[] PROGMEM = "param";
const char C_close[] PROGMEM = "close";
const char C_restart[] PROGMEM = "restart";
const char C_exit[] PROGMEM = "exit";
const char C_erase[] PROGMEM = "erase";
const char C_update[] PROGMEM = "update";
//Strings
const char S_ip[] PROGMEM = "ip";
const char S_gw[] PROGMEM = "gw";
const char S_sn[] PROGMEM = "sn";
const char S_dns[] PROGMEM = "dns";
//Tokens
//@todo consolidate and reduce
const char T_ss[] PROGMEM = "{"; // token start sentinel
const char T_es[] PROGMEM = "}"; // token end sentinel
const char T_1[] PROGMEM = "{1}"; // @token 1
const char T_2[] PROGMEM = "{2}"; // @token 2
const char T_3[] PROGMEM = "{3}"; // @token 2
const char T_v[] PROGMEM = "{v}"; // @token v
const char T_V[] PROGMEM = "{V}"; // @token v
const char T_I[] PROGMEM = "{I}"; // @token I
const char T_i[] PROGMEM = "{i}"; // @token i
const char T_n[] PROGMEM = "{n}"; // @token n
const char T_p[] PROGMEM = "{p}"; // @token p
const char T_t[] PROGMEM = "{t}"; // @token t
const char T_l[] PROGMEM = "{l}"; // @token l
const char T_c[] PROGMEM = "{c}"; // @token c
const char T_e[] PROGMEM = "{e}"; // @token e
const char T_q[] PROGMEM = "{q}"; // @token q
const char T_r[] PROGMEM = "{r}"; // @token r
const char T_R[] PROGMEM = "{R}"; // @token R
const char T_h[] PROGMEM = "{h}"; // @token h
// http
const char HTTP_HEAD_CL[] PROGMEM = "Content-Length";
const char HTTP_HEAD_CT[] PROGMEM = "text/html";
const char HTTP_HEAD_CT2[] PROGMEM = "text/plain";
const char HTTP_HEAD_CORS[] PROGMEM = "Access-Control-Allow-Origin";
const char HTTP_HEAD_CORS_ALLOW_ALL[] PROGMEM = "*";
const char * const WIFI_STA_STATUS[] PROGMEM
{
"WL_IDLE_STATUS", // 0 STATION_IDLE
"WL_NO_SSID_AVAIL", // 1 STATION_NO_AP_FOUND
"WL_SCAN_COMPLETED", // 2
"WL_CONNECTED", // 3 STATION_GOT_IP
"WL_CONNECT_FAILED", // 4 STATION_CONNECT_FAIL, STATION_WRONG_PASSWORD(NI)
"WL_CONNECTION_LOST", // 5
"WL_DISCONNECTED", // 6
"WL_STATION_WRONG_PASSWORD" // 7 KLUDGE
};
#ifdef ESP32
const char * const AUTH_MODE_NAMES[] PROGMEM
{
"OPEN",
"WEP",
"WPA_PSK",
"WPA2_PSK",
"WPA_WPA2_PSK",
"WPA2_ENTERPRISE",
"MAX"
};
#elif defined(ESP8266)
const char * const AUTH_MODE_NAMES[] PROGMEM
{
"",
"",
"WPA_PSK", // 2 ENC_TYPE_TKIP
"",
"WPA2_PSK", // 4 ENC_TYPE_CCMP
"WEP", // 5 ENC_TYPE_WEP
"",
"OPEN", //7 ENC_TYPE_NONE
"WPA_WPA2_PSK", // 8 ENC_TYPE_AUTO
};
#endif
const char* const WIFI_MODES[] PROGMEM = { "NULL", "STA", "AP", "STA+AP" };
#ifdef ESP32
// as 2.5.2
// typedef struct {
// char cc[3]; /**< country code string */
// uint8_t schan; /**< start channel */
// uint8_t nchan; /**< total channel number */
// int8_t max_tx_power; /**< This field is used for getting WiFi maximum transmitting power, call esp_wifi_set_max_tx_power to set the maximum transmitting power. */
// wifi_country_policy_t policy; /**< country policy */
// } wifi_country_t;
const wifi_country_t WM_COUNTRY_US{"US",1,11,CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_CN{"CN",1,13,CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
#elif defined(ESP8266) && !defined(WM_NOCOUNTRY)
// typedef struct {
// char cc[3]; /**< country code string */
// uint8_t schan; /**< start channel */
// uint8_t nchan; /**< total channel number */
// uint8_t policy; /**< country policy */
// } wifi_country_t;
const wifi_country_t WM_COUNTRY_US{"US",1,11,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_CN{"CN",1,13,WIFI_COUNTRY_POLICY_AUTO};
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,WIFI_COUNTRY_POLICY_AUTO};
#endif
/*
* ESP32 WiFi Events
0 SYSTEM_EVENT_WIFI_READY < ESP32 WiFi ready
1 SYSTEM_EVENT_SCAN_DONE < ESP32 finish scanning AP
2 SYSTEM_EVENT_STA_START < ESP32 station start
3 SYSTEM_EVENT_STA_STOP < ESP32 station stop
4 SYSTEM_EVENT_STA_CONNECTED < ESP32 station connected to AP
5 SYSTEM_EVENT_STA_DISCONNECTED < ESP32 station disconnected from AP
6 SYSTEM_EVENT_STA_AUTHMODE_CHANGE < the auth mode of AP connected by ESP32 station changed
7 SYSTEM_EVENT_STA_GOT_IP < ESP32 station got IP from connected AP
8 SYSTEM_EVENT_STA_LOST_IP < ESP32 station lost IP and the IP is reset to 0
9 SYSTEM_EVENT_STA_WPS_ER_SUCCESS < ESP32 station wps succeeds in enrollee mode
10 SYSTEM_EVENT_STA_WPS_ER_FAILED < ESP32 station wps fails in enrollee mode
11 SYSTEM_EVENT_STA_WPS_ER_TIMEOUT < ESP32 station wps timeout in enrollee mode
12 SYSTEM_EVENT_STA_WPS_ER_PIN < ESP32 station wps pin code in enrollee mode
13 SYSTEM_EVENT_AP_START < ESP32 soft-AP start
14 SYSTEM_EVENT_AP_STOP < ESP32 soft-AP stop
15 SYSTEM_EVENT_AP_STACONNECTED < a station connected to ESP32 soft-AP
16 SYSTEM_EVENT_AP_STADISCONNECTED < a station disconnected from ESP32 soft-AP
17 SYSTEM_EVENT_AP_STAIPASSIGNED < ESP32 soft-AP assign an IP to a connected station
18 SYSTEM_EVENT_AP_PROBEREQRECVED < Receive probe request packet in soft-AP interface
19 SYSTEM_EVENT_GOT_IP6 < ESP32 station or ap or ethernet interface v6IP addr is preferred
20 SYSTEM_EVENT_ETH_START < ESP32 ethernet start
21 SYSTEM_EVENT_ETH_STOP < ESP32 ethernet stop
22 SYSTEM_EVENT_ETH_CONNECTED < ESP32 ethernet phy link up
23 SYSTEM_EVENT_ETH_DISCONNECTED < ESP32 ethernet phy link down
24 SYSTEM_EVENT_ETH_GOT_IP < ESP32 ethernet got IP from connected AP
25 SYSTEM_EVENT_MAX
typedef enum {
ARDUINO_EVENT_WIFI_READY = 0,
ARDUINO_EVENT_WIFI_SCAN_DONE,
ARDUINO_EVENT_WIFI_STA_START,
ARDUINO_EVENT_WIFI_STA_STOP,
ARDUINO_EVENT_WIFI_STA_CONNECTED,
ARDUINO_EVENT_WIFI_STA_DISCONNECTED,
ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE,
ARDUINO_EVENT_WIFI_STA_GOT_IP,
ARDUINO_EVENT_WIFI_STA_GOT_IP6,
ARDUINO_EVENT_WIFI_STA_LOST_IP,
ARDUINO_EVENT_WIFI_AP_START,
ARDUINO_EVENT_WIFI_AP_STOP,
ARDUINO_EVENT_WIFI_AP_STACONNECTED,
ARDUINO_EVENT_WIFI_AP_STADISCONNECTED,
ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED,
ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED,
ARDUINO_EVENT_WIFI_AP_GOT_IP6,
ARDUINO_EVENT_WIFI_FTM_REPORT,
ARDUINO_EVENT_ETH_START,
ARDUINO_EVENT_ETH_STOP,
ARDUINO_EVENT_ETH_CONNECTED,
ARDUINO_EVENT_ETH_DISCONNECTED,
ARDUINO_EVENT_ETH_GOT_IP,
ARDUINO_EVENT_ETH_GOT_IP6,
ARDUINO_EVENT_WPS_ER_SUCCESS,
ARDUINO_EVENT_WPS_ER_FAILED,
ARDUINO_EVENT_WPS_ER_TIMEOUT,
ARDUINO_EVENT_WPS_ER_PIN,
ARDUINO_EVENT_WPS_ER_PBC_OVERLAP,
ARDUINO_EVENT_SC_SCAN_DONE,
ARDUINO_EVENT_SC_FOUND_CHANNEL,
ARDUINO_EVENT_SC_GOT_SSID_PSWD,
ARDUINO_EVENT_SC_SEND_ACK_DONE,
ARDUINO_EVENT_PROV_INIT,
ARDUINO_EVENT_PROV_DEINIT,
ARDUINO_EVENT_PROV_START,
ARDUINO_EVENT_PROV_END,
ARDUINO_EVENT_PROV_CRED_RECV,
ARDUINO_EVENT_PROV_CRED_FAIL,
ARDUINO_EVENT_PROV_CRED_SUCCESS,
ARDUINO_EVENT_MAX
} arduino_event_id_t;
typedef union {
wifi_event_sta_scan_done_t wifi_scan_done;
wifi_event_sta_authmode_change_t wifi_sta_authmode_change;
wifi_event_sta_connected_t wifi_sta_connected;
wifi_event_sta_disconnected_t wifi_sta_disconnected;
wifi_event_sta_wps_er_pin_t wps_er_pin;
wifi_event_sta_wps_fail_reason_t wps_fail_reason;
wifi_event_ap_probe_req_rx_t wifi_ap_probereqrecved;
wifi_event_ap_staconnected_t wifi_ap_staconnected;
wifi_event_ap_stadisconnected_t wifi_ap_stadisconnected;
wifi_event_ftm_report_t wifi_ftm_report;
ip_event_ap_staipassigned_t wifi_ap_staipassigned;
ip_event_got_ip_t got_ip;
ip_event_got_ip6_t got_ip6;
smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd;
esp_eth_handle_t eth_connected;
wifi_sta_config_t prov_cred_recv;
wifi_prov_sta_fail_reason_t prov_fail_reason;
} arduino_event_info_t;
*/
#endif
+276
View File
@@ -0,0 +1,276 @@
/**
* wm_strings_en.h
* engligh strings for
* WiFiManager, a library for the ESP8266/Arduino platform
* for configuration of WiFi credentials using a Captive Portal
*
* @author Creator tzapu
* @author tablatronix
* @version 0.0.0
* @license MIT
*/
#ifndef _WM_STRINGS_EN_H_
#define _WM_STRINGS_EN_H_
#ifndef WIFI_MANAGER_OVERRIDE_STRINGS
// !!! ABOVE WILL NOT WORK if you define in your sketch, must be build flag, if anyone one knows how to order includes to be able to do this it would be neat.. I have seen it done..
// strings files must include a consts file!
#include "wm_consts_en.h" // include constants, tokens, routes
const char WM_LANGUAGE[] PROGMEM = "en-US"; // i18n lang code
const char HTTP_HEAD_START[] PROGMEM = "<!DOCTYPE html>"
"<html lang='en'><head>"
"<meta name='format-detection' content='telephone=no'>"
"<meta charset='UTF-8'>"
"<meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>"
"<title>{v}</title>";
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){"
"document.getElementById('s').value=l.getAttribute('data-ssid')||l.innerText||l.textContent;"
"p = l.nextElementSibling.classList.contains('l');"
"document.getElementById('p').disabled = !p;"
"if(p)document.getElementById('p').focus();};"
"function f() {var x = document.getElementById('p');x.type==='password'?x.type='text':x.type='password';}"
"</script>"; // @todo add button states, disable on click , show ack , spinner etc
const char HTTP_HEAD_END[] PROGMEM = "</head><body class='{c}'><div class='wrap'>"; // {c} = _bodyclass
// example of embedded logo, base64 encoded inline, No styling here
// const char HTTP_ROOT_MAIN[] PROGMEM = "<img title=' alt=' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADQElEQVRoQ+2YjW0VQQyE7Q6gAkgFkAogFUAqgFQAVACpAKiAUAFQAaECQgWECggVGH1PPrRvn3dv9/YkFOksoUhhfzwz9ngvKrc89JbnLxuA/63gpsCmwCADWwkNEji8fVNgotDM7osI/x777x5l9F6JyB8R4eeVql4P0y8yNsjM7KGIPBORp558T04A+CwiH1UVUItiUQmZ2XMReSEiAFgjAPBeVS96D+sCYGaUx4cFbLfmhSpnqnrZuqEJgJnd8cQplVLciAgX//Cf0ToIeOB9wpmloLQAwpnVmAXgdf6pwjpJIz+XNoeZQQZlODV9vhc1Tuf6owrAk/8qIhFbJH7eI3eEzsvydQEICqBEkZwiALfF70HyHPpqScPV5HFjeFu476SkRA0AzOfy4hYwstj2ZkDgaphE7m6XqnoS7Q0BOPs/sw0kDROzjdXcCMFCNwzIy0EcRcOvBACfh4k0wgOmBX4xjfmk4DKTS31hgNWIKBCI8gdzogTgjYjQWFMw+o9LzJoZ63GUmjWm2wGDc7EvDDOj/1IVMIyD9SUAL0WEhpriRlXv5je5S+U1i2N88zdPuoVkeB+ls4SyxCoP3kVm9jsjpEsBLoOBNC5U9SwpGdakFkviuFP1keblATkTENTYcxkzgxTKOI3jyDxqLkQT87pMA++H3XvJBYtsNbBN6vuXq5S737WqHkW1VgMQNXJ0RshMqbbT33sJ5kpHWymzcJjNTeJIymJZtSQd9NHQHS1vodoFoTMkfbJzpRnLzB2vi6BZAJxWaCr+62BC+jzAxVJb3dmmiLzLwZhZNPE5e880Suo2AZgB8e8idxherqUPnT3brBDTlPxO3Z66rVwIwySXugdNd+5ejhqp/+NmgIwGX3Py3QBmlEi54KlwmjkOytQ+iJrLJj23S4GkOeecg8G091no737qvRRdzE+HLALQoMTBbJgBsCj5RSWUlUVJiZ4SOljb05eLFWgoJ5oY6yTyJp62D39jDANoKKcSocPJD5dQYzlFAFZJflUArgTPZKZwLXAnHmerfJquUkKZEgyzqOb5TuDt1P3nwxobqwPocZA11m4A1mBx5IxNgRH21ti7KbAGiyNn3HoF/gJ0w05A8xclpwAAAABJRU5ErkJggg==' /><h1>{v}</h1><h3>WiFiManager</h3>";
const char HTTP_ROOT_MAIN[] PROGMEM = "<h1>{t}</h1><h3>{v}</h3>";
const char * const HTTP_PORTAL_MENU[] PROGMEM = {
"<form action='/wifi' method='get'><button>Configure WiFi</button></form><br/>\n", // MENU_WIFI
"<form action='/0wifi' method='get'><button>Configure WiFi (No scan)</button></form><br/>\n", // MENU_WIFINOSCAN
"<form action='/info' method='get'><button>Info</button></form><br/>\n", // MENU_INFO
"<form action='/param' method='get'><button>Setup</button></form><br/>\n",//MENU_PARAM
"<form action='/close' method='get'><button>Close</button></form><br/>\n", // MENU_CLOSE
"<form action='/restart' method='get'><button>Restart</button></form><br/>\n",// MENU_RESTART
"<form action='/exit' method='get'><button>Exit</button></form><br/>\n", // MENU_EXIT
"<form action='/erase' method='get'><button class='D'>Erase</button></form><br/>\n", // MENU_ERASE
"<form action='/update' method='get'><button>Update</button></form><br/>\n",// MENU_UPDATE
"<hr><br/>" // MENU_SEP
};
// const char HTTP_PORTAL_OPTIONS[] PROGMEM = strcat(HTTP_PORTAL_MENU[0] , HTTP_PORTAL_MENU[3] , HTTP_PORTAL_MENU[7]);
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "";
const char HTTP_ITEM_QI[] PROGMEM = "<div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i} {h}'></div>"; // rssi icons
const char HTTP_ITEM_QP[] PROGMEM = "<div class='q {h}'>{r}%</div>"; // rssi percentage {h} = hidden showperc pref
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)' data-ssid='{V}'>{v}</a>{qi}{qp}</div>"; // {q} = HTTP_ITEM_QI, {r} = HTTP_ITEM_QP
// const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a> {R} {r}% {q} {e}</div>"; // test all tokens
const char HTTP_FORM_START[] PROGMEM = "<form method='POST' action='{v}'>";
const char HTTP_FORM_WIFI[] PROGMEM = "<label for='s'>SSID</label><input id='s' name='s' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='{v}'><br/><label for='p'>Password</label><input id='p' name='p' maxlength='64' type='password' placeholder='{p}'><input type='checkbox' id='showpass' onclick='f()'> <label for='showpass'>Show Password</label><br/>";
const char HTTP_FORM_WIFI_END[] PROGMEM = "";
const char HTTP_FORM_STATIC_HEAD[] PROGMEM = "<hr><br/>";
const char HTTP_FORM_END[] PROGMEM = "<br/><br/><button type='submit'>Save</button></form>";
const char HTTP_FORM_LABEL[] PROGMEM = "<label for='{i}'>{t}</label>";
const char HTTP_FORM_PARAM_HEAD[] PROGMEM = "<hr><br/>";
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' maxlength='{l}' value='{v}' {c}>\n"; // do not remove newline!
const char HTTP_SCAN_LINK[] PROGMEM = "<br/><form action='/wifi?refresh=1' method='POST'><button name='refresh' value='1'>Refresh</button></form>";
const char HTTP_SAVED[] PROGMEM = "<div class='msg'>Saving Credentials<br/>Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>";
const char HTTP_PARAMSAVED[] PROGMEM = "<div class='msg S'>Saved<br/></div>";
const char HTTP_END[] PROGMEM = "</div></body></html>";
const char HTTP_ERASEBTN[] PROGMEM = "<br/><form action='/erase' method='get'><button class='D'>Erase WiFi config</button></form>";
const char HTTP_UPDATEBTN[] PROGMEM = "<br/><form action='/update' method='get'><button>Update</button></form>";
const char HTTP_BACKBTN[] PROGMEM = "<hr><br/><form action='/' method='get'><button>Back</button></form>";
const char HTTP_STATUS_ON[] PROGMEM = "<div class='msg S'><strong>Connected</strong> to {v}<br/><em><small>with IP {i}</small></em></div>";
const char HTTP_STATUS_OFF[] PROGMEM = "<div class='msg {c}'><strong>Not connected</strong> to {v}{r}</div>"; // {c=class} {v=ssid} {r=status_off}
const char HTTP_STATUS_OFFPW[] PROGMEM = "<br/>Authentication failure"; // STATION_WRONG_PASSWORD, no eps32
const char HTTP_STATUS_OFFNOAP[] PROGMEM = "<br/>AP not found"; // WL_NO_SSID_AVAIL
const char HTTP_STATUS_OFFFAIL[] PROGMEM = "<br/>Could not connect"; // WL_CONNECT_FAILED
const char HTTP_STATUS_NONE[] PROGMEM = "<div class='msg'>No AP set</div>";
const char HTTP_BR[] PROGMEM = "<br/>";
const char HTTP_STYLE[] PROGMEM = "<style>"
".c,body{text-align:center;font-family:verdana}div,input,select{padding:5px;font-size:1em;margin:5px 0;box-sizing:border-box}"
"input,button,select,.msg{border-radius:.3rem;width: 100%}input[type=radio],input[type=checkbox]{width:auto}"
"button,input[type='button'],input[type='submit']{cursor:pointer;border:0;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%}"
"input[type='file']{border:1px solid #1fa3ec}"
".wrap {text-align:left;display:inline-block;min-width:260px;max-width:500px}"
// links
"a{color:#000;font-weight:700;text-decoration:none}a:hover{color:#1fa3ec;text-decoration:underline}"
// quality icons
".q{height:16px;margin:0;padding:0 5px;text-align:right;min-width:38px;float:right}.q.q-0:after{background-position-x:0}.q.q-1:after{background-position-x:-16px}.q.q-2:after{background-position-x:-32px}.q.q-3:after{background-position-x:-48px}.q.q-4:after{background-position-x:-64px}.q.l:before{background-position-x:-80px;padding-right:5px}.ql .q{float:left}.q:after,.q:before{content:'';width:16px;height:16px;display:inline-block;background-repeat:no-repeat;background-position: 16px 0;"
"background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');}"
// icons @2x media query (32px rescaled)
"@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi){.q:before,.q:after {"
"background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');"
"background-size: 95px 16px;}}"
// msg callouts
".msg{padding:20px;margin:20px 0;border:1px solid #eee;border-left-width:5px;border-left-color:#777}.msg h4{margin-top:0;margin-bottom:5px}.msg.P{border-left-color:#1fa3ec}.msg.P h4{color:#1fa3ec}.msg.D{border-left-color:#dc3630}.msg.D h4{color:#dc3630}.msg.S{border-left-color: #5cb85c}.msg.S h4{color: #5cb85c}"
// lists
"dt{font-weight:bold}dd{margin:0;padding:0 0 0.5em 0;min-height:12px}"
"td{vertical-align: top;}"
".h{display:none}"
"button{transition: 0s opacity;transition-delay: 3s;transition-duration: 0s;cursor: pointer}"
"button.D{background-color:#dc3630}"
"button:active{opacity:50% !important;cursor:wait;transition-delay: 0s}"
// invert
"body.invert{background-color:#060606;}"
"body.invert,body.invert a,body.invert h1 {color:#fff;}"
"body.invert .msg{color:#fff;background-color:#282828;border-top:1px solid #555;border-right:1px solid #555;border-bottom:1px solid #555;}"
"body.invert .q[role=img]{-webkit-filter:invert(1);filter:invert(1);}"
":disabled {opacity: 0.5;}"
"</style>";
#ifndef WM_NOHELP
const char HTTP_HELP[] PROGMEM =
"<br/><h3>Available pages</h3><hr>"
"<table class='table'>"
"<thead><tr><th>Page</th><th>Function</th></tr></thead><tbody>"
"<tr><td><a href='/'>/</a></td>"
"<td>Menu page.</td></tr>"
"<tr><td><a href='/wifi'>/wifi</a></td>"
"<td>Show WiFi scan results and enter WiFi configuration.(/0wifi noscan)</td></tr>"
"<tr><td><a href='/wifisave'>/wifisave</a></td>"
"<td>Save WiFi configuration information and configure device. Needs variables supplied.</td></tr>"
"<tr><td><a href='/param'>/param</a></td>"
"<td>Parameter page</td></tr>"
"<tr><td><a href='/info'>/info</a></td>"
"<td>Information page</td></tr>"
"<tr><td><a href='/u'>/u</a></td>"
"<td>OTA Update</td></tr>"
"<tr><td><a href='/close'>/close</a></td>"
"<td>Close the captiveportal popup, config portal will remain active</td></tr>"
"<tr><td>/exit</td>"
"<td>Exit Config portal, config portal will close</td></tr>"
"<tr><td>/restart</td>"
"<td>Reboot the device</td></tr>"
"<tr><td>/erase</td>"
"<td>Erase WiFi configuration and reboot device. Device will not reconnect to a network until new WiFi configuration data is entered.</td></tr>"
"</table>"
"<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
#else
const char HTTP_HELP[] PROGMEM = "";
#endif
const char HTTP_UPDATE[] PROGMEM = "Upload new firmware<br/><form method='POST' action='u' enctype='multipart/form-data' onchange=\"(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)\"><input type='file' name='update' accept='.bin,application/octet-stream'><button id='uploadbin' type='submit' class='h D'>Update</button></form><small><a href='http://192.168.4.1/update' target='_blank'>* May not function inside captive portal, open in browser http://192.168.4.1</a></small>";
const char HTTP_UPDATE_FAIL[] PROGMEM = "<div class='msg D'><strong>Update failed!</strong><Br/>Reboot device and try again</div>";
const char HTTP_UPDATE_SUCCESS[] PROGMEM = "<div class='msg S'><strong>Update successful. </strong> <br/> Device rebooting now...</div>";
#ifdef WM_JSTEST
const char HTTP_JS[] PROGMEM =
"<script>function postAjax(url, data, success) {"
" var params = typeof data == 'string' ? data : Object.keys(data).map("
" function(k){ return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) }"
" ).join('&');"
" var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");"
" xhr.open('POST', url);"
" xhr.onreadystatechange = function() {"
" if (xhr.readyState>3 && xhr.status==200) { success(xhr.responseText); }"
" };"
" xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');"
" xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');"
" xhr.send(params);"
" return xhr;}"
"postAjax('/status', 'p1=1&p2=Hello+World', function(data){ console.log(data); });"
"postAjax('/status', { p1: 1, p2: 'Hello World' }, function(data){ console.log(data); });"
"</script>";
#endif
// Info html
// @todo remove html elements from progmem, repetetive strings
#ifdef ESP32
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp32</h3><hr><dl>";
const char HTTP_INFO_chiprev[] PROGMEM = "<dt>Chip rev</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_aphost[] PROGMEM = "<dt>Access point hostname</dt><dd>{1}</dd>";
const char HTTP_INFO_psrsize[] PROGMEM = "<dt>PSRAM Size</dt><dd>{1} bytes</dd>";
const char HTTP_INFO_temp[] PROGMEM = "<dt>Temperature</dt><dd>{1} C&deg; / {2} F&deg;</dd>";
const char HTTP_INFO_hall[] PROGMEM = "<dt>Hall</dt><dd>{1}</dd>";
#else
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp8266</h3><hr><dl>";
const char HTTP_INFO_fchipid[] PROGMEM = "<dt>Flash chip ID</dt><dd>{1}</dd>";
const char HTTP_INFO_corever[] PROGMEM = "<dt>Core version</dt><dd>{1}</dd>";
const char HTTP_INFO_bootver[] PROGMEM = "<dt>Boot version</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>{1}</dd>";
const char HTTP_INFO_flashsize[] PROGMEM = "<dt>Real flash size</dt><dd>{1} bytes</dd>";
#endif
const char HTTP_INFO_memsmeter[] PROGMEM = "<br/><progress value='{1}' max='{2}'></progress></dd>";
const char HTTP_INFO_memsketch[] PROGMEM = "<dt>Memory - Sketch size</dt><dd>Used / Total bytes<br/>{1} / {2}";
const char HTTP_INFO_freeheap[] PROGMEM = "<dt>Memory - Free heap</dt><dd>{1} bytes available</dd>";
const char HTTP_INFO_wifihead[] PROGMEM = "<br/><h3>WiFi</h3><hr>";
const char HTTP_INFO_uptime[] PROGMEM = "<dt>Uptime</dt><dd>{1} mins {2} secs</dd>";
const char HTTP_INFO_chipid[] PROGMEM = "<dt>Chip ID</dt><dd>{1}</dd>";
const char HTTP_INFO_idesize[] PROGMEM = "<dt>Flash size</dt><dd>{1} bytes</dd>";
const char HTTP_INFO_sdkver[] PROGMEM = "<dt>SDK version</dt><dd>{1}</dd>";
const char HTTP_INFO_cpufreq[] PROGMEM = "<dt>CPU frequency</dt><dd>{1}MHz</dd>";
const char HTTP_INFO_apip[] PROGMEM = "<dt>Access point IP</dt><dd>{1}</dd>";
const char HTTP_INFO_apmac[] PROGMEM = "<dt>Access point MAC</dt><dd>{1}</dd>";
const char HTTP_INFO_apssid[] PROGMEM = "<dt>Access point SSID</dt><dd>{1}</dd>";
const char HTTP_INFO_apbssid[] PROGMEM = "<dt>BSSID</dt><dd>{1}</dd>";
const char HTTP_INFO_stassid[] PROGMEM = "<dt>Station SSID</dt><dd>{1}</dd>";
const char HTTP_INFO_staip[] PROGMEM = "<dt>Station IP</dt><dd>{1}</dd>";
const char HTTP_INFO_stagw[] PROGMEM = "<dt>Station gateway</dt><dd>{1}</dd>";
const char HTTP_INFO_stasub[] PROGMEM = "<dt>Station subnet</dt><dd>{1}</dd>";
const char HTTP_INFO_dnss[] PROGMEM = "<dt>DNS Server</dt><dd>{1}</dd>";
const char HTTP_INFO_host[] PROGMEM = "<dt>Hostname</dt><dd>{1}</dd>";
const char HTTP_INFO_stamac[] PROGMEM = "<dt>Station MAC</dt><dd>{1}</dd>";
const char HTTP_INFO_conx[] PROGMEM = "<dt>Connected</dt><dd>{1}</dd>";
const char HTTP_INFO_autoconx[] PROGMEM = "<dt>Autoconnect</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutver[] PROGMEM = "<dt>WiFiManager</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutarduino[] PROGMEM = "<dt>Arduino</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutsdk[] PROGMEM = "<dt>ESP-SDK/IDF</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutdate[] PROGMEM = "<dt>Build date</dt><dd>{1}</dd>";
const char S_brand[] PROGMEM = "WiFiManager";
const char S_debugPrefix[] PROGMEM = "*wm:";
const char S_y[] PROGMEM = "Yes";
const char S_n[] PROGMEM = "No";
const char S_enable[] PROGMEM = "Enabled";
const char S_disable[] PROGMEM = "Disabled";
const char S_GET[] PROGMEM = "GET";
const char S_POST[] PROGMEM = "POST";
const char S_NA[] PROGMEM = "Unknown";
const char S_passph[] PROGMEM = "********";
const char S_titlewifisaved[] PROGMEM = "Credentials saved";
const char S_titlewifisettings[] PROGMEM = "Settings saved";
const char S_titlewifi[] PROGMEM = "Config ESP";
const char S_titleinfo[] PROGMEM = "Info";
const char S_titleparam[] PROGMEM = "Setup";
const char S_titleparamsaved[] PROGMEM = "Setup saved";
const char S_titleexit[] PROGMEM = "Exit";
const char S_titlereset[] PROGMEM = "Reset";
const char S_titleerase[] PROGMEM = "Erase";
const char S_titleclose[] PROGMEM = "Close";
const char S_options[] PROGMEM = "options";
const char S_nonetworks[] PROGMEM = "No networks found. Refresh to scan again.";
const char S_staticip[] PROGMEM = "Static IP";
const char S_staticgw[] PROGMEM = "Static gateway";
const char S_staticdns[] PROGMEM = "Static DNS";
const char S_subnet[] PROGMEM = "Subnet";
const char S_exiting[] PROGMEM = "Exiting";
const char S_resetting[] PROGMEM = "Module will reset in a few seconds.";
const char S_closing[] PROGMEM = "You can close the page, portal will continue to run";
const char S_error[] PROGMEM = "An error occured";
const char S_notfound[] PROGMEM = "File not found\n\n";
const char S_uri[] PROGMEM = "URI: ";
const char S_method[] PROGMEM = "\nMethod: ";
const char S_args[] PROGMEM = "\nArguments: ";
const char S_parampre[] PROGMEM = "param_";
// debug strings
const char D_HR[] PROGMEM = "--------------------";
// softap ssid default prefix
#ifdef ESP8266
const char S_ssidpre[] PROGMEM = "ESP";
#elif defined(ESP32)
const char S_ssidpre[] PROGMEM = "ESP32";
#else
const char S_ssidpre[] PROGMEM = "WM";
#endif
// END WIFI_MANAGER_OVERRIDE_STRINGS
#endif
#endif
+282
View File
@@ -0,0 +1,282 @@
/**
* SAMPLE SAMPLE SAMPLE
*
* wm_strings_es.h
* spanish strings for
* WiFiManager, a library for the ESPX/Arduino platform
* for configuration of WiFi credentials using a Captive Portal
*
* @author Creator tzapu
* @author tablatronix
* @version 0.0.0
* @license MIT
*/
#ifndef _WM_STRINGS_EN_H_
#define _WM_STRINGS_EN_H_
/**
* ADD TO BUILD FLAGS
* -DWM_STRINGS_FILE="\"wm_strings_es.h\""
*/
#ifndef WIFI_MANAGER_OVERRIDE_STRINGS
// !!! ABOVE WILL NOT WORK if you define in your sketch, must be build flag, if anyone one knows how to order includes to be able to do this it would be neat.. I have seen it done..
// strings files must include a consts file!
// Copy and change to custom locale tokens if necessary, but strings should be good enough
#include "wm_consts_en.h" // include constants, tokens, routes
const char WM_LANGUAGE[] PROGMEM = "es-ES"; // i18n lang code
const char HTTP_HEAD_START[] PROGMEM = "<!DOCTYPE html>"
"<html lang='en'><head>"
"<meta name='format-detection' content='telephone=no'>"
"<meta charset='UTF-8'>"
"<meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>"
"<title>{v}</title>";
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){"
"document.getElementById('s').value=l.getAttribute('data-ssid')||l.innerText||l.textContent;"
"p = l.nextElementSibling.classList.contains('l');"
"document.getElementById('p').disabled = !p;"
"if(p)document.getElementById('p').focus();};"
"function f() {var x = document.getElementById('p');x.type==='password'?x.type='text':x.type='password';}"
"</script>"; // @todo add button states, disable on click , show ack , spinner etc
const char HTTP_HEAD_END[] PROGMEM = "</head><body class='{c}'><div class='wrap'>"; // {c} = _bodyclass
// example of embedded logo, base64 encoded inline, No styling here
// const char HTTP_ROOT_MAIN[] PROGMEM = "<img title=' alt=' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADQElEQVRoQ+2YjW0VQQyE7Q6gAkgFkAogFUAqgFQAVACpAKiAUAFQAaECQgWECggVGH1PPrRvn3dv9/YkFOksoUhhfzwz9ngvKrc89JbnLxuA/63gpsCmwCADWwkNEji8fVNgotDM7osI/x777x5l9F6JyB8R4eeVql4P0y8yNsjM7KGIPBORp558T04A+CwiH1UVUItiUQmZ2XMReSEiAFgjAPBeVS96D+sCYGaUx4cFbLfmhSpnqnrZuqEJgJnd8cQplVLciAgX//Cf0ToIeOB9wpmloLQAwpnVmAXgdf6pwjpJIz+XNoeZQQZlODV9vhc1Tuf6owrAk/8qIhFbJH7eI3eEzsvydQEICqBEkZwiALfF70HyHPpqScPV5HFjeFu476SkRA0AzOfy4hYwstj2ZkDgaphE7m6XqnoS7Q0BOPs/sw0kDROzjdXcCMFCNwzIy0EcRcOvBACfh4k0wgOmBX4xjfmk4DKTS31hgNWIKBCI8gdzogTgjYjQWFMw+o9LzJoZ63GUmjWm2wGDc7EvDDOj/1IVMIyD9SUAL0WEhpriRlXv5je5S+U1i2N88zdPuoVkeB+ls4SyxCoP3kVm9jsjpEsBLoOBNC5U9SwpGdakFkviuFP1keblATkTENTYcxkzgxTKOI3jyDxqLkQT87pMA++H3XvJBYtsNbBN6vuXq5S737WqHkW1VgMQNXJ0RshMqbbT33sJ5kpHWymzcJjNTeJIymJZtSQd9NHQHS1vodoFoTMkfbJzpRnLzB2vi6BZAJxWaCr+62BC+jzAxVJb3dmmiLzLwZhZNPE5e880Suo2AZgB8e8idxherqUPnT3brBDTlPxO3Z66rVwIwySXugdNd+5ejhqp/+NmgIwGX3Py3QBmlEi54KlwmjkOytQ+iJrLJj23S4GkOeecg8G091no737qvRRdzE+HLALQoMTBbJgBsCj5RSWUlUVJiZ4SOljb05eLFWgoJ5oY6yTyJp62D39jDANoKKcSocPJD5dQYzlFAFZJflUArgTPZKZwLXAnHmerfJquUkKZEgyzqOb5TuDt1P3nwxobqwPocZA11m4A1mBx5IxNgRH21ti7KbAGiyNn3HoF/gJ0w05A8xclpwAAAABJRU5ErkJggg==' /><h1>{v}</h1><h3>WiFiManager</h3>";
const char HTTP_ROOT_MAIN[] PROGMEM = "<h1>{t}</h1><h3>{v}</h3>";
const char * const HTTP_PORTAL_MENU[] PROGMEM = {
"<form action='/wifi' method='get'><button>Configurar WiFi</button></form><br/>\n", // MENU_WIFI
"<form action='/0wifi' method='get'><button>Configurar WiFi (sin escanear)</button></form><br/>\n", // MENU_WIFINOSCAN
"<form action='/info' method='get'><button>Información</button></form><br/>\n", // MENU_INFO
"<form action='/param' method='get'><button>Configuración</button></form><br/>\n",//MENU_PARAM
"<form action='/close' method='get'><button>Cerca</button></form><br/>\n", // MENU_CLOSE
"<form action='/restart' method='get'><button>Reanudar</button></form><br/>\n",// MENU_RESTART
"<form action='/exit' method='get'><button>Salida</button></form><br/>\n", // MENU_EXIT
"<form action='/erase' method='get'><button class='D'>Borrar</button></form><br/>\n", // MENU_ERASE
"<form action='/update' method='get'><button>Actualizer</button></form><br/>\n",// MENU_UPDATE
"<hr><br/>" // MENU_SEP
};
// const char HTTP_PORTAL_OPTIONS[] PROGMEM = strcat(HTTP_PORTAL_MENU[0] , HTTP_PORTAL_MENU[3] , HTTP_PORTAL_MENU[7]);
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "";
const char HTTP_ITEM_QI[] PROGMEM = "<div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i} {h}'></div>"; // rssi icons
const char HTTP_ITEM_QP[] PROGMEM = "<div class='q {h}'>{r}%</div>"; // rssi percentage {h} = hidden showperc pref
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)' data-ssid='{V}'>{v}</a>{qi}{qp}</div>"; // {q} = HTTP_ITEM_QI, {r} = HTTP_ITEM_QP
// const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a> {R} {r}% {q} {e}</div>"; // test all tokens
const char HTTP_FORM_START[] PROGMEM = "<form method='POST' action='{v}'>";
const char HTTP_FORM_WIFI[] PROGMEM = "<label for='s'>SSID</label><input id='s' name='s' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='{v}'><br/><label for='p'>Contraseña</label><input id='p' name='p' maxlength='64' type='password' placeholder='{p}'><input type='checkbox' onclick='f()'> Mostrar contraseña";
const char HTTP_FORM_WIFI_END[] PROGMEM = "";
const char HTTP_FORM_STATIC_HEAD[] PROGMEM = "<hr><br/>";
const char HTTP_FORM_END[] PROGMEM = "<br/><br/><button type='submit'>Save</button></form>";
const char HTTP_FORM_LABEL[] PROGMEM = "<label for='{i}'>{t}</label>";
const char HTTP_FORM_PARAM_HEAD[] PROGMEM = "<hr><br/>";
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' maxlength='{l}' value='{v}' {c}>\n"; // do not remove newline!
const char HTTP_SCAN_LINK[] PROGMEM = "<br/><form action='/wifi?refresh=1' method='POST'><button name='refresh' value='1'>Refresh</button></form>";
const char HTTP_SAVED[] PROGMEM = "<div class='msg'>Saving Credentials<br/>Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>";
const char HTTP_PARAMSAVED[] PROGMEM = "<div class='msg S'>Saved<br/></div>";
const char HTTP_END[] PROGMEM = "</div></body></html>";
const char HTTP_ERASEBTN[] PROGMEM = "<br/><form action='/erase' method='get'><button class='D'>Erase WiFi Config</button></form>";
const char HTTP_UPDATEBTN[] PROGMEM = "<br/><form action='/update' method='get'><button>Actualizer</button></form>";
const char HTTP_BACKBTN[] PROGMEM = "<hr><br/><form action='/' method='get'><button>Atrás</button></form>";
const char HTTP_STATUS_ON[] PROGMEM = "<div class='msg S'><strong>Conectado</strong> a {v}<br/><em><small>con IP {i}</small></em></div>";
const char HTTP_STATUS_OFF[] PROGMEM = "<div class='msg {c}'><strong>No conectado</strong> a {v}{r}</div>"; // {c=class} {v=ssid} {r=status_off}
const char HTTP_STATUS_OFFPW[] PROGMEM = "<br/>Authentication Failure"; // STATION_WRONG_PASSWORD, no eps32
const char HTTP_STATUS_OFFNOAP[] PROGMEM = "<br/>No Encontrado"; // WL_NO_SSID_AVAIL
const char HTTP_STATUS_OFFFAIL[] PROGMEM = "<br/>No se pudo conectar"; // WL_CONNECT_FAILED
const char HTTP_STATUS_NONE[] PROGMEM = "<div class='msg'>Sin AP establecido</div>";
const char HTTP_BR[] PROGMEM = "<br/>";
const char HTTP_STYLE[] PROGMEM = "<style>"
".c,body{text-align:center;font-family:verdana}div,input,select{padding:5px;font-size:1em;margin:5px 0;box-sizing:border-box}"
"input,button,select,.msg{border-radius:.3rem;width: 100%}input[type=radio],input[type=checkbox]{width:auto}"
"button,input[type='button'],input[type='submit']{cursor:pointer;border:0;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%}"
"input[type='file']{border:1px solid #1fa3ec}"
".wrap {text-align:left;display:inline-block;min-width:260px;max-width:500px}"
// links
"a{color:#000;font-weight:700;text-decoration:none}a:hover{color:#1fa3ec;text-decoration:underline}"
// quality icons
".q{height:16px;margin:0;padding:0 5px;text-align:right;min-width:38px;float:right}.q.q-0:after{background-position-x:0}.q.q-1:after{background-position-x:-16px}.q.q-2:after{background-position-x:-32px}.q.q-3:after{background-position-x:-48px}.q.q-4:after{background-position-x:-64px}.q.l:before{background-position-x:-80px;padding-right:5px}.ql .q{float:left}.q:after,.q:before{content:'';width:16px;height:16px;display:inline-block;background-repeat:no-repeat;background-position: 16px 0;"
"background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');}"
// icons @2x media query (32px rescaled)
"@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi){.q:before,.q:after {"
"background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');"
"background-size: 95px 16px;}}"
// msg callouts
".msg{padding:20px;margin:20px 0;border:1px solid #eee;border-left-width:5px;border-left-color:#777}.msg h4{margin-top:0;margin-bottom:5px}.msg.P{border-left-color:#1fa3ec}.msg.P h4{color:#1fa3ec}.msg.D{border-left-color:#dc3630}.msg.D h4{color:#dc3630}.msg.S{border-left-color: #5cb85c}.msg.S h4{color: #5cb85c}"
// lists
"dt{font-weight:bold}dd{margin:0;padding:0 0 0.5em 0;min-height:12px}"
"td{vertical-align: top;}"
".h{display:none}"
"button{transition: 0s opacity;transition-delay: 3s;transition-duration: 0s;cursor: pointer}"
"button.D{background-color:#dc3630}"
"button:active{opacity:50% !important;cursor:wait;transition-delay: 0s}"
// invert
"body.invert,body.invert a,body.invert h1 {background-color:#060606;color:#fff;}"
"body.invert .msg{color:#fff;background-color:#282828;border-top:1px solid #555;border-right:1px solid #555;border-bottom:1px solid #555;}"
"body.invert .q[role=img]{-webkit-filter:invert(1);filter:invert(1);}"
":disabled {opacity: 0.5;}"
"</style>";
#ifndef WM_NOHELP
const char HTTP_HELP[] PROGMEM =
"<br/><h3>Available Pages</h3><hr>"
"<table class='table'>"
"<thead><tr><th>Page</th><th>Function</th></tr></thead><tbody>"
"<tr><td><a href='/'>/</a></td>"
"<td>Menu page.</td></tr>"
"<tr><td><a href='/wifi'>/wifi</a></td>"
"<td>Show WiFi scan results and enter WiFi configuration.(/0wifi noscan)</td></tr>"
"<tr><td><a href='/wifisave'>/wifisave</a></td>"
"<td>Save WiFi configuration information and configure device. Needs variables supplied.</td></tr>"
"<tr><td><a href='/param'>/param</a></td>"
"<td>Parameter page</td></tr>"
"<tr><td><a href='/info'>/info</a></td>"
"<td>Information page</td></tr>"
"<tr><td><a href='/u'>/u</a></td>"
"<td>OTA Update</td></tr>"
"<tr><td><a href='/close'>/close</a></td>"
"<td>Close the captiveportal popup,configportal will remain active</td></tr>"
"<tr><td>/exit</td>"
"<td>Exit Config Portal, configportal will close</td></tr>"
"<tr><td>/restart</td>"
"<td>Reboot the device</td></tr>"
"<tr><td>/erase</td>"
"<td>Erase WiFi configuration and reboot Device. Device will not reconnect to a network until new WiFi configuration data is entered.</td></tr>"
"</table>"
"<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
#else
const char HTTP_HELP[] PROGMEM = "";
#endif
const char HTTP_UPDATE[] PROGMEM = "Upload New Firmware<br/><form method='POST' action='u' enctype='multipart/form-data' onchange=\"(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)\"><input type='file' name='update' accept='.bin,application/octet-stream'><button id='uploadbin' type='submit' class='h D'>Update</button></form><small><a href='http://192.168.4.1/update' target='_blank'>* May not function inside captive portal, Open in browser http://192.168.4.1</a></small>";
const char HTTP_UPDATE_FAIL[] PROGMEM = "<div class='msg D'><strong>Update Failed!</strong><Br/>Reboot device and try again</div>";
const char HTTP_UPDATE_SUCCESS[] PROGMEM = "<div class='msg S'><strong>Update Successful. </strong> <br/> Device Rebooting now...</div>";
#ifdef WM_JSTEST
const char HTTP_JS[] PROGMEM =
"<script>function postAjax(url, data, success) {"
" var params = typeof data == 'string' ? data : Object.keys(data).map("
" function(k){ return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) }"
" ).join('&');"
" var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");"
" xhr.open('POST', url);"
" xhr.onreadystatechange = function() {"
" if (xhr.readyState>3 && xhr.status==200) { success(xhr.responseText); }"
" };"
" xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');"
" xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');"
" xhr.send(params);"
" return xhr;}"
"postAjax('/status', 'p1=1&p2=Hello+World', function(data){ console.log(data); });"
"postAjax('/status', { p1: 1, p2: 'Hello World' }, function(data){ console.log(data); });"
"</script>";
#endif
// Info html
// @todo remove html elements from progmem, repetetive strings
#ifdef ESP32
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp32</h3><hr><dl>";
const char HTTP_INFO_chiprev[] PROGMEM = "<dt>Chip Rev</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_aphost[] PROGMEM = "<dt>Access Point Hostname</dt><dd>{1}</dd>";
const char HTTP_INFO_psrsize[] PROGMEM = "<dt>PSRAM Size</dt><dd>{1} bytes</dd>";
const char HTTP_INFO_temp[] PROGMEM = "<dt>Temperature</dt><dd>{1} C&deg; / {2} F&deg;</dd><dt>Hall</dt><dd>{3}</dd>";
#else
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp8266</h3><hr><dl>";
const char HTTP_INFO_fchipid[] PROGMEM = "<dt>Flash Chip ID</dt><dd>{1}</dd>";
const char HTTP_INFO_corever[] PROGMEM = "<dt>Core Version</dt><dd>{1}</dd>";
const char HTTP_INFO_bootver[] PROGMEM = "<dt>Boot Version</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>{1}</dd>";
const char HTTP_INFO_flashsize[] PROGMEM = "<dt>Real Flash Size</dt><dd>{1} bytes</dd>";
#endif
const char HTTP_INFO_memsmeter[] PROGMEM = "<br/><progress value='{1}' max='{2}'></progress></dd>";
const char HTTP_INFO_memsketch[] PROGMEM = "<dt>Memory - Sketch Size</dt><dd>Used / Total bytes<br/>{1} / {2}";
const char HTTP_INFO_freeheap[] PROGMEM = "<dt>Memory - Free Heap</dt><dd>{1} bytes available</dd>";
const char HTTP_INFO_wifihead[] PROGMEM = "<br/><h3>WiFi</h3><hr>";
const char HTTP_INFO_uptime[] PROGMEM = "<dt>Uptime</dt><dd>{1} Mins {2} Secs</dd>";
const char HTTP_INFO_chipid[] PROGMEM = "<dt>Chip ID</dt><dd>{1}</dd>";
const char HTTP_INFO_idesize[] PROGMEM = "<dt>Flash Size</dt><dd>{1} bytes</dd>";
const char HTTP_INFO_sdkver[] PROGMEM = "<dt>SDK Version</dt><dd>{1}</dd>";
const char HTTP_INFO_cpufreq[] PROGMEM = "<dt>CPU Frequency</dt><dd>{1}MHz</dd>";
const char HTTP_INFO_apip[] PROGMEM = "<dt>Access Point IP</dt><dd>{1}</dd>";
const char HTTP_INFO_apmac[] PROGMEM = "<dt>Access Point MAC</dt><dd>{1}</dd>";
const char HTTP_INFO_apssid[] PROGMEM = "<dt>Access Point SSID</dt><dd>{1}</dd>";
const char HTTP_INFO_apbssid[] PROGMEM = "<dt>BSSID</dt><dd>{1}</dd>";
const char HTTP_INFO_stassid[] PROGMEM = "<dt>Station SSID</dt><dd>{1}</dd>";
const char HTTP_INFO_staip[] PROGMEM = "<dt>Station IP</dt><dd>{1}</dd>";
const char HTTP_INFO_stagw[] PROGMEM = "<dt>Station Gateway</dt><dd>{1}</dd>";
const char HTTP_INFO_stasub[] PROGMEM = "<dt>Station Subnet</dt><dd>{1}</dd>";
const char HTTP_INFO_dnss[] PROGMEM = "<dt>DNS Server</dt><dd>{1}</dd>";
const char HTTP_INFO_host[] PROGMEM = "<dt>Hostname</dt><dd>{1}</dd>";
const char HTTP_INFO_stamac[] PROGMEM = "<dt>Station MAC</dt><dd>{1}</dd>";
const char HTTP_INFO_conx[] PROGMEM = "<dt>Connected</dt><dd>{1}</dd>";
const char HTTP_INFO_autoconx[] PROGMEM = "<dt>Autoconnect</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutver[] PROGMEM = "<dt>WiFiManager</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutarduino[] PROGMEM = "<dt>Arduino</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutsdk[] PROGMEM = "<dt>ESP-SDK/IDF</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutdate[] PROGMEM = "<dt>Build Date</dt><dd>{1}</dd>";
const char S_brand[] PROGMEM = "WiFiManager";
const char S_debugPrefix[] PROGMEM = "*wm:";
const char S_y[] PROGMEM = "Yes";
const char S_n[] PROGMEM = "No";
const char S_enable[] PROGMEM = "Enabled";
const char S_disable[] PROGMEM = "Disabled";
const char S_GET[] PROGMEM = "GET";
const char S_POST[] PROGMEM = "POST";
const char S_NA[] PROGMEM = "Unknown";
const char S_passph[] PROGMEM = "********";
const char S_titlewifisaved[] PROGMEM = "Credentials Saved";
const char S_titlewifisettings[] PROGMEM = "Settings Saved";
const char S_titlewifi[] PROGMEM = "Config ESP";
const char S_titleinfo[] PROGMEM = "Info";
const char S_titleparam[] PROGMEM = "Setup";
const char S_titleparamsaved[] PROGMEM = "Setup Saved";
const char S_titleexit[] PROGMEM = "Exit";
const char S_titlereset[] PROGMEM = "Reset";
const char S_titleerase[] PROGMEM = "Erase";
const char S_titleclose[] PROGMEM = "Close";
const char S_options[] PROGMEM = "options";
const char S_nonetworks[] PROGMEM = "No networks found. Refresh to scan again.";
const char S_staticip[] PROGMEM = "Static IP";
const char S_staticgw[] PROGMEM = "Static Gateway";
const char S_staticdns[] PROGMEM = "Static DNS";
const char S_subnet[] PROGMEM = "Subnet";
const char S_exiting[] PROGMEM = "Exiting";
const char S_resetting[] PROGMEM = "Module will reset in a few seconds.";
const char S_closing[] PROGMEM = "You can close the page, portal will continue to run";
const char S_error[] PROGMEM = "An Error Occured";
const char S_notfound[] PROGMEM = "File Not Found\n\n";
const char S_uri[] PROGMEM = "URI: ";
const char S_method[] PROGMEM = "\nMethod: ";
const char S_args[] PROGMEM = "\nArguments: ";
const char S_parampre[] PROGMEM = "param_";
// debug strings
const char D_HR[] PROGMEM = "--------------------";
// softap ssid default prefix
#ifdef ESP8266
const char S_ssidpre[] PROGMEM = "ESP";
#elif defined(ESP32)
const char S_ssidpre[] PROGMEM = "ESP32";
#else
const char S_ssidpre[] PROGMEM = "WM";
#endif
// END WIFI_MANAGER_OVERRIDE_STRINGS
#endif
#endif
+276
View File
@@ -0,0 +1,276 @@
/**
* wm_strings_fr.h
* French strings for
* WiFiManager, a library for the ESP8266/Arduino platform
* for configuration of WiFi credentials using a Captive Portal
*
* @author Creator tzapu
* @author tablatronix
* @version 0.0.1
* @translated AByGCreation
* @license MIT
*/
#ifndef _WM_STRINGS_EN_H_
#define _WM_STRINGS_EN_H_
#ifndef WIFI_MANAGER_OVERRIDE_STRINGS
// !!! ABOVE WILL NOT WORK if you define in your sketch, must be build flag, if anyone one knows how to order includes to be able to do this it would be neat.. I have seen it done..
// strings files must include a consts file!
#include "wm_consts_en.h" // include constants, tokens, routes
const char WM_LANGUAGE[] PROGMEM = "fr-FR"; // i18n lang code
const char HTTP_HEAD_START[] PROGMEM = "<!DOCTYPE html>"
"<html lang='fr'><head>"
"<meta name='format-detection' content='telephone=no'>"
"<meta charset='UTF-8'>"
"<meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>"
"<title>{v}</title>";
const char HTTP_SCRIPT[] PROGMEM = "<script>function c(l){"
"document.getElementById('s').value=l.getAttribute('data-ssid')||l.innerText||l.textContent;"
"p = l.nextElementSibling.classList.contains('l');"
"document.getElementById('p').disabled = !p;"
"if(p)document.getElementById('p').focus();};"
"function f() {var x = document.getElementById('p');x.type==='password'?x.type='text':x.type='password';}"
"</script>"; // @todo add button states, disable on click , show ack , spinner etc
const char HTTP_HEAD_END[] PROGMEM = "</head><body class='{c}'><div class='wrap'>"; // {c} = _bodyclass
// example of embedded logo, base64 encoded inline, No styling here
// const char HTTP_ROOT_MAIN[] PROGMEM = "<img title=' alt=' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADQElEQVRoQ+2YjW0VQQyE7Q6gAkgFkAogFUAqgFQAVACpAKiAUAFQAaECQgWECggVGH1PPrRvn3dv9/YkFOksoUhhfzwz9ngvKrc89JbnLxuA/63gpsCmwCADWwkNEji8fVNgotDM7osI/x777x5l9F6JyB8R4eeVql4P0y8yNsjM7KGIPBORp558T04A+CwiH1UVUItiUQmZ2XMReSEiAFgjAPBeVS96D+sCYGaUx4cFbLfmhSpnqnrZuqEJgJnd8cQplVLciAgX//Cf0ToIeOB9wpmloLQAwpnVmAXgdf6pwjpJIz+XNoeZQQZlODV9vhc1Tuf6owrAk/8qIhFbJH7eI3eEzsvydQEICqBEkZwiALfF70HyHPpqScPV5HFjeFu476SkRA0AzOfy4hYwstj2ZkDgaphE7m6XqnoS7Q0BOPs/sw0kDROzjdXcCMFCNwzIy0EcRcOvBACfh4k0wgOmBX4xjfmk4DKTS31hgNWIKBCI8gdzogTgjYjQWFMw+o9LzJoZ63GUmjWm2wGDc7EvDDOj/1IVMIyD9SUAL0WEhpriRlXv5je5S+U1i2N88zdPuoVkeB+ls4SyxCoP3kVm9jsjpEsBLoOBNC5U9SwpGdakFkviuFP1keblATkTENTYcxkzgxTKOI3jyDxqLkQT87pMA++H3XvJBYtsNbBN6vuXq5S737WqHkW1VgMQNXJ0RshMqbbT33sJ5kpHWymzcJjNTeJIymJZtSQd9NHQHS1vodoFoTMkfbJzpRnLzB2vi6BZAJxWaCr+62BC+jzAxVJb3dmmiLzLwZhZNPE5e880Suo2AZgB8e8idxherqUPnT3brBDTlPxO3Z66rVwIwySXugdNd+5ejhqp/+NmgIwGX3Py3QBmlEi54KlwmjkOytQ+iJrLJj23S4GkOeecg8G091no737qvRRdzE+HLALQoMTBbJgBsCj5RSWUlUVJiZ4SOljb05eLFWgoJ5oY6yTyJp62D39jDANoKKcSocPJD5dQYzlFAFZJflUArgTPZKZwLXAnHmerfJquUkKZEgyzqOb5TuDt1P3nwxobqwPocZA11m4A1mBx5IxNgRH21ti7KbAGiyNn3HoF/gJ0w05A8xclpwAAAABJRU5ErkJggg==' /><h1>{v}</h1><h3>WiFiManager</h3>";
const char HTTP_ROOT_MAIN[] PROGMEM = "<h1>{t}</h1><h3>{v}</h3>";
const char * const HTTP_PORTAL_MENU[] PROGMEM = {
"<form action='/wifi' method='get'><button>Configure WiFi</button></form><br/>\n", // MENU_WIFI
"<form action='/0wifi' method='get'><button>Configure WiFi (Sans scan)</button></form><br/>\n", // MENU_WIFINOSCAN
"<form action='/info' method='get'><button>Info</button></form><br/>\n", // MENU_INFO
"<form action='/param' method='get'><button>Configuration</button></form><br/>\n",//MENU_PARAM
"<form action='/close' method='get'><button>Fermer</button></form><br/>\n", // MENU_CLOSE
"<form action='/restart' method='get'><button>Redémarrer</button></form><br/>\n",// MENU_RESTART
"<form action='/exit' method='get'><button>Quitter</button></form><br/>\n", // MENU_EXIT
"<form action='/erase' method='get'><button class='D'>Effacer</button></form><br/>\n", // MENU_ERASE
"<form action='/update' method='get'><button>Mettre à jour</button></form><br/>\n",// MENU_UPDATE
"<hr><br/>" // MENU_SEP
};
// const char HTTP_PORTAL_OPTIONS[] PROGMEM = strcat(HTTP_PORTAL_MENU[0] , HTTP_PORTAL_MENU[3] , HTTP_PORTAL_MENU[7]);
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "";
const char HTTP_ITEM_QI[] PROGMEM = "<div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i} {h}'></div>"; // rssi icons
const char HTTP_ITEM_QP[] PROGMEM = "<div class='q {h}'>{r}%</div>"; // rssi percentage {h} = hidden showperc pref
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)' data-ssid='{V}'>{v}</a>{qi}{qp}</div>"; // {q} = HTTP_ITEM_QI, {r} = HTTP_ITEM_QP
// const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a> {R} {r}% {q} {e}</div>"; // test all tokens
const char HTTP_FORM_START[] PROGMEM = "<form method='POST' action='{v}'>";
const char HTTP_FORM_WIFI[] PROGMEM = "<label for='s'>SSID</label><input id='s' name='s' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='{v}'><br/><label for='p'>Mot de passe</label><input id='p' name='p' maxlength='64' type='password' placeholder='{p}'><input type='checkbox' id='showpass' onclick='f()'> <label for='showpass'>Voir le mot de passe</label><br/>";
const char HTTP_FORM_WIFI_END[] PROGMEM = "";
const char HTTP_FORM_STATIC_HEAD[] PROGMEM = "<hr><br/>";
const char HTTP_FORM_END[] PROGMEM = "<br/><br/><button type='submit'>Enregistrer</button></form>";
const char HTTP_FORM_LABEL[] PROGMEM = "<label for='{i}'>{t}</label>";
const char HTTP_FORM_PARAM_HEAD[] PROGMEM = "<hr><br/>";
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' maxlength='{l}' value='{v}' {c}>\n"; // do not remove newline!
const char HTTP_SCAN_LINK[] PROGMEM = "<br/><form action='/wifi?refresh=1' method='POST'><button name='refresh' value='1'>Rafraichir</button></form>";
const char HTTP_SAVED[] PROGMEM = "<div class='msg'>Enregistrer l'accès<br/>L'ESP essai de se connecter au réseau.<br />Si échec, merci de vous reconnecter à nouveau.</div>";
const char HTTP_PARAMSAVED[] PROGMEM = "<div class='msg S'>Enregistré<br/></div>";
const char HTTP_END[] PROGMEM = "</div></body></html>";
const char HTTP_ERASEBTN[] PROGMEM = "<br/><form action='/erase' method='get'><button class='D'>Effacer la configuration WiFi</button></form>";
const char HTTP_UPDATEBTN[] PROGMEM = "<br/><form action='/update' method='get'><button>Mettre à jour</button></form>";
const char HTTP_BACKBTN[] PROGMEM = "<hr><br/><form action='/' method='get'><button>Retour</button></form>";
const char HTTP_STATUS_ON[] PROGMEM = "<div class='msg S'><strong>Connecté</strong> to {v}<br/><em><small>with IP {i}</small></em></div>";
const char HTTP_STATUS_OFF[] PROGMEM = "<div class='msg {c}'><strong>Non connecté</strong> à {v}{r}</div>"; // {c=class} {v=ssid} {r=status_off}
const char HTTP_STATUS_OFFPW[] PROGMEM = "<br/>Echec d'authentication"; // STATION_WRONG_PASSWORD, no eps32
const char HTTP_STATUS_OFFNOAP[] PROGMEM = "<br/>Point d'accès introuvable"; // WL_NO_SSID_AVAIL
const char HTTP_STATUS_OFFFAIL[] PROGMEM = "<br/>Impossible de se connecter"; // WL_CONNECT_FAILED
const char HTTP_STATUS_NONE[] PROGMEM = "<div class='msg'>Aucune borne sélectionnée</div>";
const char HTTP_BR[] PROGMEM = "<br/>";
const char HTTP_STYLE[] PROGMEM = "<style>"
".c,body{text-align:center;font-family:verdana}div,input,select{padding:5px;font-size:1em;margin:5px 0;box-sizing:border-box}"
"input,button,select,.msg{border-radius:.3rem;width: 100%}input[type=radio],input[type=checkbox]{width:auto}"
"button,input[type='button'],input[type='submit']{cursor:pointer;border:0;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%}"
"input[type='file']{border:1px solid #1fa3ec}"
".wrap {text-align:left;display:inline-block;min-width:260px;max-width:500px}"
// links
"a{color:#000;font-weight:700;text-decoration:none}a:hover{color:#1fa3ec;text-decoration:underline}"
// quality icons
".q{height:16px;margin:0;padding:0 5px;text-align:right;min-width:38px;float:right}.q.q-0:after{background-position-x:0}.q.q-1:after{background-position-x:-16px}.q.q-2:after{background-position-x:-32px}.q.q-3:after{background-position-x:-48px}.q.q-4:after{background-position-x:-64px}.q.l:before{background-position-x:-80px;padding-right:5px}.ql .q{float:left}.q:after,.q:before{content:'';width:16px;height:16px;display:inline-block;background-repeat:no-repeat;background-position: 16px 0;"
"background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');}"
// icons @2x media query (32px rescaled)
"@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi){.q:before,.q:after {"
"background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');"
"background-size: 95px 16px;}}"
// msg callouts
".msg{padding:20px;margin:20px 0;border:1px solid #eee;border-left-width:5px;border-left-color:#777}.msg h4{margin-top:0;margin-bottom:5px}.msg.P{border-left-color:#1fa3ec}.msg.P h4{color:#1fa3ec}.msg.D{border-left-color:#dc3630}.msg.D h4{color:#dc3630}.msg.S{border-left-color: #5cb85c}.msg.S h4{color: #5cb85c}"
// lists
"dt{font-weight:bold}dd{margin:0;padding:0 0 0.5em 0;min-height:12px}"
"td{vertical-align: top;}"
".h{display:none}"
"button{transition: 0s opacity;transition-delay: 3s;transition-duration: 0s;cursor: pointer}"
"button.D{background-color:#dc3630}"
"button:active{opacity:50% !important;cursor:wait;transition-delay: 0s}"
// invert
"body.invert,body.invert a,body.invert h1 {background-color:#060606;color:#fff;}"
"body.invert .msg{color:#fff;background-color:#282828;border-top:1px solid #555;border-right:1px solid #555;border-bottom:1px solid #555;}"
"body.invert .q[role=img]{-webkit-filter:invert(1);filter:invert(1);}"
":disabled {opacity: 0.5;}"
"</style>";
#ifndef WM_NOHELP
const char HTTP_HELP[] PROGMEM =
"<br/><h3>Pages disponibles</h3><hr>"
"<table class='table'>"
"<thead><tr><th></th><th>Fonctions</th></tr></thead><tbody>"
"<tr><td><a href='/'>/</a></td>"
"<td>Menu.</td></tr>"
"<tr><td><a href='/wifi'>/wifi</a></td>"
"<td>Afficher les résultats de l'analyse WiFi et entrer dans la configuration WiFi.(/0wifi noscan)</td></tr>"
"<tr><td><a href='/wifisave'>/wifisave</a></td>"
"<td>Sauvegarde les informations de configuration WiFi et configure l'appareil. Veuillez entrer vos informations de connexion</td></tr>"
"<tr><td><a href='/param'>/param</a></td>"
"<td>Parametres</td></tr>"
"<tr><td><a href='/info'>/info</a></td>"
"<td>Informations</td></tr>"
"<tr><td><a href='/u'>/u</a></td>"
"<td>Mise à jour OTA</td></tr>"
"<tr><td><a href='/close'>/close</a></td>"
"<td>Fermer la fenêtre contextuelle du portail captif, le portail de configuration reste actif.</td></tr>"
"<tr><td>/exit</td>"
"<td>Quitter le portail de configuration, le portail de configuration se ferme</td></tr>"
"<tr><td>/restart</td>"
"<td>Redémarrer l'appareil</td></tr>"
"<tr><td>/erase</td>"
"<td>Effacer la configuration WiFi et redémarrer l'appareil. L'appareil ne se reconnectera pas à un réseau tant que de nouvelles données de configuration WiFi n'auront pas été saisies.</td></tr>"
"</table>"
"<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
#else
const char HTTP_HELP[] PROGMEM = "";
#endif
const char HTTP_UPDATE[] PROGMEM = "Charger le nouveau firmware<br/><form method='POST' action='u' enctype='multipart/form-data' onchange=\"(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)\"><input type='file' name='update' accept='.bin,application/octet-stream'><button id='uploadbin' type='submit' class='h D'>Mise à jour</button></form><small><a href='http://192.168.4.1/update' target='_blank'>* Peut ne pas fonctionner à l'intérieur du portail captif, ouvrir dans le navigateur http://192.168.4.1</a></small>";
const char HTTP_UPDATE_FAIL[] PROGMEM = "<div class='msg D'><strong>Echec de la mise à jour !</strong><Br/>Redémarrer l'appareil et réessayer</div>";
const char HTTP_UPDATE_SUCCESS[] PROGMEM = "<div class='msg S'><strong>Mise à jour réussie. </strong> <br/> L'appareil redémarre maintenant...</div>";
#ifdef WM_JSTEST
const char HTTP_JS[] PROGMEM =
"<script>function postAjax(url, data, success) {"
" var params = typeof data == 'string' ? data : Object.keys(data).map("
" function(k){ return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) }"
" ).join('&');"
" var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");"
" xhr.open('POST', url);"
" xhr.onreadystatechange = function() {"
" if (xhr.readyState>3 && xhr.status==200) { success(xhr.responseText); }"
" };"
" xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');"
" xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');"
" xhr.send(params);"
" return xhr;}"
"postAjax('/status', 'p1=1&p2=Hello+World', function(data){ console.log(data); });"
"postAjax('/status', { p1: 1, p2: 'Hello World' }, function(data){ console.log(data); });"
"</script>";
#endif
// Info html
// @todo remove html elements from progmem, repetetive strings
#ifdef ESP32
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp32</h3><hr><dl>";
const char HTTP_INFO_chiprev[] PROGMEM = "<dt>Version Puce</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Motif de la dernière réinitialisation</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_aphost[] PROGMEM = "<dt>Nom du point d'accès</dt><dd>{1}</dd>";
const char HTTP_INFO_psrsize[] PROGMEM = "<dt>Taille PSRAM </dt><dd>{1} octets</dd>";
const char HTTP_INFO_temp[] PROGMEM = "<dt>Temperature</dt><dd>{1} C&deg; / {2} F&deg;</dd>";
const char HTTP_INFO_hall[] PROGMEM = "<dt>Hall</dt><dd>{1}</dd>";
#else
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp8266</h3><hr><dl>";
const char HTTP_INFO_fchipid[] PROGMEM = "<dt>ID de la puce flash</dt><dd>{1}</dd>";
const char HTTP_INFO_corever[] PROGMEM = "<dt>Version Core</dt><dd>{1}</dd>";
const char HTTP_INFO_bootver[] PROGMEM = "<dt>Version Boot </dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Motif de la dernière réinitialisation</dt><dd>{1}</dd>";
const char HTTP_INFO_flashsize[] PROGMEM = "<dt>Taille réelle de la mémoire Flash</dt><dd>{1} octets</dd>";
#endif
const char HTTP_INFO_memsmeter[] PROGMEM = "<br/><progress value='{1}' max='{2}'></progress></dd>";
const char HTTP_INFO_memsketch[] PROGMEM = "<dt>Mémoire - Taille du programme</dt><dd>Utilisée / Total<br/>{1} / {2}";
const char HTTP_INFO_freeheap[] PROGMEM = "<dt>Mémoire - Tampon</dt><dd>{1} octets disponibles</dd>";
const char HTTP_INFO_wifihead[] PROGMEM = "<br/><h3>WiFi</h3><hr>";
const char HTTP_INFO_uptime[] PROGMEM = "<dt>Temps de fonctionnement </dt><dd>{1} mins {2} secs</dd>";
const char HTTP_INFO_chipid[] PROGMEM = "<dt>ID de l'ESP</dt><dd>{1}</dd>";
const char HTTP_INFO_idesize[] PROGMEM = "<dt>Taille mémoire Flash</dt><dd>{1} octets</dd>";
const char HTTP_INFO_sdkver[] PROGMEM = "<dt>Version SDK</dt><dd>{1}</dd>";
const char HTTP_INFO_cpufreq[] PROGMEM = "<dt>Fréquence processeur</dt><dd>{1}MHz</dd>";
const char HTTP_INFO_apip[] PROGMEM = "<dt>IP du point d'accès</dt><dd>{1}</dd>";
const char HTTP_INFO_apmac[] PROGMEM = "<dt>Adresse MAC du point d'accès</dt><dd>{1}</dd>";
const char HTTP_INFO_apssid[] PROGMEM = "<dt>SSID du point d'accès</dt><dd>{1}</dd>";
const char HTTP_INFO_apbssid[] PROGMEM = "<dt>BSSID</dt><dd>{1}</dd>";
const char HTTP_INFO_stassid[] PROGMEM = "<dt>Identifiant réseau WiFi</dt><dd>{1}</dd>";
const char HTTP_INFO_staip[] PROGMEM = "<dt>Adresse IP</dt><dd>{1}</dd>";
const char HTTP_INFO_stagw[] PROGMEM = "<dt>Passerelle</dt><dd>{1}</dd>";
const char HTTP_INFO_stasub[] PROGMEM = "<dt>Masque de sous-réseau</dt><dd>{1}</dd>";
const char HTTP_INFO_dnss[] PROGMEM = "<dt>Serveur DNS</dt><dd>{1}</dd>";
const char HTTP_INFO_host[] PROGMEM = "<dt>Nom d'hôte</dt><dd>{1}</dd>";
const char HTTP_INFO_stamac[] PROGMEM = "<dt>Adresse MAC</dt><dd>{1}</dd>";
const char HTTP_INFO_conx[] PROGMEM = "<dt>Connecté</dt><dd>{1}</dd>";
const char HTTP_INFO_autoconx[] PROGMEM = "<dt>Autoconnect</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutver[] PROGMEM = "<dt>WiFiManager</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutarduino[] PROGMEM = "<dt>Arduino</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutsdk[] PROGMEM = "<dt>ESP-SDK/IDF</dt><dd>{1}</dd>";
const char HTTP_INFO_aboutdate[] PROGMEM = "<dt>Date de compilation</dt><dd>{1}</dd>";
const char S_brand[] PROGMEM = "WiFiManager";
const char S_debugPrefix[] PROGMEM = "*wm:";
const char S_y[] PROGMEM = "Oui";
const char S_n[] PROGMEM = "Non";
const char S_enable[] PROGMEM = "Activé";
const char S_disable[] PROGMEM = "Desactivé";
const char S_GET[] PROGMEM = "GET";
const char S_POST[] PROGMEM = "POST";
const char S_NA[] PROGMEM = "Inconnue";
const char S_passph[] PROGMEM = "********";
const char S_titlewifisaved[] PROGMEM = "Identifiants sauvegardés";
const char S_titlewifisettings[] PROGMEM = "Paramètres enregistrés";
const char S_titlewifi[] PROGMEM = "Configuration ESP";
const char S_titleinfo[] PROGMEM = "Info";
const char S_titleparam[] PROGMEM = "Configuration";
const char S_titleparamsaved[] PROGMEM = "Configuration sauvegardée";
const char S_titleexit[] PROGMEM = "Quitter";
const char S_titlereset[] PROGMEM = "Réinitialiser";
const char S_titleerase[] PROGMEM = "Effacer";
const char S_titleclose[] PROGMEM = "Fermer";
const char S_options[] PROGMEM = "options";
const char S_nonetworks[] PROGMEM = "Aucun réseau trouvé. Rafraîchir pour scanner à nouveau.";
const char S_staticip[] PROGMEM = "IP Statique";
const char S_staticgw[] PROGMEM = "Passerelle";
const char S_staticdns[] PROGMEM = "DNS";
const char S_subnet[] PROGMEM = "Sous réseau";
const char S_exiting[] PROGMEM = "Exiting";
const char S_resetting[] PROGMEM = "Module will reset in a few seconds.";
const char S_closing[] PROGMEM = "You can close the page, portal will continue to run";
const char S_error[] PROGMEM = "An error occured";
const char S_notfound[] PROGMEM = "File not found\n\n";
const char S_uri[] PROGMEM = "URI: ";
const char S_method[] PROGMEM = "\nMethod: ";
const char S_args[] PROGMEM = "\nArguments: ";
const char S_parampre[] PROGMEM = "param_";
// debug strings
const char D_HR[] PROGMEM = "--------------------";
// softap ssid default prefix
#ifdef ESP8266
const char S_ssidpre[] PROGMEM = "ESP";
#elif defined(ESP32)
const char S_ssidpre[] PROGMEM = "ESP32";
#else
const char S_ssidpre[] PROGMEM = "WM";
#endif
// END WIFI_MANAGER_OVERRIDE_STRINGS
#endif
#endif