diff --git a/esp_gateway/esp_gateway.ino b/esp_gateway/esp_gateway.ino deleted file mode 100644 index a65c1a6..0000000 --- a/esp_gateway/esp_gateway.ino +++ /dev/null @@ -1,54 +0,0 @@ -#include "Arduino.h" -#include -#include -#include -#include - -const char* ssid = "vulturul"; -const char* password = "***REMOVED***"; - -void setup() -{ - Serial.begin(9600); // Start the serial console - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - - Serial.println("Connecting to WiFi netowrk."); - while (WiFi.status() != WL_CONNECTED) { - delay(1000); - Serial.println("Establishing connection to WiFi.."); - } - Serial.println("Connected to network"); - - setupOTA(); - -} - -void loop() -{ - ArduinoOTA.handle(); -} - -void setupOTA() { - ArduinoOTA.onStart([]() { - Serial.println("Start"); - }); - ArduinoOTA.onEnd([]() { - Serial.println("\nEnd"); - }); - ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { - Serial.printf("Progress: %u%%\r", (progress / (total / 100))); - }); - ArduinoOTA.onError([](ota_error_t error) { - Serial.printf("Error[%u]: ", error); - if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); - else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); - else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); - else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); - else if (error == OTA_END_ERROR) Serial.println("End Failed"); - }); - ArduinoOTA.begin(); - Serial.println("Ready"); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); -}