ddiabloss / ElegantOTA

Push OTAs to ESP8266 Elegantly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


   


Push OTAs to ESP8266 Elegantly!

ElegantOTA provides a beautiful interface to upload Over the Air `.bin` updates to your ESP Modules with precise status and progress displayed over UI. This Library shows the current upload progress of your OTA and once finished, it will display the status of your OTA.





How to Install

Directly Through Arduino IDE ( Currently Submitted for Approval. Use Mannual Install till it gets Approved.)

Go to Sketch > Include Library > Library Manager > Search for "ElegantOTA" > Install

Manual Install

For Windows: Download the Repository and extract the .zip in Documents>Arduino>Libraries>{Place "ElegantOTA" folder Here}

For Linux: Download the Repository and extract the .zip in Sketchbook>Libraries>{Place "ElegantOTA" folder Here}

Manually through IDE

Download the Repository, Go to Sketch>Include Library>Add .zip Library> Select the Downloaded .zip File.


Documentation

ElegantOTA is a dead simple library which does your work in just 1 Line. Honestly, It's just a wrapper library which injects it's own elegant webpage instead of the ugly upload page which comes by default in Arduino Library.

Include ElegantOTA Library #include <ElegantOTA.h> at top of your Arduino Code.

Paste this - ElegantOTA.begin(&server); line above your server.begin();

That's all!


Now copy the IPAddress displayed over your Serial Monitor and go to http://<IPAddress>/update in browser. ( where <IPAddress> is the IP of your ESP Module)


By default, ElegantOTA uses your chip id as a unique id for your esp chip on webpage. If you want to set a custom id, then you can set it via ElegantOTA.setID("abcd123");. Best to place it above ElegantOTA.begin function.


Example


#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ElegantOTA.h>

const char* ssid = "........";
const char* password = "........";

ESP8266WebServer server(80);


void setup(void) {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.println("");

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  server.on("/", []() {
    server.send(200, "text/plain", "Hi! I am ESP8266.");
  });

  ElegantOTA.begin(&server);    // Start ElegantOTA
  server.begin();
  Serial.println("HTTP server started");
}

void loop(void) {
  server.handleClient();
}


Contributions

Every Contribution to this repository is highly appriciated! Don't fear to create pull requests which enhance or fix the library as ultimatly you are going to help everybody.

If you want to donate to the author then you can buy me a coffee, It really helps me keep these libraries updated:



License

ElegantOTA is licensed under The MIT License ( MIT ).

About

Push OTAs to ESP8266 Elegantly.

License:MIT License


Languages

Language:C 83.6%Language:Vue 14.0%Language:C++ 1.2%Language:JavaScript 0.9%Language:HTML 0.3%