Skip to content

Commit c1c2eba

Browse files
committed
add first OTA description
1 parent 7f05060 commit c1c2eba

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

doc/ota_updates.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: OTA Update
3+
---
4+
5+
## Table of Contents
6+
* [Requirements](#Requirements)
7+
* [Arduino IDE](#arduino-ide)
8+
* [HTTP Server](#http-server)
9+
* [Stream Interface](#stream-interface)
10+
11+
## Requirements
12+
13+
Basic requirement:
14+
- Flash chip size is 2x the size of the sketch
15+
16+
## Arduino IDE
17+
18+
TODO describe Arduino IDE OTA process
19+
20+
### Requirements
21+
- The ESP and the Computer must be connected to the Same network.
22+
23+
24+
## HTTP Server
25+
26+
the ```ESPhttpUpdate``` class can check for updates and download a binary file form a HTTP web server.
27+
It is possible to download updates from every IP or domain address on the Network or Internet.
28+
29+
30+
### Requirements
31+
- web server
32+
33+
34+
### Arduino code
35+
36+
simple updater:
37+
```cpp
38+
ESPhttpUpdate.update("192.168.0.2", 80, "/arduino.bin");
39+
```
40+
41+
advanced:
42+
```cpp
43+
t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.0.2", 80, "/esp/update/arduino.php", "optional current version string here");
44+
switch(ret) {
45+
case HTTP_UPDATE_FAILD:
46+
Serial.println("[update] Update fail.");
47+
break;
48+
case HTTP_UPDATE_NO_UPDATES:
49+
Serial.println("[update] Update no Update.");
50+
break;
51+
case HTTP_UPDATE_OK:
52+
Serial.println("[update] Update ok."); // may not called we reboot the ESP
53+
break;
54+
}
55+
```
56+
57+
### Server request handling
58+
59+
TODO server side
60+
61+
## Stream Interface
62+
63+
TODO describe Stream Interface update proccess
64+
65+
```cpp
66+
ESP.updateSketch(client, length);
67+
```
68+

0 commit comments

Comments
 (0)