From c7b98ad1022de5824523aedbcc0bb391d217b152 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Sun, 17 Mar 2019 17:58:55 -0700 Subject: [PATCH] Update the README to reflect the new methods --- README.md | 11 ++++++----- library.properties | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a1f5df9..b2a3cfd 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,18 @@ 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 - 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 +27,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. diff --git a/library.properties b/library.properties index 5abda94..28f761e 100644 --- a/library.properties +++ b/library.properties @@ -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