Merge branch 'master' of https://github.com/krzychb/Arduino into krzychb-master
Conflicts: doc/ota_updates/ota_updates.md
@ -50,7 +50,7 @@ Documentation for latest development version:
|
||||
- [Reference](doc/reference.md)
|
||||
- [Supported boards](doc/boards.md)
|
||||
- [Change log](doc/changes.md)
|
||||
- [OTA Update](doc/ota_updates.md)
|
||||
- [OTA Update](doc/ota_updates/ota_updates.md)
|
||||
|
||||
### Issues and support ###
|
||||
|
||||
|
@ -301,6 +301,8 @@ nodemcuv2.menu.CpuFrequency.160.build.f_cpu=160000000L
|
||||
nodemcuv2.menu.UploadTool.esptool=Serial
|
||||
nodemcuv2.menu.UploadTool.esptool.upload.tool=esptool
|
||||
nodemcuv2.menu.UploadTool.esptool.upload.verbose=-vv
|
||||
nodemcuv2.menu.UploadTool.espota=OTA
|
||||
nodemcuv2.menu.UploadTool.espota.upload.tool=espota
|
||||
|
||||
nodemcuv2.menu.UploadSpeed.115200=115200
|
||||
nodemcuv2.menu.UploadSpeed.115200.upload.speed=115200
|
||||
|
BIN
doc/ota_updates/ota-ide-module-joined-wifi.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
doc/ota_updates/ota-ide-ota-port-selection.png
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
doc/ota_updates/ota-ide-ota-upload-complete.png
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
doc/ota_updates/ota-ide-ota-upload-configuration.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
doc/ota_updates/ota-ide-python-configuration.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
doc/ota_updates/ota-ide-serial-upload-configuration.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
doc/ota_updates/ota-ide-sketch-selection.png
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
doc/ota_updates/ota-ide-ssid-pass-entry.png
Normal file
After Width: | Height: | Size: 25 KiB |
@ -8,17 +8,82 @@ title: OTA Update
|
||||
* [HTTP Server](#http-server)
|
||||
* [Stream Interface](#stream-interface)
|
||||
|
||||
## Introduction
|
||||
|
||||
OTA (Over the Air) update is the process of loading the firmware to ESP module using WiFi connection rather that a serial port. Such functionality became extremely useful in case of limited or no physical access to the module. There is no imposed protection on OTA update process. Such protection should be implemented by developer to ensure that updates are allowed only from legitimate / trusted source.
|
||||
|
||||
OTA may be done from:
|
||||
- [Arduino IDE](#arduino-ide)
|
||||
- [HTTP server](#http-server)
|
||||
|
||||
In any case first firmware upload have to be done over a serial port. If OTA routines are correctly implemented in sketch, then all subsequent uploads may be done over the air.
|
||||
|
||||
The following chapters provide more details and both methods of doing OTA.
|
||||
|
||||
|
||||
## Basic Requirements
|
||||
|
||||
- Flash chip size is 2x the size of the sketch.
|
||||
|
||||
## Arduino IDE
|
||||
|
||||
TODO describe Arduino IDE OTA process
|
||||
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
|
||||
|
||||
#### Requirements
|
||||
- The ESP and the computer must be connected to the same network.
|
||||
|
||||
#### Let's Do It
|
||||
|
||||
OTA process will be demonstrated using:
|
||||
- DNS_SD_Arduino_OTA.ino sketch available from Arduino IDE
|
||||
- NodeMCU 1.0 board with ESP-12E module
|
||||
|
||||
1. Before you begin, please make sure that you have the following installed:
|
||||
- Arduino IDE and ESP8266 board support as described under https://github.com/esp8266/Arduino#installing-with-boards-manager
|
||||
- Python 2.7.10 (do not install Python 3.5.0 that is not supported):
|
||||
1. Upload Python from https://www.python.org/
|
||||
2. Start installer
|
||||
3. Select “Add python.exe to Path” (see below – that option is not selected by default)
|
||||
4. Complete remaining steps of installation
|
||||
|
||||

|
||||
|
||||
2. Now prepare the sketch and configuration for the upload over a serial port.
|
||||
|
||||
- Start Arduino IDE and load sketch DNS_SD_Arduino_OTA.ino available under File > Examples > ESP8266mDNS
|
||||
|
||||

|
||||
|
||||
- Update ssid and pass in the sketch so the module can join your WiFi network
|
||||
|
||||

|
||||
|
||||
- Configure upload parameters as below (you may need to adjust configuration if you are using a different module):
|
||||
|
||||

|
||||
|
||||
3. Upload the sketch (Ctrl+U). Once done open Serial Monitor (Ctrl+Shift+M) and check if the module has joined your WiFi network.
|
||||
|
||||

|
||||
|
||||
4. Only if module is connected, after a dozen (or two dozens) of seconds the esp8266-ota port will show up in Arduino IDE:
|
||||
|
||||

|
||||
|
||||
5. Now get ready for your first OTA upload by changing configuration settings as follows:
|
||||
|
||||

|
||||
|
||||
6. If you have successfully completed all the above steps, you can upload (Ctrl+U) the same (or any other) sketch over OTA:
|
||||
|
||||

|
||||
|
||||
**Note** To be able to upload your sketch over and over again using OTA, you need to embed OTA routines inside. Please use DNS_SD_Arduino_OTA.ino as an example.
|
||||
|
||||
|
||||
## HTTP Server
|
||||
|
||||
```ESPhttpUpdate``` class can check for updates and download a binary file from HTTP web server.
|