1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Edited OTA readme, added Stream Interface snippet (#6487)

* Edited OTA readme, added Stream Interface snippet

Reworded for easier understanding. Changes mostly in first half of page.

* OTA docs: corrected typos, misc edits near end

* Incorporated suggestions from earlephilhower

Extra ^, removed TODO
This commit is contained in:
Martin Berka 2019-09-10 07:44:19 -07:00 committed by Develo
parent 77c4f5e5cf
commit 4f74ed8408

View File

@ -5,7 +5,7 @@ OTA Updates
Introduction Introduction
------------ ------------
OTA (Over the Air) update is the process of loading the firmware to ESP module using Wi-Fi connection rather than a serial port. Such functionality became extremely useful in case of limited or no physical access to the module. 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.
OTA may be done using: OTA may be done using:
@ -13,23 +13,23 @@ OTA may be done using:
- `Web Browser <#web-browser>`__ - `Web Browser <#web-browser>`__
- `HTTP Server <#http-server>`__ - `HTTP Server <#http-server>`__
Arduino IDE option is intended primarily for software development phase. The two other options would be more useful after deployment, to provide module with application updates manually with a web browser, or automatically using a http server. The Arduino IDE option is intended primarily for the software development phase. The other two options would be more useful after deployment, to provide the module with application updates either manually with a web browser, or automatically using an HTTP server.
In any case, the first firmware upload has to be done over a serial port. If the OTA routines are correctly implemented in a sketch, then all subsequent uploads may be done over the air. In any case, the first firmware upload has to be done over a serial port. If the OTA routines are correctly implemented in the sketch, then all subsequent uploads may be done over the air.
By default there is no imposed security on OTA process. It is up to developer to ensure that updates are allowed only from legitimate / trusted sources. Once the update is complete, the module restarts, and the new code is executed. The developer should ensure that the application running on the module is shut down and restarted in a safe manner. Chapters below provide additional information regarding security and safety of OTA process. By default, there is no imposed security for the OTA process. It is up to the developer to ensure that updates are allowed only from legitimate / trusted sources. Once the update is complete, the module restarts, and the new code is executed. The developer should ensure that the application running on the module is shut down and restarted in a safe manner. Chapters below provide additional information regarding security and safety of OTA updates.
Security Disclaimer Security Disclaimer
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
No guarantees as to the level of security provided for your application by the following methods is implied. Please refer to the GNU LGPL license associated for this project for full disclaimers. If you do find security weaknesses, please don't hesitate to contact the maintainers or supply pull requests with fixes. The MD5 verification and password protection schemes are already known as supplying a very weak level of security. No guarantees as to the level of security provided for your application by the following methods is implied. Please refer to the GNU LGPL license associated for this project for full disclaimers. If you do find security weaknesses, please don't hesitate to contact the maintainers or supply pull requests with fixes. The MD5 verification and password protection schemes are already known to supply a very weak level of security.
Basic Security Basic Security
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
The module has to be exposed wirelessly to get it updated with a new sketch. That poses chances of module being violently hacked and loaded with some other code. To reduce likelihood of being hacked consider protecting your uploads with a password, selecting certain OTA port, etc. The module has to be exposed wirelessly to get it updated with a new sketch. That poses a risk of the module being violently hacked and programmed with some other code. To reduce the likelihood of being hacked, consider protecting your uploads with a password, selecting certain OTA port, etc.
Check functionality provided with `ArduinoOTA <https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA>`__ library that may improve security: Check functionality provided with the `ArduinoOTA <https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA>`__ library that may improve security:
.. code:: cpp .. code:: cpp
@ -37,38 +37,38 @@ Check functionality provided with `ArduinoOTA <https://github.com/esp8266/Arduin
void setHostname(const char* hostname); void setHostname(const char* hostname);
void setPassword(const char* password); void setPassword(const char* password);
Certain protection functionality is already built in and do not require any additional coding by developer. `ArduinoOTA <https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA>`__ and espota.py use `Digest-MD5 <https://en.wikipedia.org/wiki/Digest_access_authentication>`__ to authenticate upload. Integrity of transferred data is verified on ESP side using `MD5 <https://en.wikipedia.org/wiki/MD5>`__ checksum. Certain basic protection is already built in and does not require any additional coding by the developer. `ArduinoOTA <https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA>`__ and espota.py use `Digest-MD5 <https://en.wikipedia.org/wiki/Digest_access_authentication>`__ to authenticate uploads. Integrity of transferred data is verified on the ESP side using `MD5 <https://en.wikipedia.org/wiki/MD5>`__ checksum.
Make your own risk analysis and depending on application decide what library functions to implement. If required, consider implementation of other means of protection from being hacked, e.g. exposing module for uploads only according to specific schedule, trigger OTA only be user pressing dedicated “Update” button wired to ESP, etc. Make your own risk analysis and, depending on the application, decide what library functions to implement. If required, consider implementation of other means of protection from being hacked, like exposing modules for uploads only according to a specific schedule, triggering OTA only when the user presses a dedicated “Update” button wired to the ESP, etc.
Advanced Security - Signed Updates Advanced Security - Signed Updates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While the above password-based security will dissuade casual hacking attempts, it is not highly secure. For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. It uses SHA256 hashing in place of MD5 (which is known to be cryptographically broken) and RSA-2048 bit level encryption to guarantee only the holder of a cryptographic private key can generate code accepted by the OTA update mechanisms. While the above password-based security will dissuade casual hacking attempts, it is not highly secure. For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. This uses SHA256 hashing in place of MD5 (which is known to be cryptographically broken) and RSA-2048 bit level encryption to guarantee that only the holder of a cryptographic private key can generate code accepted by the OTA update mechanisms.
These are updates whose compiled binary 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 to the binary that is uploaded (via OTA, web, or HTTP server). If the code is modified or replaced in any way by anyone by the developer with the key, the hash will not match and the ESP8266 will reject the upload and not accept it. 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 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 hash will not match and the ESP8266 will reject the upload.
Cryptographic signing only protects against tampering of binaries delivered 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 provide protection for code inside the device. Again, if a user has physical access they can read out your program. 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.
**Securing your private key is paramount. The same private/public keypair needs to be used to sign binaries as the original upload. Loss of the private key associated with a binary means that you will not be able to OTA to update any of your devices in the field. Alternatively, if the private key is copied, then the copy can be used to sign binaries which will be accepted.** **Securing your private key is paramount. The same private/public keypair that was used with the original upload must also be used to sign later binaries. Loss of the private key associated with a binary means that you will not be able to OTA-update any of your devices in the field. Alternatively, if someone else copies the private key, then they will be able to use it to sign binaries which will be accepted by the ESP.**
Signed Binary Format Signed Binary Format
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
The format of a signed binary is compatible with the standard binary format, and can be uploaded to a non-signed ESP8266 via serial or OTA without any conditions. Note, however, that once an unsigned OTA app is overwritten by this signed version, further updates will require signing. The format of a signed binary is compatible with the standard binary format, and can be uploaded to a non-signed ESP8266 via serial or OTA without any conditions. Note, however, that once an unsigned OTA app is overwritten by this signed version, further updates will require signing.
As shown below, the signed hash is appended to the unsigned binary followed by the total length of the signed hash (i.e. if the signed hash was 64 bytes, then this uint32 will contain 64). This format allows for extensibility (such as adding in a CA-based validation scheme allowing multiple signing keys all based off of a trust anchor), and pull requests are always welcome. As shown below, the signed hash is appended to the unsigned binary, followed by the total length of the signed hash (i.e., if the signed hash was 64 bytes, then this uint32 data segment will contain 64). This format allows for extensibility (such as adding a CA-based validation scheme allowing multiple signing keys all based on a trust anchor). Pull requests are always welcome.
.. code:: bash .. code:: bash
NORMAL-BINARY <SIGNED HASH> <uint32 LENGTH-OF-SIGNING-DATA-INCLUDING-THIS-32-BITS> NORMAL-BINARY <SIGNED HASH> <uint32 LENGTH-OF-SIGNING-DATA-INCLUDING-THIS-32-BITS>
Signed Binary Prequisites Signed Binary Prerequisites
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
OpenSSL is required to run the standard signing steps, and should be available on any UNIX-like or Windows system. As usual, the latest stable version of OpenSSL is recommended. OpenSSL is required to run the standard signing steps, and should be available on any UNIX-like or Windows system. As usual, the latest stable version of OpenSSL is recommended.
Signing requires the generation of an RSA-2048 key (other bit lengths are supported as well, but 2048 is a good selection today) using any appropriate tool. The following lines will generate a new public/private keypair. Run them in the sketch directory: Signing requires the generation of an RSA-2048 key (other bit lengths are supported as well, but 2048 is a good selection today) using any appropriate tool. The following shell commands will generate a new public/private keypair. Run them in the sketch directory:
.. code:: bash .. code:: bash
@ -78,9 +78,9 @@ Signing requires the generation of an RSA-2048 key (other bit lengths are suppor
Automatic Signing -- Only available on Linux and Mac Automatic Signing -- Only available on Linux and Mac
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The simplest way of implementing signing is to use the automatic mode, which is only possible on Linux and Mac presently due to missing tools under Windows. This mode uses the IDE to configure the source code to enable sigining verification with a given public key, and signs binaries as part of the standard build process using a given public key. The simplest way of implementing signing is to use the automatic mode, which presently is only possible on Linux and Mac due to some of the tools not being available for Windows. This mode uses the IDE to configure the source code to enable sigining verification with a given public key, and signs binaries as part of the standard build process using a given public key.
To enable this mode, just include `private.key` and `public.key` in the sketch `.ino` directory. The IDE will call a helper script (`tools/signing.py`) before the build begins to create a header to enable key validation using the given public key, and after the build process to actually do the signing, generating a `sketch.bin.signed` file. When OTA is enabled (ArduinoOTA, Web, or HTTP) the binary will only accept signed updates automatically. To enable this mode, just include `private.key` and `public.key` in the sketch `.ino` directory. The IDE will call a helper script (`tools/signing.py`) before the build begins to create a header to enable key validation using the given public key, and to actually do the signing after the build process, generating a `sketch.bin.signed` file. When OTA is enabled (ArduinoOTA, Web, or HTTP), the binary will automatically only accept signed updates.
When the signing process starts, the message: When the signing process starts, the message:
@ -88,7 +88,7 @@ When the signing process starts, the message:
Enabling binary signing Enabling binary signing
Will appear in the IDE window before a compile is launched, and at the completion of the build the signed binary file well be displayed in the IDE build window as: will appear in the IDE window before a compile is launched. At the completion of the build, the signed binary file well be displayed in the IDE build window as:
.. code:: bash .. code:: bash
@ -102,10 +102,10 @@ If you receive either of the following messages in the IDE window, the signing w
... or ... ... or ...
Not signing the generated binary Not signing the generated binary
Manual Signing Binaries Manual Signing of Binaries
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Users may also manually sign executables and require the OTA process to verify their signature. In the main code, before enabling any update methods, add the call: Users may also manually sign executables and require the OTA process to verify their signature. In the main code, before enabling any update methods, add the following declarations and function call:
.. code:: cpp .. code:: cpp
@ -117,7 +117,7 @@ Users may also manually sign executables and require the OTA process to verify t
<in setup()> <in setup()>
Update.installSignature( &hash, &sign ); Update.installSignature( &hash, &sign );
The above snipped creates a BearSSL public key, a SHA256 hash verifier, and tells the Update object to use them to validate any updates it receives from any method. The above snippet creates a BearSSL public key and a SHA256 hash verifier, and tells the Update object to use them to validate any updates it receives from any method.
Compile the sketch normally and, once a `.bin` file is available, sign it using the signer script: Compile the sketch normally and, once a `.bin` file is available, sign it using the signer script:
@ -140,11 +140,11 @@ To create a legacy signature, call the signing script with --legacy:
Safety Safety
~~~~~~ ~~~~~~
OTA process takes ESPs resources and bandwidth during upload. Then module is restarted and a new sketch executed. Analyse and test how it affects functionality of existing and new sketch. The OTA process consumes some of the ESPs resources and bandwidth during upload. Then, the module is restarted and a new sketch executed. Analyse and test how this affects the functionality of the existing and new sketches.
If ESP is placed in remote location and controlling some equipment, you should put additional attention what happens if operation of this equipment is suddenly interrupted by update process. Therefore, decide how to put this equipment into safe state before starting the update. For instance, your module may be controlling a garden watering system in a sequence. If this sequence is not properly shut down and a water valve left open, your garden may be flooded. If the ESP is in a remote location and controlling some equipment, you should devote additional attention to what happens if operation of this equipment is suddenly interrupted by the update process. Therefore, decide how to put this equipment into a safe state before starting the update. For instance, your module may be controlling a garden watering system in a sequence. If this sequence is not properly shut down and a water valve is left open, the garden may be flooded.
The following functions are provided with `ArduinoOTA <https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA>`__ library and intended to handle functionality of your application during specific stages of OTA, or on an OTA error: The following functions are provided with the `ArduinoOTA <https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA>`__ library and intended to handle functionality of your application during specific stages of OTA, or on an OTA error:
.. code:: cpp .. code:: cpp
@ -156,24 +156,30 @@ The following functions are provided with `ArduinoOTA <https://github.com/esp826
OTA Basic Requirements OTA Basic Requirements
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
Flash chip size should be able to hold the old sketch (currently running) and the new sketch (OTA) at the same time. The flash chip size should be large enough to hold the old sketch (currently running) and the new sketch (OTA) at the same time.
Keep in mind that the File system and EEPROM for example needs space too (one time) see `Flash layout <../filesystem.rst#flash-layout>`__. Keep in mind that the file system and EEPROM, for example, need space too; see `Flash layout <../filesystem.rst#flash-layout>`__.
.. code:: cpp .. code:: cpp
ESP.getFreeSketchSpace(); ESP.getFreeSketchSpace();
can be used for checking the free space for the new sketch. can be used for checking the free space available for the new sketch.
For overview of memory layout, where new sketch is stored and how it is copied during OTA process, see `Update process - memory view <#update-process-memory-view>`__. For an overview of memory layout, where the new sketch is stored and how it is copied during the OTA process, see `Update process - memory view <#update-process-memory-view>`__.
The following chapters provide more details and specific methods of doing OTA. The following chapters provide more details and specific methods for OTA updates.
Arduino IDE Arduino IDE
----------- -----------
Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios: - during firmware development as a quicker alternative to loading over a serial, - for updating small quantity of modules, - only if modules are available on the same network as the computer with Arduino IDE. Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios:
- during firmware development as a quicker alternative to loading over a serial port,
- for updating a small number of modules,
- only if modules are accessible on the same network as the computer with the Arduino IDE.
Requirements Requirements
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -183,9 +189,9 @@ Requirements
Application Example Application Example
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) board. You can use any other board assuming that it meets `requirements <#basic-requirements>`__ described above. This instruction is valid for all operating systems supported by Arduino IDE. Screen captures have been made on Windows 7 and you may see small differences (like name of serial port), if you are using Linux and MacOS. Instructions below show configuration of OTA on a NodeMCU 1.0 (ESP-12E Module) board. You can use any other board that meets the `requirements <#basic-requirements>`__ described above. This instruction is valid for all operating systems supported by the Arduino IDE. Screen captures have been made on Windows 7 and you may see small differences (like name of the serial port), if you are using Linux or MacOS.
1. Before you begin, please make sure that you have the following s/w 1. Before you begin, please make sure that you have the following software
installed: installed:
- Arduino IDE 1.6.7 or newer - - Arduino IDE 1.6.7 or newer -
@ -201,13 +207,12 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa
.. figure:: a-ota-python-configuration.png .. figure:: a-ota-python-configuration.png
:alt: Python installation set up :alt: Python installation set up
2. Now prepare the sketch and configuration for the upload over a serial 2. Now prepare the sketch and configuration for upload via a serial port.
port.
- Start Arduino IDE and load sketch BasicOTA.ino available under - Start Arduino IDE and upload the sketch BasicOTA.ino, available under
File > Examples > ArduinoOTA |ota sketch selection| File > Examples > ArduinoOTA |ota sketch selection|
- Update SSID and password in the sketch, so the module can join - Update the SSID and password in the sketch, so that the module can join
your Wi-Fi network |ota ssid pass entry| your Wi-Fi network |ota ssid pass entry|
- Configure upload parameters as below (you may need to adjust - Configure upload parameters as below (you may need to adjust
@ -225,20 +230,20 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa
.. figure:: a-ota-upload-complete-and-joined-wifi.png .. figure:: a-ota-upload-complete-and-joined-wifi.png
:alt: Check if module joined network :alt: Check if module joined network
**Note:** ESP module should be reset after serial upload. Otherwise subsequent steps will not work. Reset may be done automatically for you after opening serial monitor as visible on the screenshot above. It depends on how you have DTR and RTS wired from USB-Serial converter to the ESP. If reset is not done automatically, then do it by pressing reset button or manually cycling the power. For more details why this should be done please refer to `FAQ <../faq#i-have-observed-a-case-when-esprestart-doesnt-work-what-is-the-reason-for-that>`__ regarding ``ESP.restart()``. **Note:** The ESP module should be reset after serial upload. Otherwise, subsequent steps will not work. Reset may be done for you automatically after opening serial monitor, as visible on the screenshot above. It depends on how you have DTR and RTS wired from the USB-Serial converter to the ESP. If reset is not done automatically, then trigger it by pressing reset button or manually cycling the power. For more details why this should be done please refer to `FAQ <../faq#i-have-observed-a-case-when-esprestart-doesnt-work-what-is-the-reason-for-that>`__ regarding ``ESP.restart()``.
4. Only if module is connected to network, after a couple of seconds, 4. Only if the module is connected to network, after a couple of seconds,
the esp8266-ota port will show up in Arduino IDE. Select port with IP the esp8266-ota port will show up in Arduino IDE. Select port with IP
address shown in the Serial Monitor window in previous step: address shown in the Serial Monitor window in previous step:
.. figure:: a-ota-ota-port-selection.png .. figure:: a-ota-ota-port-selection.png
:alt: Selection of OTA port :alt: Selection of OTA port
**Note:** If OTA port does not show up, exit Arduino IDE, open it **Note:** If the OTA port does not show up, exit Arduino IDE, open it
again and check if port is there. If it does not help, check your again and check if the port is there. If it is not, check your
firewall and router settings. OTA port is advertised using mDNS firewall and router settings. The OTA port is advertised using mDNS
service. To check if port is visible by your PC, you can use service. To check if the port is visible by your PC, you can use
application like Bonjour Browser. an application like Bonjour Browser.
5. Now get ready for your first OTA upload by selecting the OTA port: 5. Now get ready for your first OTA upload by selecting the OTA port:
@ -498,9 +503,9 @@ Simple updater downloads the file every time the function is called.
Advanced updater Advanced updater
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
Its possible to point update function to a script at the server. If version string argument is given, it will be sent to the server. Server side script can use this to check if update should be performed. Its possible to point the update function to a script on the server. If a version string argument is given, it will be sent to the server. The server side script can use this string to check whether an update should be performed.
Server side script can respond as follows: - response code 200, and send the firmware image, - or response code 304 to notify ESP that no update is required. The server-side script can respond as follows: - response code 200, and send the firmware image, - or response code 304 to notify ESP that no update is required.
.. code:: cpp .. code:: cpp
@ -513,7 +518,7 @@ Server side script can respond as follows: - response code 200, and send the fir
Serial.println("[update] Update no Update."); Serial.println("[update] Update no Update.");
break; break;
case HTTP_UPDATE_OK: case HTTP_UPDATE_OK:
Serial.println("[update] Update ok."); // may not called we reboot the ESP Serial.println("[update] Update ok."); // may not be called since we reboot the ESP
break; break;
} }
@ -528,7 +533,7 @@ For the simple updater the server only needs to deliver the binary file for upda
Advanced updater Advanced updater
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
For advanced update management a script needs to run at the server side, for example a PHP script. At every update request the ESP sends some information in HTTP headers to the server. For advanced update management a script (such as a PHP script) needs to run on the server side. On every update request, the ESP sends some information in HTTP headers to the server.
Example header data: Example header data:
@ -544,9 +549,7 @@ Example header data:
[HTTP_X_ESP8266_SDK_VERSION] => 1.3.0 [HTTP_X_ESP8266_SDK_VERSION] => 1.3.0
[HTTP_X_ESP8266_VERSION] => DOOR-7-g14f53a19 [HTTP_X_ESP8266_VERSION] => DOOR-7-g14f53a19
With this information the script now can check if an update is needed. It is also possible to deliver different binaries based on the MAC address for example. With this information the script now can check if an update is needed. It is also possible to deliver different binaries based on the MAC address, as in the following example:
Script example:
.. code:: php .. code:: php
@ -619,9 +622,13 @@ Script example:
Stream Interface Stream Interface
---------------- ----------------
TODO describe Stream Interface The Stream Interface is the base for all other update modes like OTA, HTTP Server / client. Given a Stream-class variable `streamVar` providing `byteCount` bytes of firmware, it can store the firmware as follows:
The Stream Interface is the base for all other update modes like OTA, http Server / client. .. code:: cpp
Update.begin(firmwareLengthInBytes);
Update.writeStream(streamVar);
Update.end();
Updater class Updater class
------------- -------------
@ -635,7 +642,7 @@ Update process - memory view
- The new sketch will be stored in the space between the old sketch and - The new sketch will be stored in the space between the old sketch and
the spiff. the spiff.
- on the next reboot the "eboot" bootloader check for commands. - on the next reboot, the "eboot" bootloader checks for commands.
- the new sketch is now copied "over" the old one. - the new sketch is now copied "over" the old one.
- the new sketch is started. - the new sketch is started.