Update the README to reflect the new methods

This commit is contained in:
Scott Baker 2019-03-17 17:58:55 -07:00
parent dc824a5289
commit 2c9ebd6e62
2 changed files with 7 additions and 5 deletions

View File

@ -8,17 +8,19 @@ Clone this repo to your Arduino libraries directory. On Linux this is `~/Arduino
## Usage
Create a global variable for the Web Server:
Include the WebOTA library
#include <WebOTA.h>
WebServer OTAServer(8080);
Initialize the WebOTA library at the end of your `setup()` function:
Optionally initialize the WebOTA library if you want to change the defaults . This is done at the end of your `setup()` function:
void setup() {
// Other init code here (WiFi, etc)
init_web_ota(&OTAServer);
// The defaults are 8080 and "/webota"
// if you omit init_web_ota() it will use the defaults
init_web_ota(8888, "/update");
}
Listen for update requests at the end of your `loop()` function:
@ -26,7 +28,7 @@ Listen for update requests at the end of your `loop()` function:
void loop() {
// Other loop code here
OTAServer.handleClient();
handle_webota();
}
**Note:** If you have long `delay()` commands in your `loop()` WebOTA may not be responsive. We have provided `webota_delay()` as a drop-in replacement, which is more WebOTA friendly.

View File

@ -7,5 +7,5 @@ sentence=Add an HTTP OTA interface to an existing project
paragraph=Easily add an HTTP OTA interface to an existing project
category=Communication
url=https://github.com/scottchiefbaker/ESP-WebOTA
architectures=esp32
architectures=esp32,esp8266
includes=WebOTA.h