Skip to content

Commit

Permalink
provisioning_examples: Move older examples to legacy/ folder
Browse files Browse the repository at this point in the history
Change the manager example folder name to wifi_prov_mgr to sound more meaningful.

Signed-off-by: Piyush Shah <[email protected]>
  • Loading branch information
shahpiyushv authored and espressif-bot committed Mar 13, 2020
1 parent ad7dfb7 commit 156ae68
Show file tree
Hide file tree
Showing 70 changed files with 66 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ exclude =
components/wifi_provisioning/python/wifi_config_pb2.py,
components/wifi_provisioning/python/wifi_constants_pb2.py,
components/esp_local_ctrl/python/esp_local_ctrl_pb2.py,
examples/provisioning/custom_config/components/custom_provisioning/python/custom_config_pb2.py,
examples/provisioning/legacy/custom_config/components/custom_provisioning/python/custom_config_pb2.py,
4 changes: 2 additions & 2 deletions docs/en/api-reference/provisioning/protocomm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Note that the client still needs to establish session (only for protocomm_securi

Transport Example (SoftAP + HTTP) with Security 1
-------------------------------------------------
For complete example see :example:`provisioning/softap_prov`
For complete example see :example:`provisioning/legacy/softap_prov`

.. highlight:: c

Expand Down Expand Up @@ -113,7 +113,7 @@ For complete example see :example:`provisioning/softap_prov`

Transport Example (BLE) with Security 0
---------------------------------------
For complete example see :example:`provisioning/ble_prov`
For complete example see :example:`provisioning/legacy/ble_prov`

.. highlight:: c

Expand Down
12 changes: 9 additions & 3 deletions docs/en/api-reference/provisioning/provisioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,21 @@ Sample Code
>>>>>>>>>>>
Please refer to :doc:`protocomm` and :doc:`wifi_provisioning` for API guides and code snippets on example usage.

Various use case implementations can be found as examples under :example:`provisioning`.
Application implementation can be found as an example under :example:`provisioning`.

Provisioning Tools
>>>>>>>>>>>>>>>>>>

Provisioning applications are available for various platforms, along with source code:

* Android : `esp-idf-provisioning-android <https://github.com/espressif/esp-idf-provisioning-android>`_
* iOS : `esp-idf-provisioning-ios <https://github.com/espressif/esp-idf-provisioning-ios>`_
* Android:
* `BLE Provisioning app on Play Store <https://play.google.com/store/apps/details?id=com.espressif.provble>`_.
* `SoftAP Provisioning app on Play Store <https://play.google.com/store/apps/details?id=com.espressif.provsoftap>`_.
* Source code on GitHub: `esp-idf-provisioning-android <https://github.com/espressif/esp-idf-provisioning-android>`_.
* iOS:
* `BLE Provisioning app on app store <https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141>`_.
* `SoftAP Provisioning app on app Store <https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630>`_.
* Source code on GitHub: `esp-idf-provisioning-ios <https://github.com/espressif/esp-idf-provisioning-ios>`_.
* Linux/MacOS/Windows : :idf:`tools/esp_prov` (a python based command line tool for provisioning)

The phone applications offer simple UI and thus more user centric, while the command line application is useful as a debugging tool for developers.
20 changes: 19 additions & 1 deletion docs/en/api-reference/provisioning/wifi_provisioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,25 @@ The customized behavior is useful for applications which want the provisioning s
Application Examples
--------------------

For complete example implementation see :example:`provisioning/manager`
For complete example implementation see :example:`provisioning/wifi_prov_mgr`

Provisioning Tools
--------------------

Provisioning applications are available for various platforms, along with source code:

* Android:
* `BLE Provisioning app on Play Store <https://play.google.com/store/apps/details?id=com.espressif.provble>`_.
* `SoftAP Provisioning app on Play Store <https://play.google.com/store/apps/details?id=com.espressif.provsoftap>`_.
* Source code on GitHub: `esp-idf-provisioning-android <https://github.com/espressif/esp-idf-provisioning-android>`_.
* iOS:
* `BLE Provisioning app on app store <https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141>`_.
* `SoftAP Provisioning app on app Store <https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630>`_.
* Source code on GitHub: `esp-idf-provisioning-ios <https://github.com/espressif/esp-idf-provisioning-ios>`_.
* Linux/MacOS/Windows : :idf:`tools/esp_prov` (a python based command line tool for provisioning)

The phone applications offer simple UI and thus more user centric, while the command line application is useful as a debugging tool for developers.


API Reference
-------------
Expand Down
27 changes: 20 additions & 7 deletions examples/provisioning/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Provisioning Application Examples

These consist of the following examples :
This primarily consists of a single unified example wifi_prov_mgr

* wifi_prov_mgr
Abstracts out most of the complexity of Wi-Fi provisioning and allows easy switching between the SoftAP (using HTTP) and BLE transports.

Provisioning applications are available for various platforms:

* Android:
- [BLE Provisioning app on Play Store](https://play.google.com/store/apps/details?id=com.espressif.provble).
- [SoftAP Provisioning app on Play Store](https://play.google.com/store/apps/details?id=com.espressif.provsoftap).
- Source code on GitHub: [esp-idf-provisioning-android](https://github.com/espressif/esp-idf-provisioning-android).
* iOS:
- [BLE Provisioning app on app store](https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141)
- [SoftAP Provisioning app on app Store](https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630)
- Source code on GitHub: [esp-idf-provisioning-ios](https://github.com/espressif/esp-idf-provisioning-ios)
* For all other platforms a python based command line tool is provided under "$IDF_PATH/tools/esp_prov"

## Legacy Examples

The legacy examples require own implementation of provisioning functions and handlers. The Wi-Fi provisioning component abstracts out most of this complexity and provides a simpler interface and so, that is recommended for use. However, if you want to use lower level provisioning and protocomm APIs, you can check the these examples under legacy/ folder:

* softap_prov
Provisioning involves Wi-Fi station configuration via an HTTP server running on the device, which is initially configured to be in SoftAP mode. After provisioning, device runs in Wi-Fi station mode only and connects to the AP whose credentials were provided during provisioning.
Expand All @@ -14,10 +33,4 @@ These consist of the following examples :
* custom_config
Similar to softap_prov examples, but allows for configuration of custom (device-local) information during provisioning. This is intended as an example for implementing custom provisioning schemes.

Provisioning applications are available for various platforms:

* For Android, a provisioning application along with source code is available on GitHub : [esp-idf-provisioning-android](https://github.com/espressif/esp-idf-provisioning-android)
* For iOS, a provisioning application along with source code is available on GitHub : [esp-idf-provisioning-ios](https://github.com/espressif/esp-idf-provisioning-ios)
* For all other platforms a python based command line tool is provided under "$IDF_PATH/tools/esp_prov"

Refer to the README.md files in each example directory for more information.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# BLE based Provisioning Example
# BLE based Provisioning Example (Legacy)

> Note: It is recommended to use the new `wifi_prov_mgr` example which is based on the simpler `wifi_provisioning` APIs. Check this example only if you wish to use lower level provisioning and protocomm APIs and want more control over the handlers.
(See the README.md file in the upper level 'examples' directory for more information about examples.)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@ttfw_idf.idf_example_test(env_tag="Example_WIFI_BT")
def test_examples_provisioning_ble(env, extra_data):
# Acquire DUT
dut1 = env.get_dut("ble_prov", "examples/provisioning/ble_prov", dut_class=ttfw_idf.ESP32DUT)
dut1 = env.get_dut("ble_prov", "examples/provisioning/legacy/ble_prov", dut_class=ttfw_idf.ESP32DUT)

# Get binary file
binary_file = os.path.join(dut1.app.binary_path, "ble_prov.bin")
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Console based Provisioning Example
# Console based Provisioning Example (Legacy)

> Check this example only if you wish to use console based provisioning. For any real applications, it is recommended to use the new `wifi_prov_mgr` example which is based on the simpler `wifi_provisioning` APIs.
(See the README.md file in the upper level 'examples' directory for more information about examples.)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SoftAP + HTTPD based Provisioning Example featuring Custom configuration
# SoftAP + HTTPD based Provisioning Example featuring Custom configuration (Legacy)

> Note: It is recommended to use the new `wifi_prov_mgr` example which is based on the simpler `wifi_provisioning` APIs. Check this example only if you wish to use lower level provisioning and protocomm APIs and want more control over the handlers.
(See the README.md file in the upper level 'examples' directory for more information about examples.)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SoftAP + HTTPD based Provisioning Example
# SoftAP + HTTPD based Provisioning Example (Legacy)

> Note: It is recommended to use the new `wifi_prov_mgr` example which is based on the simpler `wifi_provisioning` APIs. Check this example only if you wish to use lower level provisioning and protocomm APIs and want more control over the handlers.
(See the README.md file in the upper level 'examples' directory for more information about examples.)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@ttfw_idf.idf_example_test(env_tag="Example_WIFI_BT")
def test_examples_provisioning_softap(env, extra_data):
# Acquire DUT
dut1 = env.get_dut("softap_prov", "examples/provisioning/softap_prov", dut_class=ttfw_idf.ESP32DUT)
dut1 = env.get_dut("softap_prov", "examples/provisioning/legacy/softap_prov", dut_class=ttfw_idf.ESP32DUT)

# Get binary file
binary_file = os.path.join(dut1.app.binary_path, "softap_prov.bin")
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tools/esp_prov/proto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ def _load_source(name, path):

# custom_provisioning component related python files generated from .proto files
custom_config_pb2 = _load_source("custom_config_pb2", idf_path +
"/examples/provisioning/custom_config/components/custom_provisioning/python/custom_config_pb2.py")
"/examples/provisioning/legacy/custom_config/components/custom_provisioning/python/custom_config_pb2.py")

0 comments on commit 156ae68

Please sign in to comment.