I have succeeded to realize a web server which shares .bin of the ESP, so I can download it successfully.
What I want is to add some headers for consistency like in the PHP script in the link above.
I'm sending the .bin the following way:
httpServer.setContentLength(ESP.getSketchSize());
//httpServer.send_P(200, "application/binary", "");
httpServer.send_P(200, "application/octet-stream", "");
then
in loop several times :
httpServer.sendContent_P(buffer, length);
I do not know how to send the MD5 of the file for consistency check in the second ESP.
I guess this code does this in PHP language:
response.writeHeader(200,
{"Content-Type": "application/octet-stream",
"Content-Disposition": "attachment;filename="+path.basename(full_path),
"Content-Length": ""+fs.statSync(full_path)["size"],
"x-MD5": md5.sync(full_path)});
I understand that ESP8266httpUpdate class checks for "x-MD5" header somehow? is that correct?
So I need to send that header in first ESP?
Could you share some example code for it?
I didn't understand all these headers:
if (!check_header(request, 'USER-AGENT', 'ESP8266-http-Update') ||
!check_header(request, 'X-ESP8266-STA-MAC') ||
!check_header(request, 'X-ESP8266-AP-MAC') ||
!check_header(request, 'X-ESP8266-FREE-SPACE') ||
!check_header(request, 'X-ESP8266-SKETCH-SIZE') ||
!check_header(request, 'X-ESP8266-SKETCH-MD5') ||
!check_header(request, 'X-ESP8266-CHIP-SIZE') ||
!check_header(request, 'X-ESP8266-SDK-VERSION' ||
!check_header(request, "X-ESP8266-VERSION"))) {
What they stand for? Can you redirect me to a documentation about this if exists?
Thanks in advance.