{"id":22886519,"url":"https://github.com/init-io/otaesp","last_synced_at":"2026-04-29T21:33:03.520Z","repository":{"id":263745584,"uuid":"891355362","full_name":"Init-io/OTAEsp","owner":"Init-io","description":"OTAEsp is a simple library for the ESP8266 platform that allows you to easily set up an access point (AP) to serve an HTML page, retrieve form data, and connect the device to a Wi-Fi network. It is ideal for implementing Over-the-Air (OTA) updates, web interfaces, or simple device configuration over a network.","archived":false,"fork":false,"pushed_at":"2025-02-04T18:11:24.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T19:24:08.211Z","etag":null,"topics":["arduino","esp32","esp8266","esp8266-webserver","esp8266-wifi","esp8266-wifi-config","ota"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Init-io.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":"2024-11-20T07:26:16.000Z","updated_at":"2025-02-04T18:11:27.000Z","dependencies_parsed_at":"2025-02-05T04:31:20.461Z","dependency_job_id":null,"html_url":"https://github.com/Init-io/OTAEsp","commit_stats":null,"previous_names":["init-io/otaesp"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Init-io%2FOTAEsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Init-io%2FOTAEsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Init-io%2FOTAEsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Init-io%2FOTAEsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Init-io","download_url":"https://codeload.github.com/Init-io/OTAEsp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523059,"owners_count":20791431,"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","esp32","esp8266","esp8266-webserver","esp8266-wifi","esp8266-wifi-config","ota"],"created_at":"2024-12-13T20:19:03.884Z","updated_at":"2026-04-29T21:33:03.489Z","avatar_url":"https://github.com/Init-io.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OTAEsp - ESP8266 OTA Library\n[![Arduino Library](https://img.shields.io/badge/Arduino-Library-blue.svg)](https://docs.arduino.cc/libraries/otaesp/?_gl=1*yizibl*_up*MQ..*_ga*OTc3MDE5NDYxLjE3Mzg2OTIzNDg.*_ga_NEXN8H46L5*MTczODY5MjM0Ni4xLjEuMTczODY5MjUxOS4wLjAuNDU4ODMyODky)\n![GitHub Release](https://img.shields.io/github/v/release/init-io/OTAEsp?label=release)\n[![License](https://img.shields.io/github/license/init-io/OTAEsp)](LICENSE)\n\n**OTAEsp** is a simple library for the ESP8266 platform that allows you to easily set up an access point (AP) to serve an HTML page, retrieve form data, and connect the device to a Wi-Fi network. It is ideal for implementing Over-the-Air (OTA) updates, web interfaces, or simple device configuration over a network.\n\n## Features\n\n- **Start an Access Point (AP)**: Allows the ESP8266 to create a Wi-Fi access point that clients can connect to.\n- **Serve an HTML Page**: Hosts an HTML page on the ESP8266, accessible via the AP's IP address.\n- **Form Handling**: Retrieves form data submitted by clients in an HTTP request.\n- **Wi-Fi Connection**: Connects the ESP8266 to a Wi-Fi network in station mode (STA).\n\n## Installation\n\n1. Download or clone the repository to your Arduino libraries folder or your custom project folder.\n2. Include the `OTAEsp` library in your Arduino sketch.\n\n```cpp\n#include \u003cOTAEsp.h\u003e\n```\n\n## Usage\n\n### 1. Initialize and Start the Access Point (AP)\nTo start the AP mode, use the `start()` method with the SSID and password for the AP.\n\n```cpp\nOTAEsp ota;\nota.start(\"MyESP8266\", \"password123\");\n```\n\n### 2. Serve an HTML Page\nUse the `host()` method to serve an HTML page to connected clients.\n\n```cpp\nString htmlPage = \"\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eHello, World!\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\";\nota.host(htmlPage);\n```\n\n### 3. Retrieve Form Data\nTo retrieve the value of a specific form field submitted via the HTML page, use the `get()` method.\n\n```cpp\nString fieldValue = ota.get(\"fieldName\");\nSerial.println(\"Received field value: \" + fieldValue);\n```\n\n### 4. Connect to a Wi-Fi Network\nTo connect the ESP8266 to a Wi-Fi network, use the `connect()` method.\n\n```cpp\nif (ota.connect(\"yourSSID\", \"yourPassword\")) {\n    // Successfully connected to Wi-Fi\n} else {\n    // Failed to connect to Wi-Fi\n}\n```\n\n### 5. Stop the Access Point\nIf you want to check if the wifi is connected, use the `isConnected()` method.\n\n```cpp\nota.isConnected();\n```\n\n### 6. Stop the Access Point\nIf you want to stop the AP mode, use the `end()` method.\n\n```cpp\nota.end();\n```\n\n## Example Sketch\n\nHere’s an example of how to use the library in a full sketch:\n\n```cpp\n#include \u003cOTAEsp.h\u003e\n\nOTAEsp ota;\n\nvoid setup() {\n    Serial.begin(115200);\n    ota.start(\"ESP8266-AP\", \"12345678\");\n\n    String htmlPage = \"\u003chtml\u003e\u003cbody\u003e\u003ch1\u003eESP8266 Web Interface\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e\";\n    ota.host(htmlPage);\n}\n\nvoid loop() {\n    ota.server.handleClient();\n}\n```\n\n## Functions\n\n### `void start(const char *ssid, const char *password)`\n- **Description**: Starts the ESP8266 in Access Point (AP) mode with the specified SSID and password.\n- **Parameters**:\n  - `ssid`: The SSID of the access point.\n  - `password`: The password for the access point.\n\n### `void end()`\n- **Description**: Stops the AP mode and disconnects the ESP8266 from the network.\n\n### `void host(const String \u0026html)`\n- **Description**: Hosts an HTML page at the root endpoint (`/`) of the server.\n- **Parameters**:\n  - `html`: The HTML content to serve.\n\n### `String get(const String \u0026fieldName)`\n- **Description**: Retrieves the value of a specific form field submitted by a client.\n- **Parameters**:\n  - `fieldName`: The name of the form field to retrieve.\n- **Returns**: The value of the form field as a string, or an empty string if not found.\n\n### `bool connect(const char *ssid, const char *password)`\n- **Description**: Connects the ESP8266 to a specified Wi-Fi network.\n- **Parameters**:\n  - `ssid`: The SSID of the Wi-Fi network.\n  - `password`: The password for the Wi-Fi network.\n- **Returns**: `true` if the connection is successful, `false` if it fails.\n\n## Debugging\n\nThe library prints status messages to the Serial Monitor to help with debugging:\n- When starting or stopping the AP.\n- When the HTML page is served.\n- When the device is connecting to a Wi-Fi network.\n- When form data is received.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\n- This library is designed for the **ESP8266** platform, which is part of the ESP32/ESP8266 series of Wi-Fi microcontrollers.\n- The code makes use of the `ESP8266WiFi` and `ESP8266WebServer` libraries.\n\n## Contributing\n\nFeel free to fork this repository, make improvements, and submit pull requests. Any contributions are welcome!\n\n## Author\n\n[Init]  \n[Your GitHub Profile](https://github.com/Init-io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finit-io%2Fotaesp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finit-io%2Fotaesp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finit-io%2Fotaesp/lists"}