Xinyuan-LilyGO / TTGO-T-Display

MIT License
1.02k stars 335 forks source link

OTA doesn't work. #75

Open davidmarli opened 2 years ago

davidmarli commented 2 years ago

Hi, that's the first time i own a ttgo -t-display.

It works perfectly well, except the OTA function. Anytime I want ti flash, it starts uploading, and at 7% it stops and failed. I try from Visual code studio with platformio.

Do I miss something ?

Thank you for your answer.

Here is my code :

`//***** //* INITIALISATION DU PRG * //***** void setup() {

IPAddress ip(192, 168, 1, 49); //A CHANGER IPAddress dns(192, 168, 1, 1); IPAddress gateway(192, 168, 1, 1); IPAddress subnet(255, 255, 255, 0); WiFi.config(ip, dns, gateway, subnet); WiFi.begin(WIFI_NETWORK, WIFI_PASSWORD); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print(".");

}

btStop();

ArduinoOTA.setHostname("PV Dimmer"); 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();

}

void loop()

{ ArduinoOTA.handle();

}`