Does anyone had any luck with OTA updating with HTTPS (github)?

i am using nodemcu v3

Yes, it works fine - although I’m not running any Blynk specific code on the devices I use for HTTP updates.
I know that most people who use it with Blynk tend to have an Update button widget that they use to trigger an HTTP update.

Are you having problems with Blynk interfering with the HTTP process, or you just can’t get it working?

Have a read through this thread:

It explains what I do using a free web hosting account. Maybe try getting it to work with some simple code while the device is connected to the serial monitor, so you can see what messages you’re getting and get to the point where you’re confident that the HTTP update is working before trying it with Blynk?
When I was testing I had my code wait 30 seconds after booting up before it started an HTTP update, nice and simple and with plenty of serial print messages dotted around so I could see what was happening.

Pete.

hi thanks butyour thread is taking about HTTP not HTTPS

@Oleg_Pugach ESP’s should be able to handle https much better now that ESP Arduino core 2.4.0 has been released.

Sorry, didn’t notice the extra ‘S’ lurking at the end of the title!
Ignore everything I said (not a bad strategy anyway), I’ve ever tried HTTPS myself.

Pete.

Hi Costas
what do you mean by that how do i update the core?

Check out WPA2 Compromised: Upgrade all hardware

For ESP8266

For ESP32

Hi Thanks to you all
i updated the core and the update still not working
i am getting the following output from the debug window:
[httpUpdate] runUpdate flash…
sleep disable
[begin] roundedSize: 0x00053000 (339968)
[begin] updateEndAddress: 0x00100000 (1048576)
[begin] currentSketchSize: 0x0005E000 (385024)
[begin] _startAddress: 0x000AD000 (708608)
[begin] _currentAddress: 0x000AD000 (708608)
[begin] _size: 0x00052550 (337232)

ssl->need_bytes=11088 > 6859
failed to grow plain buffer
:rch 1608, 536
ERROR[6]: Stream Read Timeout
[httpUpdate] Update.writeStream failed! (ERROR[6]: Stream Read Timeout)
[httpUpdate] Update failed
[HTTP-Client][end] tcp stop
:ur 1
:close

Any ideas ?

Also tried to upload from another source (slack.com)
recieved the following errors:

State:	receiving Certificate (11)
=== CERTIFICATE ISSUED TO ===
Common Name (CN):		*.slack.com
Organization (O):		Slack Technologies, Inc.
Location (L):			San Francisco
Country (C):			US
State (ST):			California
Basic Constraints:		CA:FALSE, pathlen:10000
Key Usage:			critical, Digital Signature, Key Encipherment
Subject Alt Name:		slack.com *.slack.com 
=== CERTIFICATE ISSUED BY ===
Common Name (CN):		GeoTrust SSL CA - G3
Organization (O):		GeoTrust Inc.
Country (C):			US
Not Before:			Wed Feb  1 00:00:00 2017
Not After:			Fri Feb  1 23:59:59 2019
RSA bitsize:			2048
Sig Type:			SHA256
=== CERTIFICATE ISSUED TO ===
Common Name (CN):		GeoTrust SSL CA - G3
Organization (O):		GeoTrust Inc.
Country (C):			US
Basic Constraints:		critical, CA:TRUE, pathlen:0
Key Usage:			critical, Key Cert Sign, CRL Sign
Subject Alt Name:		
=== CERTIFICATE ISSUED BY ===
Common Name (CN):		GeoTrust Global CA
Organization (O):		GeoTrust Inc.
Country (C):			US
Not Before:			Tue Nov  5 21:36:50 2013
Not After:			Fri May 20 21:36:50 2022
RSA bitsize:			2048
Sig Type:			SHA256
:rd 5, 157, 148
:rdi 9, 5
:rd 4, 157, 153
:rdi 4, 4
:c0 4, 157
State:	receiving Server Hello Done (14)
State:	sending Client Key Exchange (16)
:wr 267 267 0
:wrc 256 267 0
:wrc 11 11 0
:wr 6 6 0
:wrc 6 6 0
State:	sending Finished (16)
:wr 85 85 0
:wrc 85 85 0
:sent 267
:sent 91
:rn 91
:rd 5, 91, 0
:rdi 91, 5
:rd 1, 91, 5
:rdi 86, 1
:rd 5, 91, 6
:rdi 85, 5
:rd 80, 91, 11
:rdi 80, 80
:c0 80, 91
State:	receiving Finished (16)
[HTTP-Client] connected to files.slack.com:443
:ref 2
domain name: 'files.slack.com'
SAN 0: 'slack.com', no match
:ur 2
[HTTP-Client] sending request header
-----
GET /files-pri/T8PANAHHB-F8NGEG88G/download/test.ino.bin HTTP/1.0
Host: files.slack.com
User-Agent: ESP8266-http-Update
Connection: close
x-ESP8266-STA-MAC: A0:20:A6:15:D6:3E
x-ESP8266-AP-MAC: A2:20:A6:15:D6:3E
x-ESP8266-free-space: 2760704
x-ESP8266-sketch-size: 383872
x-ESP8266-sketch-md5: b4a547b95dcff1251ab045af0a82cdf8
x-ESP8266-chip-size: 4194304
x-ESP8266-sdk-version: 2.1.0(deb1901)
x-ESP8266-mode: sketch

-----
:wr 485 485 0
:wrc 256 485 0
:wrc 229 229 0
:sent 485
:rn 536
:rch 536, 157
:rch 693, 69
:rcl
:abort
:rd 5, 762, 0
:rdi 536, 5
:rd 688, 762, 5
:rdi 531, 531
:c 531, 536, 762
:rdi 157, 157
:c 157, 157, 226
:wcs ra 624
[HTTP-Client][handleHeaderResponse] RX: 'HTTP/1.1 302 Found'
[HTTP-Client][handleHeaderResponse] RX: 'Content-Type: text/html; charset=utf-8'
[HTTP-Client][handleHeaderResponse] RX: 'Content-Length: 118'
[HTTP-Client][handleHeaderResponse] RX: 'Connection: close'
[HTTP-Client][handleHeaderResponse] RX: 'Location: https://esp8266hq.slack.com/?redir=%2Ffiles-pri%2FT8PANAHHB-F8NGEG88G%2Fdownload%2Ftest.ino.bin'
[HTTP-Client][handleHeaderResponse] RX: 'X-Backend: imgproxy-bru-w0bj'
[HTTP-Client][handleHeaderResponse] RX: 'X-Slack-Meta: ?;proxy_redir'
[HTTP-Client][handleHeaderResponse] RX: 'Date: Sun, 07 Jan 2018 12:44:30 GMT'
[HTTP-Client][handleHeaderResponse] RX: 'Via: 1.1 google, 1.1 b74a7a3f7ddfd685212e870d027c332d.cloudfront.net (CloudFront)'
[HTTP-Client][handleHeaderResponse] RX: 'Alt-Svc: clear'
[HTTP-Client][handleHeaderResponse] RX: 'X-Cache: Miss from cloudfront'
[HTTP-Client][handleHeaderResponse] RX: 'X-Amz-Cf-Id: 7AHMYU0-9muQAHW7h1n378eAacj1IaSr_oQLpc1uHssJkh2lbscrGg=='
[HTTP-Client][handleHeaderResponse] RX: ''
[HTTP-Client][handleHeaderResponse] code: 302
[HTTP-Client][handleHeaderResponse] size: 118
[httpUpdate] Header read fin.
[httpUpdate] Server header:
[httpUpdate]  - code: 302
[httpUpdate]  - len: 118
[httpUpdate] ESP8266 info:
[httpUpdate]  - free Space: 2760704
[httpUpdate]  - current Sketch Size: 383872
[httpUpdate] HTTP Code is (302)
[HTTP-Client][end] still data in buffer (118), clean up.

@Oleg_Pugach ask Google which ESP8266 Arduino core you are using.

2.4.0

try rolling back to 2.4.0-rc2 to see if that helps.

tried , no difference

Paste the minimum sketch that exhibits your problem.


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266httpUpdate.h>

WidgetTerminal terminal(V2);

char auth[] = "fc7cd61b1bee4645844ca19d52955b94"; //insert here your token generated by Blynk



char Version[] = "1.0.8";
bool isFirstConnect = true;

void setup() {
Serial.printf("ESP Free Heap:   %d bytes\n", ESP.getFreeHeap());
Serial.begin(115200); // See the connection status in Serial Monitor
Blynk.config(auth);
WiFi.begin("oleg", "cde32wsx");  

}




BLYNK_CONNECTED() {
  if (isFirstConnect) {
    // Request Blynk server to re-send latest values for all pins
    Blynk.syncVirtual(V10);
    isFirstConnect = false;
  }

}

BLYNK_WRITE(V2)
{

  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"

  if (String("reset") == param.asStr()) {
  terminal.println("Reset innitiated") ;
  terminal.flush();
  ESP.reset();  
  }
   else if (String("restart") == param.asStr()) {
  terminal.println("Restart innitiated") ;
  terminal.flush();
  ESP.restart();  
  }
   else if (String("version") == param.asStr()) {
   terminal.println(Version);
  }
   

  else if (String("update") == param.asStr()) {
       t_httpUpdate_return ret = ESPhttpUpdate.update("https://raw.githubusercontent.com/opbeer/cxbcvx/master/test.ino.bin","","CC AA 48 48 66 46 0E 91 53 2C 9C 7C 23 2A B1 74 4D 29 9D 33");
       //t_httpUpdate_return ret = ESPhttpUpdate.update("https://files.slack.com/files-pri/T8PANAHHB-F8NGEG88G/download/test.ino.bin","","AC 95 5A 58 B8 4E 0B CD B3 97 D2 88 68 F5 CA C1 0A 81 E3 6E");
       //t_httpUpdate_return ret = ESPhttpUpdate.update("https://sites.google.com/site/opbeer/test.ino.bin?attredirects=0&d=1","","28 62 99 CA 41 E0 F5 81 77 33 A2 CF A2 BB 28 AE A3 8D 2F 77"); 
        }
  else {

   
    terminal.println("Wrong command");
  
  }

  // Ensure everything is sent
  terminal.flush();
}




void loop() {
    
    Blynk.run();
   
}




@Oleg_Pugach Have you tried GitHub without Blynk?

I tested the ESP8266 Arduino core with the master branch as it was yesterday afternoon which contains an important fix. I have been able to do https OTA updates via GitHub but haven’t tried with Blynk yet.

what do you mean by master branch
no i didnt tried without blynk
i will try

The code that is updated daily rather than the official releases. Just download from the main GitHub page, read the notes on installing etc.

Its working for me check this

1 Like