{"id":20159440,"url":"https://github.com/naguissa/uespconfiglib","last_synced_at":"2026-02-18T23:01:17.578Z","repository":{"id":262434068,"uuid":"887227035","full_name":"Naguissa/uEspConfigLib","owner":"Naguissa","description":"The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib","archived":false,"fork":false,"pushed_at":"2025-12-10T08:05:40.000Z","size":45,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-17T13:03:43.850Z","etag":null,"topics":["arduino","arduino-library","config","configuration","configuration-file","configuration-management","eeprom","esp32","esp32-arduino","esp8266","esp8266-arduino","foroelectro","http-server","littlefs","naguissa","sd-card","spiffs","wifi","wifi-configuration","wifimanager"],"latest_commit_sha":null,"homepage":"https://www.foroelectro.net/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Naguissa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"Naguissa","custom":"https://www.paypal.me/foroelectro"}},"created_at":"2024-11-12T11:40:04.000Z","updated_at":"2026-02-10T23:37:38.000Z","dependencies_parsed_at":"2024-11-12T12:31:23.491Z","dependency_job_id":"68e92af1-5cb0-4023-b2b6-24f3bd4ffaac","html_url":"https://github.com/Naguissa/uEspConfigLib","commit_stats":null,"previous_names":["naguissa/uespconfiglib"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Naguissa/uEspConfigLib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naguissa%2FuEspConfigLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naguissa%2FuEspConfigLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naguissa%2FuEspConfigLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naguissa%2FuEspConfigLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Naguissa","download_url":"https://codeload.github.com/Naguissa/uEspConfigLib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naguissa%2FuEspConfigLib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29597853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T22:25:43.180Z","status":"ssl_error","status_checked_at":"2026-02-18T22:25:42.766Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","arduino-library","config","configuration","configuration-file","configuration-management","eeprom","esp32","esp32-arduino","esp8266","esp8266-arduino","foroelectro","http-server","littlefs","naguissa","sd-card","spiffs","wifi","wifi-configuration","wifimanager"],"created_at":"2024-11-14T00:08:07.097Z","updated_at":"2026-02-18T23:01:17.559Z","avatar_url":"https://github.com/Naguissa.png","language":"C++","funding_links":["https://github.com/sponsors/Naguissa","https://www.paypal.me/foroelectro","https://paypal.me/foroelectro"],"categories":[],"sub_categories":[],"readme":"# The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib\n\nMaster status:  ![Arduino CI](https://github.com/Naguissa/uEspConfigLib/workflows/arduino_ci/badge.svg)\n\n## What is this repository for?\n\nThis library consist in 2 parts:\n\n * One main library, uEspConfigLib, that manages configuration options, defaults, configuration site (HTML and JSON), configuration processing (from a POST of previous site) and configuration storage.\n \n * One interface to manage different configuration storages.\n \nCurrently storage classes are: SD-card, LittleFS, SPIFFS, EEPROM and none (values are lost after restart).\n\n\n## Usage ##\n\n\nTo use it at any point on your sketch, define needed globals:\n\n```\nuEspConfigLibFSInterface * configFs;\nuEspConfigLib * config;\n```\n\n\nThen, at setup(),  you need to choose an storage option among this:\n```\nconfigFs = new uEspConfigLibFSNone();\nconfigFs = new uEspConfigLibFSSpiffs(\"/config.ini\", bool initFS);\nconfigFs = new uEspConfigLibFSLittlefs(\"/config.ini\", bool initFS);\nconfigFs = new uEspConfigLibFSSd(\"/config.ini\", bool initFS, uint8_t CS_pin);\nconfigFs = new uEspConfigLibFSEEPROM(\"unused_parameter\", bool initFS, uint8_t i2c_address);\n```\n\n- If initFS option is true the class will initialize the filesystem as needed, even format it if still not done.\n- Use CS_pin on SD card option to define CS pin when you use a non-standard one.\n- Use i2c_address on EEPROM option to define EEPROM's I2C address when you use a non-standard one.\n\nStill on setup, then you define your config object:\n\n```\nconfig = new uEspConfigLib(configFs);\n```\n\nFinally you need to define your desired configuration options:\n\n```\nconfig-\u003eaddOption(\"name\", \"Description\", \"Default value\"[, Options]);\n```\n\nOptions can be:\n - uEspConfigLib_OPTION_NONE - Regular behaviour\n - uEspConfigLib_OPTION_SCANNER - Adds WiFi scanner window to select desired SSID\n\n\nA typical example could be:\n\n```\nconfig-\u003eaddOption(\"wifi_mode\", \"WiFi mode (C=Client, other=Access Point)\", \"\");\nconfig-\u003eaddOption(\"wifi_ssid\", \"SSID of your WiFi\", \"Unconfigured_device\", uEspConfigLib_OPTION_SCANNER);\nconfig-\u003eaddOption(\"wifi_password\", \"Password of your WiFi\", \"wifi_password\");\n```\n\n**Note:** When an option is defined inmediately its value is set to defined default value.\n\n\n\nAfter that, you can start to use and manipulate any defined option.\n\n\n\n**Read an option:**\n\n```\nchar * charArrayPointer = config-\u003egetPointer(\"name\");\n```\n\nFollowing previous example:\n\n```\nreadResult = config-\u003egetPointer(\"wifi_mode\");\nSerial.print(\"wifi_mode: \");\nSerial.println(readResult);\nreadResult = config-\u003egetPointer(\"wifi_ssid\");\nSerial.print(\"wifi_ssid: \");\nSerial.println(readResult);\nreadResult = config-\u003egetPointer(\"wifi_password\");\nSerial.print(\"wifi_password: \");\nSerial.println(readResult);\n```\n\n**Note:** If option \"name\" is not defined it will return a NULL pointer.\n\n\n\n**Change an option:**\n\n\nYou can change any defined option using:\n\n```\nbool optionFound = config-\u003eset(\"name\", \"new_value\");\n```\n    \nFollowing previous example:\n    \n```\nconfig-\u003eset(\"wifi_mode\", \"A\");\nconfig-\u003eset(\"wifi_ssid\", \"uEspConfigLib_EXAMPLE\");\nconfig-\u003eset(\"wifi_password\", \"\");\n```\n\n\n\nThis may be useful by itself, and this is why uEspConfigLibFSNone is available, but here's one huge extra: FS classes.\n\n\n**Configuration file:**\n\nThis library uses a plain text file to store configuration options. File structure is:\n\n```\n# uConfigLib Configuration file\n# Visit https://github.com/Naguissa/uEspConfigLib for details\n# Syntax:\n# variable = value\n# (spaces and empty lines doesn't care)\n# This file comments: lines starting with #, ; or //\n\n# variable_name -- variable_description\n# Default value: variable_default_value\nvariable_name = variable_value\n\n# variable_name -- variable_description\n# Default value: variable_default_value\nvariable_name = variable_value\n\n# variable_name -- variable_description\n# Default value: variable_default_value\nvariable_name = variable_value\n```\n\n**Note:** This file can be edited manually if you want, but saving values will recreate and overwrite the file-\n\n\n\n**Load configuration from filesystem:**\n\n```\nbool readResult = config-\u003eloadConfigFile();\n```\n\nThis will open configuration file, parse it and set any of the defined options contained in that file.\n\n\n**Store configuration from filesystem:**\n\n```\nbool saveResult = config-\u003esaveConfigFile();\n```\n\n\nThis will recreate and overwrite configuration file with current values.\n\n\n\n\n\n**Web functionality, the last magic touch:**\n\nIf you are using ESP web server:\n\n```\n#ifdef ARDUINO_ARCH_ESP32\n    WebServer server(80);\n#else\n    ESP8266WebServer server(80);\n#endif\n```\n\n\nYou can use the configuration-related web functionality:\n\n\n**Generate and serve an HTML page with a configuration form:**\n\n\n```\nvoid handleGetConfigHtml() {\n    config-\u003ehandleConfigRequestHtml(\u0026server, \"optional_post_path\");\n}\n\n//[...]\n\nserver.on(\"/config_path\", HTTP_GET, handleGetConfigHtml);\n```\n\n\nThis makes uEspConfigLib to serve a configuration form on \"/config_path\" route when accessed via browser.\n\nThe optional \"optional_post_path\" indicates the path where the form values will be posted on submit. Default value is \"/uConfigLib/saveConfig\"\n\n\n**Generate and serve a JSON document with current configuration:**\n\n```\nvoid handleGetConfigJson() {\n    config-\u003ehandleConfigRequestJson(\u0026server);\n}\n\n//[...]\n\n\nserver.on(\"/config_json_path\", HTTP_GET, handleGetConfigJson);\n```\n\nThis makes uEspConfigLib to serve a configuration JSON file with this format:\n\n```\n{\n    \"data\": [\n        {\n            \"name\": \"variable_name\",\n            \"description\": \"variable_description\",\n            \"defaultValue\": \"variable_default_value\",\n            \"value\": \"variable_current_value\"\n        },\n        {\n            \"name\": \"variable_name\",\n            \"description\": \"variable_description\",\n            \"defaultValue\": \"variable_default_value\",\n            \"value\": \"variable_current_value\"\n        },\n        {\n            \"name\": \"variable_name\",\n            \"description\": \"variable_description\",\n            \"defaultValue\": \"variable_default_value\",\n            \"value\": \"variable_current_value\"\n        }\n    ]\n}\n```\n\nThis is useful if you have a complete webpage, as you can add your look\u0026feel to the configuration system.\n\n\n\n\n**Process and store configuration:**\n\n```\nvoid handleSaveConfig() {\n    config-\u003ehandleSaveConfig(\u0026server);\n}\n\n//[...]\n\nserver.on(\"/save_config_path\", HTTP_POST, handleSaveConfig);\n```\n\nThis will process and store any defined value passed as argument. This accepts any number of valid values, from one to all.\n\nIf a configuration option is not defined as argument it will skip it. But if the argument is defined but empty it will store empty string as new value.\n\n\nThere's an special argument: if \"format\" is defined as \"json\" this call will respond a JSON document:\n\n```\n{\n    \"data\": {\n        \"result\": 1\n    }\n}\n```\n\nOtherwise it will respond redirecting using 302 redirect to \"/?saved=1\"\n\nThis way it can be used both for simple HTML requests and for JSON requests.\n\n\n**Note:** This function also calls saveConfigFile(), so it's not needed to do so manually.\n\n\n\n\n## How do I get set up?\n\nYou can get it from Arduino libraries directly, searching by uEspConfigLib.\n\nFor manual installation:\n\n * Get the ZIP from releases link: https://github.com/Naguissa/uEspConfigLib/releases\n * Rename to uEspConfigLib.zip\n * Install library on Arduino\n\n\n## Documentation\n\nYou can find all documentation in this repository: https://github.com/Naguissa/uEspConfigLib_doc_and_extras\n\nYou can read documentation online here: https://naguissa.github.io/uEspConfigLib_doc_and_extras/\n\n\n\n## Example\n\nIncluded on examples folder, available on Arduino IDE. The example shows example code in this file but with a fully working sketch and adds extra use cases.\n\nSee [uEspConfigLib_example.ino](examples/uEspConfigLib_example/uEspConfigLib_example.ino)\n\n\n## Who do I talk to?\n\n * [Naguissa](https://github.com/Naguissa)\n * https://www.foroelectro.net\n\n\n## Contribute\n\nAny code contribution, report or comment are always welcome. Don't hesitate to use GitHub for that.\n\n\n * You can sponsor this project using GitHub's Sponsor button: https://github.com/Naguissa/uEspConfigLib\n * You can make a donation via PayPal: https://paypal.me/foroelectro\n\n\nThanks for your support.\n\n\nContributors hall of fame: https://www.foroelectro.net/hall-of-fame-f32/contributors-contribuyentes-t271.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaguissa%2Fuespconfiglib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaguissa%2Fuespconfiglib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaguissa%2Fuespconfiglib/lists"}