Site icon Renzo Mischianti

esp8266 OTA updates with Arduino IDE: filesystem, signed and password

Spread the love

OTA (Over the Air) update is the process of uploading firmware to an ESP module using a Wi-Fi connection rather than a serial port. Such functionality becomes extremely useful in case of limited or no physical access to the module.

esp8266 OTA update with Arduino IDE: filesystem, signed and password

The OTA updates may be done using:

First of all read the tutorial “esp8266: flash firmware binary (.bin) compiled and signed“.

In this article we are going to see the OTA updates with the Arduino IDE, firmware, filesystem, signed and unsigned.

Here the devices I use WeMos D1 mini - NodeMCU V2 V2.1 V3 - esp01 - esp01 programmer

Introduction

First we look that the core component of esp8266 core need python installed, and when install It remember to add to path (for windows)

ESP Tools Install Python and add It to path

OTA upload use UDP protocol, so It can work (with ArduinoIDE) only in the local network because use broadcast to discover the devices, and It’s limited to the LAN.

UDP protocol It’s very old, simple and powerful, I use It in other project to discover all devices in my network with a simple Android applicatio.

Basic example

Now upload BasicOTA.ino, available under File -> Examples -> ArduinoOTA -> BasicOTA.ino

Or copy and paste from here.

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>

#ifndef STASSID
#define STASSID "<YOUR-SSID>"
#define STAPSK  "<YOUR-PASSWD>"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

void setup() {
  Serial.begin(115200);
  
  while (!Serial){};
  delay(100);
  Serial.flush();

  Serial.println("Booting");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");
    delay(5000);
    ESP.restart();
  }

  // Port defaults to 8266
  // ArduinoOTA.setPort(8266);

  // Hostname defaults to esp8266-[ChipID]
  // ArduinoOTA.setHostname("myesp8266");

  // No authentication by default
  // ArduinoOTA.setPassword("admin");

  // Password can be set with it's md5 value as well
  // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
  // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");

  ArduinoOTA.onStart([]() {
    String type;
    if (ArduinoOTA.getCommand() == U_FLASH) {
      type = "sketch";
    } else { // U_FS
      type = "filesystem";
    }

    // NOTE: if updating FS this would be the place to unmount FS using FS.end()
    Serial.println("Start updating " + type);
  });
  ArduinoOTA.onEnd([]() {
    Serial.println("\nEnd");
  });
  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
    Serial.printf("Progress: %u%%\r\n", (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();
  delay(1000);
  Serial.println("Ready");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  ArduinoOTA.handle();
}

The code is very short, and the library ArduinoOTA do all for us.

The serial output is:

Booting
Ready
IP address: 192.168.1.160

Remember to set the SSID and PASSWD of your WiFi network.

ArduinoOTA need to be started with the command ArduinoOTA.begin(); and must set on the loop the relative handle ArduinoOTA.handle();, all the logic is managed by the library, and It offer some listener to follow the process and apply your additional logic.

void onStart(OTA_CALLBACK(fn));
void onEnd(OTA_CALLBACK(fn));
void onProgress(OTA_CALLBACK_PROGRESS(fn));
void onError(OTA_CALLBACK_ERROR (fn));

The meaning of this method is written in the name, and in the example code we can find some notes that can help you understand all the additional features:

    String type;
    if (ArduinoOTA.getCommand() == U_FLASH) {
      type = "sketch";
    } else { // U_FS
      type = "filesystem";
    }

You can check if it is an OTA update of the FLASH or the FS, this means that you can load sketches and FileSystems in the same way, but we will see it later.

You can upload Flash or FileSystem

Upload sketch

Sketch OTA update File system EEPROM WiFi config

Now if we open Tools -> Port we can find our listed device (discovered via UDP broadcast).

Probably, if you use windows, it will ask you to allow access to the network.

Windows defender ask permissions for network

Allow It and now in the the menu you can find It.

ArduinoOTA esp8266 ArduinoIDE connect device

And now we can disconnect the device from PC, power on via external power supply and upload the code.

Sketch uses 315048 bytes (30%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28956 bytes (35%) of dynamic memory, leaving 52964 bytes for local variables. Maximum is 81920 bytes.
C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/espota.py -i 192.168.1.160 -p 8266 --auth=admin -f C:\Users\renzo\AppData\Local\Temp\arduino_build_894273/ArduinoOTAesp8266.ino.bin 
Authenticating...OK
Uploading...........................................................................................................................................................................................................................

And here is the serial output of the microcontroller.

Start updating sketch
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 1%
Progress: 1%
Progress: 2%
Progress: 2%
[...]
Progress: 97%
Progress: 97%
Progress: 97%
Progress: 98%
Progress: 98%
Progress: 99%
Progress: 99%
Progress: 100%

End

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v0004dee0
@cp:B0
ld
Booting
Ready
IP address: 192.168.1.160
Start updating filesystem

Upload FileSystem (SPIFFS or LittleFS)

You can also upload filesystem data with the classic method via plugin, to install SPIFFS or LittleFS plugin refer to the relative tutorial:

WeMos D1 mini (esp8266), integrated SPIFFS Filesystem (deprecated)

WeMos D1 mini (esp8266), integrated LittleFS Filesystem (reccomended)

Now we are going to add data directory to the sketch folder (with some files), and use the plugin to upload.

esp8266 LittleFS plugin menu on ArduinoIDE

You can check the IDE console output to check what happened.

[LittleFS] data    : D:\Projects\Arduino\sloeber-workspace-OTA\ArduinoOTAesp8266\data
[LittleFS] size    : 2024
[LittleFS] page    : 256
[LittleFS] block   : 8192
[LittleFS] upload  : C:\Users\renzo\AppData\Local\Temp\arduino_build_988758/ArduinoOTAesp8266.mklittlefs.bin
[LittleFS] IP      : 192.168.1.160

Uploading............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

And on the microcontroller

Booting
Ready
IP address: 192.168.1.160
Start updating filesystem
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 1%
Progress: 1%
Progress: 1%
Progress: 1%
Progress: 1%
Progress: 1%
Progress: 1%
[...]
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 99%
Progress: 100%

End

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v0004de30
~ld
Booting
Ready
IP address: 192.168.1.160

Protect upload with password

Adding a password is very simple, you must only uncomment this line

  // No authentication by default
  ArduinoOTA.setPassword("admin");

Now when you try to upload the code a popup appear, and ask you to add password

Password popup for upload Arduino OTA sketch

You can see that process in the console also.

Sketch uses 315008 bytes (30%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28956 bytes (35%) of dynamic memory, leaving 52964 bytes for local variables. Maximum is 81920 bytes.
C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/espota.py -i 192.168.1.160 -p 8266 --auth=admin -f C:\Users\renzo\AppData\Local\Temp\arduino_build_661891/ArduinoOTAesp8266.ino.bin 
Authenticating...OK
Uploading...........................................................................................................................................................................................................................

Sign your binary code

For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. These uses SHA256 hashing in place of MD5 and RSA-2048 bit level public-key encryption to guarantee that only the holder of a cryptographic private key can produce signed updates accepted by the OTA update mechanisms.

Signed updates are updates whose compiled binaries are signed with a private key (held by the developer) and verified with a public key (stored in the application and available for all to see). The signing process computes a hash of the binary code, encrypts the hash with the developer’s private key, and appends this encrypted hash (also called a signature) to the binary that is uploaded (via OTA, web, or HTTP server). If the code is modified or replaced in any way by anyone except the holder of the developer’s private key, the signature will not match and the ESP8266 will reject the upload.

Public Private key sign and verify process

Cryptographic signing only protects against tampering with binaries delivered via OTA. If someone has physical access, they will always be able to flash the device over the serial port. Signing also does not encrypt anything but the hash (so that it can’t be modified), so this does not protect code inside the device: if a user has physical access they can read out your program. (cit.)

I already explain signing processo of article “esp8266: flash firmware binary (.bin) compiled and signed“.

Generate public and private key

To sign you must generate 2 key: private and public, and you need a program like openssl, you can download linux version from all packet manager, or download for windows from here, to use It with more simplicity add to bin pah.

Now we can generate private key

openssl genrsa -out private.key 2048

here the file content of the private.key:

-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA12xlf4ADAPkxAmU3nFGXJ4mBZigM3xaWukJv6m8huG5ILQjx
reY95alFBFJPut2JIrz7T2Mol5Q9C9Ca5qcXSgSrliwGjd86Ex/5P64ZGLgMiShe
drAgaOReFN6Sj4+f4onzK2K2W2EGeUGWM9b+np4Gw9vRotOO7HRryuh+cMD6cKrs
uNURpxWP/fO9vCtwpucz+8qHsYpVxHptg2UH+gDoFKjmS0ctrwwGvC2hTbsjqA7J
pG5ryymMRbZAkhtwO8SJV2ivtrWqyeDYcUT8qAqeck1EngVcIvaHq8oCrt633A76
b8iCXc1WwEMJPEJ/ksiG7K/ZavYFdZDspt/OrQIDAQABAoIBADs1quwRZkH1O/g5
k8BeWJpgW/WVGnySu9jz+8jGxNDpVuMx6yNt/iNKlBKtAQcObuviX3yhd326G9FM
g9bTpD4O7I55CVAjQ9YP2rUbCADYTXHBa71ZiX7rDcTUrBnTUxGz8udA2XhiQaJA
WaVj+VXlf1yD5anIVic9lIcPwfkBQHvR+mnrWqMbGDUoACCqG5B7s8HQqrMMDEMb
m44OunnlbR9yml8Nwve7k1TgQcP3FOPDRzBoB65aKUDYU9qEqLQcmlwEutWJeGbM
FphAcIXyKGCM0MU5WGwgUwRFA3nTA9qz19tJRGCltNBvKN4fySae+8HgpBCiGhxk
cO1nI80CgYEA7JgCEIZ5XFRQzWh9NHj7vx4yFF5RJ1S/kfkZ4fH+LFgctclw5iO2
mFabQJQN59CvbIFyEV7QjhBBY02/okJqmScDCL/ow+xMQ7I5gK/T7YiTwii5zpCJ
RxRgwlUx7lDd6Q/wydwXsnwiLjNi4Rns9naKWO1MhdkebKGBU2Za3LcCgYEA6Rfa
hxGLztAi1rua30OGJ+H/WWEfxuQ/88WUm772F7nTYilXYhgSZSVMVWvK+9dHl6xt
+jSon5NmXinz6H/5yXgiv3/SQMY+SNTSdNBy8DE0kkLvsTPIxma7MFwtzmAoCZFb
FH4EA3yBtbOTPMQOkkVxAq55QZ24k29cglvZE7sCgYEAsQ2AXgWERIgEf/M131K6
cmeSapO6f4h4ZDDaIbAK2fyGX7QD/PW064PEYytozJXq8XRdfIpL4ERh6oKAaljx
lPMQ3jdfZV8sI2z4g0kRe6y9hosboW2gjcS+NC+1UfbKWmNHeohuY29p1NE3qeTQ
5BAJsErE/VVh40FpmpP6YzkCgYEAs4/SojZcE0e3buA64D8uO88XXI07Y4Y11d6h
KpGjFofqVTYvwLt2gECJW0ycpAElf6wvVI34UGXGeEetQ7BChndrnUYkfA27sXNx
ZNenk2z0aK/z4fhYdK5zCUAZcWAVt7koBtNE2EKz0Xuysx79cqTX+A7cDjYoGDuz
ciC7Sz0CgYEA4OfQK3fsGR9wuBkDzlSS6NBpgXEKpkcTSuY8+SAq+BA0i981Hehz
rkSJU6kd5FK/q+7bk0zgwhQf7RKa2O+ChDSGYnwD38ns06mn8AZIMgltITmxzliK
N8fcchAv5ETo/+zeHTIR32PJe+s+U8pyuquheZi+nrVRjXgyo0uyqi0=
-----END RSA PRIVATE KEY-----

And the relative public key

openssl rsa -in private.key -outform PEM -pubout -out public.key

and here my public.key:

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA12xlf4ADAPkxAmU3nFGX
J4mBZigM3xaWukJv6m8huG5ILQjxreY95alFBFJPut2JIrz7T2Mol5Q9C9Ca5qcX
SgSrliwGjd86Ex/5P64ZGLgMiShedrAgaOReFN6Sj4+f4onzK2K2W2EGeUGWM9b+
np4Gw9vRotOO7HRryuh+cMD6cKrsuNURpxWP/fO9vCtwpucz+8qHsYpVxHptg2UH
+gDoFKjmS0ctrwwGvC2hTbsjqA7JpG5ryymMRbZAkhtwO8SJV2ivtrWqyeDYcUT8
qAqeck1EngVcIvaHq8oCrt633A76b8iCXc1WwEMJPEJ/ksiG7K/ZavYFdZDspt/O
rQIDAQAB
-----END PUBLIC KEY-----

Now we modify the code, to enable the verify of the sign, we insert the public.key and add It to the SignVerifier

BearSSL::PublicKey signPubKey{R"(-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA12xlf4ADAPkxAmU3nFGX
J4mBZigM3xaWukJv6m8huG5ILQjxreY95alFBFJPut2JIrz7T2Mol5Q9C9Ca5qcX
SgSrliwGjd86Ex/5P64ZGLgMiShedrAgaOReFN6Sj4+f4onzK2K2W2EGeUGWM9b+
np4Gw9vRotOO7HRryuh+cMD6cKrsuNURpxWP/fO9vCtwpucz+8qHsYpVxHptg2UH
+gDoFKjmS0ctrwwGvC2hTbsjqA7JpG5ryymMRbZAkhtwO8SJV2ivtrWqyeDYcUT8
qAqeck1EngVcIvaHq8oCrt633A76b8iCXc1WwEMJPEJ/ksiG7K/ZavYFdZDspt/O
rQIDAQAB
-----END PUBLIC KEY-----)"};
BearSSL::HashSHA256 hash;
BearSSL::SigningVerifier sign{&signPubKey};

Then we are going to install the verifier to the Updater.

  Update.installSignature(&hash, &sign);

The entire code become like so:

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>

#ifndef STASSID
#define STASSID "<YOUR-SSID>"
#define STAPSK  "<YOUR-PASSWD>"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

BearSSL::PublicKey signPubKey{R"(-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA12xlf4ADAPkxAmU3nFGX
J4mBZigM3xaWukJv6m8huG5ILQjxreY95alFBFJPut2JIrz7T2Mol5Q9C9Ca5qcX
SgSrliwGjd86Ex/5P64ZGLgMiShedrAgaOReFN6Sj4+f4onzK2K2W2EGeUGWM9b+
np4Gw9vRotOO7HRryuh+cMD6cKrsuNURpxWP/fO9vCtwpucz+8qHsYpVxHptg2UH
+gDoFKjmS0ctrwwGvC2hTbsjqA7JpG5ryymMRbZAkhtwO8SJV2ivtrWqyeDYcUT8
qAqeck1EngVcIvaHq8oCrt633A76b8iCXc1WwEMJPEJ/ksiG7K/ZavYFdZDspt/O
rQIDAQAB
-----END PUBLIC KEY-----)"};
BearSSL::HashSHA256 hash;
BearSSL::SigningVerifier sign{&signPubKey};

void setup() {
  Serial.begin(115200);
  
  while (!Serial){};
  delay(100);
  Serial.flush();

  Serial.println("Booting");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");
    delay(5000);
    ESP.restart();
  }

  // Port defaults to 8266
  // ArduinoOTA.setPort(8266);

  // Hostname defaults to esp8266-[ChipID]
  // ArduinoOTA.setHostname("myesp8266");

  // No authentication by default
  // ArduinoOTA.setPassword("admin");

  // Password can be set with it's md5 value as well
  // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
  // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");

  Update.installSignature(&hash, &sign);

  ArduinoOTA.onStart([]() {
    String type;
    if (ArduinoOTA.getCommand() == U_FLASH) {
      type = "sketch";
    } else { // U_FS
      type = "filesystem";
    }

    // NOTE: if updating FS this would be the place to unmount FS using FS.end()
    Serial.println("Start updating " + type);
  });
  ArduinoOTA.onEnd([]() {
    Serial.println("\nEnd");
  });
  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
    Serial.printf("Progress: %u%%\r\n", (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();
  delay(1000);
  Serial.println("Ready");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  ArduinoOTA.handle();
}

Finally we copy private.key in the sketch folder and re-execute upload.

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\renzo\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\renzo\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\renzo\OneDrive\Documenti\Arduino\libraries -fqbn=esp8266:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 -ide-version=10813 -build-path C:\Users\renzo\AppData\Local\Temp\arduino_build_924270 -warnings=all -build-cache C:\Users\renzo\AppData\Local\Temp\arduino_cache_288576 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mkspiffs-3.0.4-gcc10.3-1757bed.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mklittlefs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs-3.0.4-gcc10.3-1757bed.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mklittlefs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.python3.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.xtensa-lx106-elf-gcc-3.0.4-gcc10.3-1757bed.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed -verbose D:\Projects\Arduino\sloeber-workspace-OTA\ArduinoOTAesp8266\ArduinoOTAesp8266.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\renzo\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\renzo\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\renzo\OneDrive\Documenti\Arduino\libraries -fqbn=esp8266:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 -ide-version=10813 -build-path C:\Users\renzo\AppData\Local\Temp\arduino_build_924270 -warnings=all -build-cache C:\Users\renzo\AppData\Local\Temp\arduino_cache_288576 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mkspiffs-3.0.4-gcc10.3-1757bed.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mklittlefs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs-3.0.4-gcc10.3-1757bed.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\mklittlefs\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.python3.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed -prefs=runtime.tools.xtensa-lx106-elf-gcc-3.0.4-gcc10.3-1757bed.path=C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed -verbose D:\Projects\Arduino\sloeber-workspace-OTA\ArduinoOTAesp8266\ArduinoOTAesp8266.ino
Using board 'd1_mini' from platform in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2
Using core 'esp8266' from platform in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2
Detecting libraries used...
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lwip2/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core" -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\cores\\esp8266" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\variants\\d1_mini" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for ESP8266WiFi.h: [ESP8266WiFi@1.0]
ResolveLibrary(ESP8266WiFi.h)
  -> candidates: [ESP8266WiFi@1.0]
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lwip2/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core" -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\cores\\esp8266" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\variants\\d1_mini" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266WiFi\\src" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for ESP8266mDNS.h: [ESP8266mDNS@1.2]
ResolveLibrary(ESP8266mDNS.h)
  -> candidates: [ESP8266mDNS@1.2]
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lwip2/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core" -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\cores\\esp8266" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\variants\\d1_mini" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266WiFi\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266mDNS\\src" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for ArduinoOTA.h: [ArduinoOTA@1.0]
ResolveLibrary(ArduinoOTA.h)
  -> candidates: [ArduinoOTA@1.0]
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lwip2/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core" -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\cores\\esp8266" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\variants\\d1_mini" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266WiFi\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266mDNS\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ArduinoOTA" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\sketch\sloeber.ino.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\BearSSLHelpers.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\CertStoreBearSSL.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFi.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiAP.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiGeneric.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiGratuitous.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiMulti.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiSTA-WPS.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiSTA.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\ESP8266WiFiScan.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\WiFiClient.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\WiFiClientSecureBearSSL.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\WiFiServer.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\WiFiServerSecureBearSSL.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\WiFiUdp.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\src\enable_wifi_at_boot_time.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS\src\ESP8266mDNS.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS\src\LEAmDNS.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS\src\LEAmDNS_Helpers.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS\src\LEAmDNS_Structs.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp
Using cached library dependencies for file: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ArduinoOTA\ArduinoOTA.cpp
Generating function prototypes...
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lwip2/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core" -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\cores\\esp8266" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\variants\\d1_mini" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266WiFi\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266mDNS\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ArduinoOTA" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp" -o "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/signing.py" --mode header --publickey "D:\\Projects\\Arduino\\sloeber-workspace-OTA\\ArduinoOTAesp8266/public.key" --out "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core/Updater_Signing.h"
Enabling binary signing
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\sketch\sloeber.ino.cpp.o
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lwip2/include" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/core" -c -Wall -Wextra -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\cores\\esp8266" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\variants\\d1_mini" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266WiFi\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ESP8266mDNS\\src" "-IC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2\\libraries\\ArduinoOTA" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp" -o "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp.o"
Compiling libraries...
Compiling library "ESP8266WiFi"
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiGratuitous.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\BearSSLHelpers.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\CertStoreBearSSL.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiAP.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiSTA-WPS.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiGeneric.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiMulti.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFi.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiScan.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFiSTA.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\WiFiClient.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\WiFiServer.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\WiFiClientSecureBearSSL.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\WiFiServerSecureBearSSL.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\enable_wifi_at_boot_time.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\WiFiUdp.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266WiFi\ESP8266WiFi.a
Compiling library "ESP8266mDNS"
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\LEAmDNS_Helpers.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\ESP8266mDNS.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\LEAmDNS.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\LEAmDNS_Structs.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\LEAmDNS_Transfer.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\LEAmDNS_Control.cpp.o
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ESP8266mDNS\ESP8266mDNS.a
Compiling library "ArduinoOTA"
Using previously compiled file: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270\libraries\ArduinoOTA\ArduinoOTA.cpp.o
Compiling core...
Using precompiled core: C:\Users\renzo\AppData\Local\Temp\arduino_cache_288576\core\core_98ef9c1c482104edb2f65184685070ee.a
Linking everything together...
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/mkdir.py" -p "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ld_h/"
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/cp.py" "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/ld/eagle.flash.4m2m.ld" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ld_h/local.eagle.flash.ld.h"
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-gcc" -CC -E -P -DVTABLES_IN_FLASH -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ld_h/local.eagle.flash.ld.h" -o "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/local.eagle.flash.ld"
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-gcc" -CC -E -P -DVTABLES_IN_FLASH -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/local.eagle.app.v6.common.ld"
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-gcc" -fno-exceptions -Wl,-Map "-Wl,C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.map" -g -Wall -Wextra -Werror=return-type -Os -nostdlib -Wl,--no-check-sections -u app_entry -u _printf_float -u _scanf_float -Wl,-static "-LC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lib" "-LC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/lib/NONOSDK22x_190703" "-LC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270" "-LC:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sdk/libc/xtensa-lx106-elf/lib" -Tlocal.eagle.flash.ld -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -o "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.elf" -Wl,--start-group "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\ArduinoOTAesp8266.ino.cpp.o" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\sketch\\sloeber.ino.cpp.o" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\libraries\\ESP8266WiFi\\ESP8266WiFi.a" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\libraries\\ESP8266mDNS\\ESP8266mDNS.a" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270\\libraries\\ArduinoOTA\\ArduinoOTA.cpp.o" "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_cache_288576\\core\\core_98ef9c1c482104edb2f65184685070ee.a" -lhal -lphy -lpp -lnet80211 -llwip2-536-feat -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -Wl,--end-group "-LC:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270"
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/elf2bin.py" --eboot "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/bootloaders/eboot/eboot.elf" --app "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.elf" --flash_mode dio --flash_freq 40 --flash_size 4M --path "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin" --out "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.bin"
Creating BIN file "C:\Users\renzo\AppData\Local\Temp\arduino_build_924270/ArduinoOTAesp8266.ino.bin" using "C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/bootloaders/eboot/eboot.elf" and "C:\Users\renzo\AppData\Local\Temp\arduino_build_924270/ArduinoOTAesp8266.ino.elf"
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/signing.py" --mode sign --privatekey "D:\\Projects\\Arduino\\sloeber-workspace-OTA\\ArduinoOTAesp8266/private.key" --bin "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.bin" --out "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.bin.signed" --legacy "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.bin.legacy_sig"
Signed binary: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270/ArduinoOTAesp8266.ino.bin.signed
Legacy signed binary: C:\Users\renzo\AppData\Local\Temp\arduino_build_924270/ArduinoOTAesp8266.ino.bin.legacy_sig
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sizes.py" --elf "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.elf" --path "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin" --mmu "-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000"
Executable segment sizes:
ICACHE : 32768           - flash instruction cache 
IROM   : 284160          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 27836   / 32768 - code in IRAM          (IRAM_ATTR, ISRs...) 
DATA   : 1504  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 1376  ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 26064 )         - zeroed variables      (global, static) in RAM/HEAP 
Using library ESP8266WiFi at version 1.0 in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi 
Using library ESP8266mDNS at version 1.2 in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS 
Using library ArduinoOTA at version 1.0 in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ArduinoOTA 
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-size" -A "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_924270/ArduinoOTAesp8266.ino.elf"
Sketch uses 314876 bytes (30%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28944 bytes (35%) of dynamic memory, leaving 52976 bytes for local variables. Maximum is 81920 bytes.
C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/espota.py -i 192.168.1.160 -p 8266 --auth= -f C:\Users\renzo\AppData\Local\Temp\arduino_build_924270/ArduinoOTAesp8266.ino.bin 
Detected Signed Update. C:\Users\renzo\AppData\Local\Temp\arduino_build_924270/ArduinoOTAesp8266.ino.bin.signed will be uploaded instead.
Uploading...........................................................................................................................................................................................................................

You can check that IDE trasparentrly upload a signed binary.

Now we are going to do a test, we remove the key from the basic folder restart ArduinoIDE and try to upload.

"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.0.2/tools/sizes.py" --elf "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_138010/ArduinoOTAesp8266.ino.elf" --path "C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin" --mmu "-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000"
Executable segment sizes:
ICACHE : 32768           - flash instruction cache 
IROM   : 321748          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 27836   / 32768 - code in IRAM          (IRAM_ATTR, ISRs...) 
DATA   : 1504  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 1972  ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 26240 )         - zeroed variables      (global, static) in RAM/HEAP 
Using library ESP8266WiFi at version 1.0 in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi 
Using library ESP8266mDNS at version 1.2 in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266mDNS 
Using library ArduinoOTA at version 1.0 in folder: C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ArduinoOTA 
"C:\\Users\\renzo\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-size" -A "C:\\Users\\renzo\\AppData\\Local\\Temp\\arduino_build_138010/ArduinoOTAesp8266.ino.elf"
Sketch uses 353060 bytes (33%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29716 bytes (36%) of dynamic memory, leaving 52204 bytes for local variables. Maximum is 81920 bytes.
C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\renzo\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/espota.py -i 192.168.1.160 -p 8266 --auth= -f C:\Users\renzo\AppData\Local\Temp\arduino_build_138010/ArduinoOTAesp8266.ino.bin 
Uploading.....................................................................................................................................................................................................................................................

11:48:28 [ERROR]: ERROR[12]: 
11:48:28 [ERROR]: ERROR[12]: 

And the serial output of the ESP become:

Progress: 98%
Progress: 99%
Progress: 99%
Progress: 100%
Error[4]: End Failed

The uploads will be blocked if you don’t have the private.key.

Thanks

  1. Firmware management
    1. esp8266: flash firmware binary (.bin) compiled and signed
    2. esp8266: flash firmware and filesystem binary (.bin) compiled with GUI tools
  2. OTA update with Arduino IDE
    1. esp8266 OTA update with Arduino IDE: filesystem, signed and password
  3. OTA update with Web Browser
    1. esp8266 OTA update with Web Browser: firmware, filesystem and authentication
    2. esp8266 OTA update with Web Browser: sign the firmware and HTTPS (SSL/TLS)
    3. esp8266 OTA update with Web Browser: custom web interface
  4. Self OTA uptate from HTTP server
    1. esp8266 self OTA update firmware from server
    2. esp8266 self OTA update firmware from server with version check
    3. esp8266 self OTA update in HTTPS (SSL/TLS) with trusted self signed certificate
  5. Non standard Firmware update
    1. esp8266 firmware and filesystem update from SD card
    1. esp8266 firmware and filesystem update with FTP client


Spread the love
Exit mobile version