{"id":20165471,"url":"https://github.com/tabahi/esp-wifi-config","last_synced_at":"2025-07-02T00:04:03.444Z","repository":{"id":169359566,"uuid":"416956225","full_name":"tabahi/ESP-Wifi-Config","owner":"tabahi","description":"Easily manage/store WiFi credentials for ESP32 and ESP8266","archived":false,"fork":false,"pushed_at":"2025-02-26T13:40:31.000Z","size":225,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:53:23.871Z","etag":null,"topics":["arduino-library","authentication","credentials","esp32","esp32-arduino","esp32-library","esp8266","esp8266-arduino","esp8266-library","gui","wifi-configuration","wifi-modules","wifimanager"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tabahi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-14T01:56:50.000Z","updated_at":"2025-02-26T13:38:17.000Z","dependencies_parsed_at":"2024-02-21T04:30:52.371Z","dependency_job_id":"6297c18c-f201-4c51-8cac-520a4dd50249","html_url":"https://github.com/tabahi/ESP-Wifi-Config","commit_stats":null,"previous_names":["tabahi/esp-wifi-config"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2FESP-Wifi-Config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2FESP-Wifi-Config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2FESP-Wifi-Config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2FESP-Wifi-Config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabahi","download_url":"https://codeload.github.com/tabahi/ESP-Wifi-Config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137995,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-library","authentication","credentials","esp32","esp32-arduino","esp32-library","esp8266","esp8266-arduino","esp8266-library","gui","wifi-configuration","wifi-modules","wifimanager"],"created_at":"2024-11-14T00:37:55.730Z","updated_at":"2025-04-10T00:53:28.986Z","avatar_url":"https://github.com/tabahi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP-Wifi-Config\n An arduino IDE library to easily manage/store WiFi credentials for ESP32 and ESP8266.\n\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/7.png\" alt=\"drawing\" width=\"500\"/\u003e\n\n\n\n## Usage\n\n- When WiFi settings are not configured and the fallback WiFi is not in range then ESP will start in AP_Mode (Access Point). Connect your PC/Phone's WiFi to the AP named ESP_XXXXX, then configure the WiFi settings\n- Browse to URL `192.168.1.1` to configure the WiFi settings. It will restart after sav\ne and will connect to the configured wifi\nDefault login: admin, pass_ESP\n\n- To reset the already known configurations, hold `Config_reset_btn` to `LOW` for 5 to 10 seconds when already in `CLIENT_MODE`. Add your own button mechanism on `Config_reset_btn` pin. It's not the power reset button. Or use  `WifiConfig.ESP_reset_settings()` to reset config memory, then `initialize()` again.\n\n\n- Use `WifiConfig.goWild()` to connect to any password-less WiFi in range. In the example, it's used as the last resort when the configured and fallback WiFis are not found. If there is still no WiFi connection then it will automatically Restart after an hour.\n\n\n\n\n\n## Example\n\nSee the `examples\\ensureWiFi.ino` for a complete example.\n\n\n```cpp\n\n#include \u003cESPWifiConfig.h\u003e\nint Config_reset_btn = 0; //GPIO0, D0 on Node32, D3 on NodeMCU8266. Pressing this button for more than 5-10sec will reset the WiFi configuration\nboolean debug = true; //prints info on Serial when true\n\nESPWifiConfig WifiConfig(\"myESP\", 80, Config_reset_btn, false, \"fallback_wifi\", \"fallback_pass\", debug_true);\n\nvoid setup()\n{\n  Serial.begin(115200);\n  delay(100);\n\n  //AP_MODE is activated when there is no wifi configuration in EEPROM memory and the fallback wifi is not found during scan\n  if (WifiConfig.initialize() == AP_MODE)\n  {\n    WifiConfig.Start_HTTP_Server(600000);\n    //Start HTTP server when initialized in AP_MODE probably because configuration is not found, and fallback_wifi isn't in range\n    //HTTP web server remains active for first 10 minutes (600000 ms) if it's switched into CLIENT_MODE. Set 0 to run it perpetually. It's perpetually ON in AP_MODE.\n  }\n\n  //WifiConfig.ESP_reset_settings(); //use this to reset the Configuration in EEPROM\n\n  WifiConfig.print_settings();\n\n  WifiConfig.ESP_debug(\"Hello\");  //this message will show on the Setup web page\n}\n\n\n\n#define NO_CONNECTION_RESTART_DELAY 3600000 //ms, 1 hour\n#define NO_CONNECTION_GO_WILD_DELAY 1800000 //ms, 30 minutes\n\n\n\nvoid loop()\n{\n  //non-blocking function, 'reconnect_delay' is an interval for reconnection if disconnected\n  WifiConfig.handle(reconnect_delay); \n \n  if (ensure_wifi_connectivity(NO_CONNECTION_GO_WILD_DELAY, NO_CONNECTION_RESTART_DELAY))\n  {\n    //do something when wifi is connected\n  }\n  else\n  {\n    //do something else when wifi is not connected\n  }\n\n  delay(0);\n}\n\n\nunsigned long last_wifi_connect_time = 0;\nunsigned long reconnect_delay = 10000;\n\n\nboolean ensure_wifi_connectivity(unsigned long no_conn_go_wild_delay, unsigned long no_conn_restart_delay)\n{\n  //Access point mode\n  if (WifiConfig.ESP_mode == AP_MODE)  //Can't connect to internet while in this mode\n  {\n    //Connect to the AP wifi myESP_XXXXXX to configure it\n  \n\n    //Go wild after NO CONNECTION for a while\n    //Try to connect to all password-less WiFis in range\n    if (millis() \u003e no_conn_go_wild_delay)\n    {\n      WifiConfig.goWild(); //(it switches to CLIENT_MODE)\n    }\n  }\n  else\n  {\n    //Client Mode\n    if (WifiConfig.ESP_mode == CLIENT_MODE)\n    {\n      if (WifiConfig.wifi_connected)\n      {\n        last_wifi_connect_time = millis();\n        reconnect_delay = 10000;\n        return true;\n        //All good ===================================== connect to a web server or use internet\n      }\n      else\n      {\n        //No or lost connection to the WiFi\n        \n        reconnect_delay = 30000; //10s by default\n\n        if ((millis() - last_wifi_connect_time) \u003e no_conn_restart_delay) //Restart after 1 hour of no connection\n        {\n          Serial.println(\"Restarting...\");\n          ESP.restart();          \n        }\n        else if ((millis() - last_wifi_connect_time) \u003e no_conn_go_wild_delay) \n        {\n          //Try to connect to password-less WiFis after 1/2 hour of NO Wifi\n          if (WifiConfig.goWild() \u003e 0)\n          {\n            // found some NEW unsecured WiFis. If they were found in previous scans, then it will still be zero\n            Serial.println(\"Connecting to open WiFi\");\n          }\n        }\n      }\n    }\n  }\n  return false;\n}\n```\n\n## Editing\n\n\n`ESPWifiConfig` doesn't use SPIFF. It uses virtual EEPROM addresses 0-80 (flash) , which can be lost if compiler configurations are changed during update.\n\nWeb pages can be edited in 'define_vars.h' where the PROGMEM constants are defined as condensed strings. To change the content of webpages, change the html files then paste them as escaped strings in 'define_vars.h'.\n\n## Screenshots\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/1.png\" alt=\"drawing\" width=\"250\"/\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/2.png\" alt=\"drawing\" width=\"250\"/\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/3.png\" alt=\"drawing\" width=\"250\"/\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/4.png\" alt=\"drawing\" width=\"250\"/\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/5.png\" alt=\"drawing\" width=\"250\"/\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/tabahi/ESP-Wifi-Config/master/screenshots/6.png\" alt=\"drawing\" width=\"250\"/\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabahi%2Fesp-wifi-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabahi%2Fesp-wifi-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabahi%2Fesp-wifi-config/lists"}