Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Rui Santos
- Complete project details
- - Arduino IDE: https://RandomNerdTutorials.com/esp32-ota-over-the-air-arduino/
- - VS Code: https://RandomNerdTutorials.com/esp32-ota-over-the-air-vs-code/
- This sketch shows a Basic example from the AsyncElegantOTA library: ESP32_Async_Demo
- https://github.com/ayushsharma82/AsyncElegantOTA
- */
- #include <Arduino.h>
- #include <WiFi.h>
- #include <AsyncTCP.h>
- #include <ESPAsyncWebServer.h>
- #include <AsyncElegantOTA.h>
- const char* ssid = "REPLACE_WITH_YOUR_SSID";
- const char* password = "REPLACE_WITH_YOUR_PASSWORD";
- AsyncWebServer 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("/", HTTP_GET, [](AsyncWebServerRequest *request) {
- request->send(200, "text/plain", "Hi! I am ESP32.");
- });
- AsyncElegantOTA.begin(&server); // Start ElegantOTA
- server.begin();
- Serial.println("HTTP server started");
- }
- void loop(void) {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement