I have a code which does download updates available from a http site. I am asked to change the site address to a new one. this time, the site is https. how can I change my code to update my ESP with the file in this new address?
I'm sure you are all familiar with this code but I update it for you.
void update_esp()
{
Serial.println("update_esp ==>");
if ((WiFi.status() == WL_CONNECTED)) {
Serial.println("Checking Update...");
String file_add = esp_update_host + esp_update_filename;
Serial.printf("update address: ");
Serial.println(file_add);
t_httpUpdate_return ret = ESPhttpUpdate.update(file_add.c_str());
switch (ret) {
case HTTP_UPDATE_FAILED:
Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
Serial.println();
break;
case HTTP_UPDATE_NO_UPDATES:
Serial.println("HTTP_UPDATE_NO_UPDATES");
break;
case HTTP_UPDATE_OK:
Serial.println("HTTP_UPDATE_OK");
break;
}
}
}