mirror of
https://github.com/scottchiefbaker/ESP-WebOTA.git
synced 2024-08-30 18:12:33 +00:00
Update the README to reflect the new methods
This commit is contained in:
parent
dc824a5289
commit
2c9ebd6e62
10
README.md
10
README.md
@ -8,17 +8,19 @@ Clone this repo to your Arduino libraries directory. On Linux this is `~/Arduino
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Create a global variable for the Web Server:
|
Include the WebOTA library
|
||||||
|
|
||||||
#include <WebOTA.h>
|
#include <WebOTA.h>
|
||||||
WebServer OTAServer(8080);
|
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() {
|
void setup() {
|
||||||
// Other init code here (WiFi, etc)
|
// 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:
|
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() {
|
void loop() {
|
||||||
// Other loop code here
|
// 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.
|
**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.
|
||||||
|
@ -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
|
paragraph=Easily add an HTTP OTA interface to an existing project
|
||||||
category=Communication
|
category=Communication
|
||||||
url=https://github.com/scottchiefbaker/ESP-WebOTA
|
url=https://github.com/scottchiefbaker/ESP-WebOTA
|
||||||
architectures=esp32
|
architectures=esp32,esp8266
|
||||||
includes=WebOTA.h
|
includes=WebOTA.h
|
||||||
|
Loading…
Reference in New Issue
Block a user