-
Notifications
You must be signed in to change notification settings - Fork 13.3k
OTA update not working over HTTPS #5818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm unable to reproduce any problem with this on my own testing. I've pointed the app (seems like a copy of the example?) directly to a private https server (and updated the fingerprint, obviously) and had it pull file.bin directly. It works every time and then reboots into the new sketch. Please past the full decode, including the header lines (i.e. where it actually crashed, whether there were OOM errors, etc.) on another run with GIT head. The current issue didn't list where it actually crashed. Anything to the pattern (like, it tries and fails to find a new file 3 times but then on the 4rd itry it gets it and crashes or something)? |
I'm reverted to 2.4.2 to fix this problem. Now I use 2.5.2, where updates (seems) works fine. #include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#define SSID
#define PASS
HTTPClient https;
BearSSL::WiFiClientSecure client;
void setup() {
Serial.begin(115200);
WiFi.begin(SSID,PASS);
while(WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("\nWifi connected!");
uint8_t cert[20] = {184,120,14,91,203,255,205,98,26,130,214,144,95,34,236,197,210,208,31,245};
client.setFingerprint(cert);
https.setReuse(true);
String url = "https://apilink";
https.begin(client,url);
Serial.println(https.GET());
Serial.println(https.connected());
for(uint8_t i = 0; i < 10; i++) {
Serial.print(String(i)+" : ");
Serial.println(https.GET());
Serial.println(https.getString());
client.flush();
delay(1000);
}
}
void loop() {
} |
Closing this for now. OTA reported working fine in the latest release, and the only outstanding bit is the http.GET method which is still borked (but with a PR in-progress). We'll track that problem in the consolidated issue referenced above. |
Basic Infos
Platform
Settings in IDE
Problem Description
I trying update ESP by OTA from my server over HTTPS. Server is Apache/2.4.6 with PHP 7.3 and Let's Encrypt Authority X3 certificate. Server side script taken from documentation. Basically nothing happens at all (Debug Messages and Log from server). In the server logs package size rarely is 32768 instead 16384. Once I catched wdt reset - decoded stack below.
Strange fact - I get successfully updated ESP only when enabled debug on level "CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM", not from first time, it takes several attempts. But it is updates every time I try! On other debug levels it still not updating.
I tried update without server script, directly pointing .bin location (not working). Often I gets "Read Timeout" error and tried increase timeout for 10 sec, but it isn't helped.
MCVE Sketch
Debug Messages
Log from server
Decoded stack dump
The text was updated successfully, but these errors were encountered: