Skip to content

Commit 4d2b71c

Browse files
committed
Renamed sever to close and added information to readme
Also my editor automatically removed some odd whitespace at the end of a few lines.
1 parent e81af05 commit 4d2b71c

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

doc/ota_updates/readme.rst

100644100755
+9-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ As shown below, the signed hash is appended to the unsigned binary, followed by
6161

6262
.. code:: bash
6363
64-
NORMAL-BINARY <SIGNED HASH> <uint32 LENGTH-OF-SIGNING-DATA-INCLUDING-THIS-32-BITS>
64+
NORMAL-BINARY <SIGNED HASH> <uint32 LENGTH-OF-SIGNING-DATA-INCLUDING-THIS-32-BITS>
6565
6666
Signed Binary Prerequisites
6767
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -200,11 +200,11 @@ The following chapters provide more details and specific methods for OTA updates
200200
Arduino IDE
201201
-----------
202202

203-
Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios:
203+
Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios:
204204

205-
- during firmware development as a quicker alternative to loading over a serial port,
205+
- during firmware development as a quicker alternative to loading over a serial port,
206206

207-
- for updating a small number of modules,
207+
- for updating a small number of modules,
208208

209209
- only if modules are accessible on the same network as the computer with the Arduino IDE.
210210

@@ -510,6 +510,11 @@ HTTP Server
510510

511511
``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.
512512

513+
Note that by default this class closes all other connections except the one used by the update, this is because the update method blocks. This means that if there's another application receiving data then TCP packets will build up in the buffer leading to out of memory errors causing the OTA update to fail. There's also a limited number of receive buffers available and all may be used up by other applications.
514+
515+
There are some cases where you know that you won't be receiving any data but would still like to send progress updates.
516+
It's possible to disable the default behaviour (and keep connections open) by calling closeConnectionsOnUpdate(false).
517+
513518
Requirements
514519
~~~~~~~~~~~~
515520

libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::handleUpdate(HTTPClient& http, const String&
345345

346346
WiFiClient * tcp = http.getStreamPtr();
347347

348-
if (_severConnectionsOnUpdate) {
348+
if (_closeConnectionsOnUpdate) {
349349
WiFiUDP::stopAll();
350350
WiFiClient::stopAllExcept(tcp);
351351
}

libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class ESP8266HTTPUpdate
8787
_followRedirects = follow;
8888
}
8989

90-
void severConnectionsOnUpdate(bool sever)
90+
void closeConnectionsOnUpdate(bool sever)
9191
{
92-
_severConnectionsOnUpdate = sever;
92+
_closeConnectionsOnUpdate = sever;
9393
}
9494

9595
void setLedPin(int ledPin = -1, uint8_t ledOn = HIGH)
@@ -157,7 +157,7 @@ class ESP8266HTTPUpdate
157157
}
158158
int _lastError;
159159
bool _rebootOnUpdate = true;
160-
bool _severConnectionsOnUpdate = true;
160+
bool _closeConnectionsOnUpdate = true;
161161
private:
162162
int _httpClientTimeout;
163163
bool _followRedirects;

0 commit comments

Comments
 (0)