diff --git a/tools/esp_prov/README.md b/tools/esp_prov/README.md index b617f2a7c5..2528472c20 100644 --- a/tools/esp_prov/README.md +++ b/tools/esp_prov/README.md @@ -40,10 +40,11 @@ python esp_prov.py --transport < mode of provisioning : softap \ ble \ console > * `console` - for debugging via console-based provisioning * The client->device commands are printed to STDOUT and device->client messages are accepted via STDIN. * This is to be used when the device is accepting provisioning commands on UART console. + * `httpd` - the script works the same as for `softap`. This could be used on any other network interface than WiFi soft AP, e.g. Ethernet or USB. * `--service_name ` (Optional) - When transport mode is `ble`, this specifies the BLE device name to which connection is to be established for provisioned. If not provided, BLE scanning is initiated and a list of nearby devices, as seen by the host, is displayed, of which the target device can be chosen. - - When transport mode is `softap`, this specifies the HTTP server hostname / IP which is running the provisioning service, on the SoftAP network of the device which is to be provisioned. This defaults to `192.168.4.1:80` if not specified + - When transport mode is `softap` or `httpd`, this specifies the HTTP server hostname / IP which is running the provisioning service, on the SoftAP network (or any other interface for `httpd` mode) of the device which is to be provisioned. This defaults to `192.168.4.1:80` if not specified * `--ssid ` (Optional) - For specifying the SSID of the Wi-Fi AP to which the device is to connect after provisioning. diff --git a/tools/esp_prov/esp_prov.py b/tools/esp_prov/esp_prov.py index 567ac16719..5b1600f0a0 100644 --- a/tools/esp_prov/esp_prov.py +++ b/tools/esp_prov/esp_prov.py @@ -51,7 +51,7 @@ def get_security(secver, username, password, pop='', verbose=False): async def get_transport(sel_transport, service_name): try: tp = None - if (sel_transport == 'softap'): + if (sel_transport in ['softap', 'httpd']): if service_name is None: service_name = '192.168.4.1:80' tp = transport.Transport_HTTP(service_name) @@ -188,8 +188,8 @@ async def scan_wifi_APs(sel_transport, tp, sec): APs = [] group_channels = 0 readlen = 100 - if sel_transport == 'softap': - # In case of softAP we must perform the scan on individual channels, one by one, + if sel_transport in ['softap', 'httpd']: + # In case of softAP/httpd we must perform the scan on individual channels, one by one, # so that the Wi-Fi controller gets ample time to send out beacons (necessary to # maintain connectivity with authenticated stations. As scanning one channel at a # time will be slow, we can group more than one channels to be scanned in quick @@ -329,14 +329,14 @@ async def main(): parser.add_argument('--transport', required=True, dest='mode', type=str, help=desc_format( 'Mode of transport over which provisioning is to be performed.', - 'This should be one of "softap", "ble" or "console"')) + 'This should be one of "softap", "ble", "console" (or "httpd" which is an alias of softap)')) parser.add_argument('--service_name', dest='name', type=str, help=desc_format( 'This specifies the name of the provisioning service to connect to, ' 'depending upon the mode of transport :', - '\t- transport "ble" : The BLE Device Name', - '\t- transport "softap" : HTTP Server hostname or IP', + '\t- transport "ble" : The BLE Device Name', + '\t- transport "softap/httpd" : HTTP Server hostname or IP', '\t (default "192.168.4.1:80")')) parser.add_argument('--proto_ver', dest='version', type=str, default='',