mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-07 16:23:38 +03:00
Fix some typos
This commit is contained in:
parent
adb0dac077
commit
11340a5d76
@ -10,44 +10,42 @@ title: OTA Update
|
|||||||
|
|
||||||
## Basic Requirements
|
## Basic Requirements
|
||||||
|
|
||||||
- Flash chip size is 2x the size of the sketch
|
- Flash chip size is 2x the size of the sketch.
|
||||||
|
|
||||||
## Arduino IDE
|
## Arduino IDE
|
||||||
|
|
||||||
TODO describe Arduino IDE OTA process
|
TODO describe Arduino IDE OTA process
|
||||||
|
|
||||||
#### Requirements
|
#### Requirements
|
||||||
- The ESP and the Computer must be connected to the Same network.
|
- The ESP and the computer must be connected to the same network.
|
||||||
|
|
||||||
|
|
||||||
## HTTP Server
|
## HTTP Server
|
||||||
|
|
||||||
the ```ESPhttpUpdate``` class can check for updates and download a binary file form a HTTP web server.
|
```ESPhttpUpdate``` class can check for updates and download a binary file from HTTP web server.
|
||||||
It is possible to download updates from every IP or domain address on the Network or Internet.
|
It is possible to download updates from every IP or domain address on the network or Internet.
|
||||||
|
|
||||||
|
|
||||||
#### Requirements
|
#### Requirements
|
||||||
- web server
|
- web server
|
||||||
|
|
||||||
|
|
||||||
#### Arduino code
|
#### Arduino code
|
||||||
|
|
||||||
##### simple updater
|
##### Simple updater
|
||||||
|
|
||||||
the Simple Updater downloads the File every time the function is called.
|
Simple updater downloads the file every time the function is called.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
ESPhttpUpdate.update("192.168.0.2", 80, "/arduino.bin");
|
ESPhttpUpdate.update("192.168.0.2", 80, "/arduino.bin");
|
||||||
```
|
```
|
||||||
|
|
||||||
##### advanced updater
|
##### Advanced updater
|
||||||
|
|
||||||
Its possible to point to a script at the server.
|
Its possible to point update function to a script at the server.
|
||||||
If a version String is delivered to the Function this String will be send to the server.
|
If version string argument is given, it will be sent to the server.
|
||||||
A Server side Update check is now possible.
|
Server side script can use this to check if update should be performed.
|
||||||
|
|
||||||
the Server can return a binary file for update (Header 200)
|
Server side script can respond as follows:
|
||||||
or it return header 304 to notify the ESP that no Update is needed.
|
- response code 200, and send the firmware image,
|
||||||
|
- or response code 304 to notify ESP that no update is required.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.0.2", 80, "/esp/update/arduino.php", "optional current version string here");
|
t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.0.2", 80, "/esp/update/arduino.php", "optional current version string here");
|
||||||
@ -66,16 +64,16 @@ switch(ret) {
|
|||||||
|
|
||||||
#### Server request handling
|
#### Server request handling
|
||||||
|
|
||||||
##### simple updater
|
##### Simple updater
|
||||||
|
|
||||||
for the simple Updater the Server only needs to deliver the binary file for update.
|
For the simple updater the server only needs to deliver the binary file for update.
|
||||||
|
|
||||||
##### advanced updater
|
##### Advanced updater
|
||||||
|
|
||||||
for advanced update management a Script needs to run at the Server side, for example a PHP script.
|
For advanced update management a script needs to run at the server side, for example a PHP script.
|
||||||
at every Update request the the ESP sends some informations in the Header to the Server
|
At every update request the the ESP sends some information in HTTP headers to the server.
|
||||||
|
|
||||||
example Header data:
|
Example header data:
|
||||||
```
|
```
|
||||||
[HTTP_USER_AGENT] => ESP8266-http-Update
|
[HTTP_USER_AGENT] => ESP8266-http-Update
|
||||||
[HTTP_X_ESP8266_STA_MAC] => 18:FE:AA:AA:AA:AA
|
[HTTP_X_ESP8266_STA_MAC] => 18:FE:AA:AA:AA:AA
|
||||||
@ -87,10 +85,9 @@ example Header data:
|
|||||||
[HTTP_X_ESP8266_VERSION] => DOOR-7-g14f53a19
|
[HTTP_X_ESP8266_VERSION] => DOOR-7-g14f53a19
|
||||||
```
|
```
|
||||||
|
|
||||||
with this information the script now can check if a update is needed.
|
With this information the script now can check if a update is needed. It is also possible to deliver different binaries based on the MAC address for example.
|
||||||
It is also possible to deliver different binary´s based on the MAC address for example.
|
|
||||||
|
|
||||||
script example:
|
Script example:
|
||||||
```php
|
```php
|
||||||
<?PHP
|
<?PHP
|
||||||
|
|
||||||
@ -152,11 +149,6 @@ header($_SERVER["SERVER_PROTOCOL"].' 500 no version for ESP MAC', true, 500);
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Stream Interface
|
## Updater class
|
||||||
|
|
||||||
TODO describe Stream Interface update proccess
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
ESP.updateSketch(client, length);
|
|
||||||
```
|
|
||||||
|
|
||||||
|
TODO describe Updater class
|
||||||
|
Loading…
x
Reference in New Issue
Block a user