Skip to content

Commit 201759d

Browse files
committed
Update OTA updates docs for ESP platforms // Resolve #222
1 parent 44ed1e7 commit 201759d

File tree

2 files changed

+60
-20
lines changed

2 files changed

+60
-20
lines changed

platforms/espressif32_extra.rst

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ Examples:
271271
Over-the-Air (OTA) update
272272
~~~~~~~~~~~~~~~~~~~~~~~~~
273273

274+
.. warning::
275+
Please make sure to read the theory behind the OTA updates in the
276+
`Over The Air Updates (OTA) <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/ota.html>`_
277+
article.
278+
274279
Using JFrog Bintray (free and secure Cloud solution)
275280
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
276281

@@ -280,34 +285,48 @@ Using JFrog Bintray (free and secure Cloud solution)
280285
Using built-in Local solution
281286
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282287

283-
Demo code for:
284-
285-
* `Arduino <https://github.com/espressif/arduino-esp32/tree/master/libraries/ArduinoOTA/examples/BasicOTA>`_
286-
* `ESP-IDF <https://github.com/espressif/esp-idf/tree/master/examples/system/ota>`_
287-
288-
There are 2 options:
288+
1. Create a new project using :ref:`piohome` or initialize a project via
289+
:ref:`piocore` and :ref:`cmd_project_init` (if you have not initialized it yet)
290+
2. Copy the `basicOTA <https://github.com/espressif/arduino-esp32/tree/master/libraries/ArduinoOTA/examples/BasicOTA>`_
291+
example for Arduino or `Simple OTA <https://github.com/espressif/esp-idf/tree/master/examples/system/ota/simple_ota_example>`_ example for ESP-IDF to :ref:`projectconf_pio_src_dir`
292+
and configure your WiFi credentials
293+
(SSID and password).
294+
3. Compile the project to ensure there are no syntax errors in the code.
289295

290-
* Directly specify :option:`pio run --upload-port` in command line
296+
To upload the binary you can either specify the upload address directly in the CLI
297+
command using the :option:`pio run --upload-port` option:
291298

292299
.. code-block:: bash
293300
294301
pio run --target upload --upload-port IP_ADDRESS_HERE or mDNS_NAME.local
295302
296-
* Specify ``upload_port`` option in :ref:`projectconf`
303+
For example:
304+
305+
.. code-block:: none
297306
307+
pio run -t upload --upload-port 192.168.0.255
308+
pio run -t upload --upload-port myesp32.local
298309
299-
You also need to set :ref:`projectconf_upload_protocol` to ``espota``.
310+
Or use the ``upload_port`` option in :ref:`projectconf`. Please note that you also
311+
need to set :ref:`projectconf_upload_protocol` to ``espota``:
300312

301313
.. code-block:: ini
302314
303315
[env:myenv]
304316
upload_protocol = espota
305317
upload_port = IP_ADDRESS_HERE or mDNS_NAME.local
306318
307-
For example,
319+
For example:
320+
321+
.. code-block:: ini
322+
323+
[env:myenv]
324+
platform = espressif32
325+
board = esp32dev
326+
framework = arduino
327+
upload_protocol = espota
328+
upload_port = 192.168.0.255
308329
309-
* ``pio run -t upload --upload-port 192.168.0.255``
310-
* ``pio run -t upload --upload-port myesp8266.local``
311330
312331
Authentication and upload options
313332
'''''''''''''''''''''''''''''''''

platforms/espressif8266_extra.rst

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -524,31 +524,52 @@ Where a special variable ``ESP8266_FS_IMAGE_NAME`` can be overridden:
524524
Over-the-Air (OTA) update
525525
~~~~~~~~~~~~~~~~~~~~~~~~~
526526

527-
Firstly, please read `What is OTA? How to use it? <https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html>`_
527+
.. warning::
528+
Please make sure to read the theory behind the OTA updates in the
529+
`What is OTA? How to use it? <https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html>`_
530+
article first.
528531

529-
There are 2 options:
532+
1. Create a new project using :ref:`piohome` or initialize a project via
533+
:ref:`piocore` and :ref:`cmd_project_init` (if you have not initialized it yet)
534+
2. Copy the `basicOTA <https://github.com/esp8266/Arduino/blob/master/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino>`_
535+
example to :ref:`projectconf_pio_src_dir` and configure your WiFi credentials
536+
(SSID and password).
537+
3. Compile the project to ensure there are no syntax errors in the code.
530538

531-
* Directly specify :option:`pio run --upload-port` in command line
539+
To upload the binary you can either specify the upload address directly in the CLI
540+
command using the :option:`pio run --upload-port` option:
532541

533542
.. code-block:: bash
534543
535544
pio run --target upload --upload-port IP_ADDRESS_HERE or mDNS_NAME.local
536545
537-
* Specify ``upload_port`` option in :ref:`projectconf`
546+
For example:
538547

548+
.. code-block:: none
539549
540-
You also need to set :ref:`projectconf_upload_protocol` to ``espota``.
550+
pio run -t upload --upload-port 192.168.0.255
551+
pio run -t upload --upload-port myesp8266.local
552+
553+
Or use the ``upload_port`` option in :ref:`projectconf`. Please note that you also
554+
need to set :ref:`projectconf_upload_protocol` to ``espota``:
541555

542556
.. code-block:: ini
543557
544558
[env:myenv]
545559
upload_protocol = espota
546560
upload_port = IP_ADDRESS_HERE or mDNS_NAME.local
547561
548-
For example,
562+
For example:
563+
564+
.. code-block:: ini
565+
566+
[env:myenv]
567+
platform = espressif8266
568+
board = nodemcuv2
569+
framework = arduino
570+
upload_protocol = espota
571+
upload_port = 192.168.0.255
549572
550-
* ``pio run -t upload --upload-port 192.168.0.255``
551-
* ``pio run -t upload --upload-port myesp8266.local``
552573
553574
Authentication and upload options
554575
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)