2022-05-20 09:50:08 +00:00
|
|
|
| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 |
|
|
|
|
| ----------------- | ----- | -------- | -------- | -------- |
|
|
|
|
|
2017-04-01 14:37:58 +00:00
|
|
|
# smartconfig Example
|
|
|
|
|
2018-08-29 12:48:16 +00:00
|
|
|
This example shows how ESP32 connects to a target AP with ESPTOUCH.
|
2017-04-01 14:37:58 +00:00
|
|
|
|
2018-08-29 12:48:16 +00:00
|
|
|
## How to use example
|
2017-04-01 14:37:58 +00:00
|
|
|
|
2018-08-29 12:48:16 +00:00
|
|
|
### Hardware Required
|
2017-04-01 14:37:58 +00:00
|
|
|
|
2022-05-20 09:50:08 +00:00
|
|
|
Download ESPTOUCH APP from app store:
|
2018-08-29 12:48:16 +00:00
|
|
|
[Android source code](https://github.com/EspressifApp/EsptouchForAndroid)
|
|
|
|
[iOS source code](https://github.com/EspressifApp/EsptouchForIOS) is available.
|
2017-04-01 14:37:58 +00:00
|
|
|
|
2018-08-29 12:48:16 +00:00
|
|
|
### Configure the project
|
|
|
|
|
|
|
|
```
|
2019-08-02 03:31:20 +00:00
|
|
|
idf.py menuconfig
|
2018-08-29 12:48:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Build and Flash
|
|
|
|
|
|
|
|
Build the project and flash it to the board, then run monitor tool to view serial output:
|
2017-04-01 14:37:58 +00:00
|
|
|
|
2018-08-29 12:48:16 +00:00
|
|
|
```
|
2019-08-02 03:31:20 +00:00
|
|
|
idf.py -p PORT flash monitor
|
2018-08-29 12:48:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
(To exit the serial monitor, type ``Ctrl-]``.)
|
|
|
|
|
|
|
|
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
|
|
|
|
|
|
|
|
## Example output
|
|
|
|
|
|
|
|
* Make sure your phone connect to the target AP (2.4GHz).
|
|
|
|
* Open ESPTOUCH app and input password. There will be success message after few sec.
|
2017-04-01 14:37:58 +00:00
|
|
|
|
|
|
|
Here is an example of smartconfig console output.
|
|
|
|
```
|
|
|
|
I (372) wifi: mode : sta (24:0a:c4:00:44:86)
|
|
|
|
I (422) smartconfig: SC version: V2.6.6
|
|
|
|
I (3802) wifi: ic_enable_sniffer
|
|
|
|
I (3802) sc: SC_STATUS_FIND_CHANNEL
|
|
|
|
I (234592) smartconfig: TYPE: ESPTOUCH
|
|
|
|
I (234592) smartconfig: T|PHONE MAC:68:3e:34:88:59:bf
|
|
|
|
I (234592) smartconfig: T|AP MAC:a4:56:02:47:30:07
|
|
|
|
I (234592) sc: SC_STATUS_GETTING_SSID_PSWD
|
|
|
|
I (239922) smartconfig: T|pswd: 123456789
|
|
|
|
I (239922) smartconfig: T|ssid: IOT_DEMO_TEST
|
|
|
|
I (239922) smartconfig: T|bssid: a4:56:02:47:30:07
|
|
|
|
I (239922) wifi: ic_disable_sniffer
|
|
|
|
I (239922) sc: SC_STATUS_LINK
|
|
|
|
I (239932) sc: SSID:IOT_DEMO_TEST
|
|
|
|
I (239932) sc: PASSWORD:123456789
|
|
|
|
I (240062) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
|
|
|
|
I (241042) wifi: state: init -> auth (b0)
|
|
|
|
I (241042) wifi: state: auth -> assoc (0)
|
|
|
|
I (241052) wifi: state: assoc -> run (10)
|
|
|
|
I (241102) wifi: connected with IOT_DEMO_TEST, channel 1
|
|
|
|
I (244892) event: ip: 192.168.0.152, mask: 255.255.255.0, gw: 192.168.0.1
|
|
|
|
I (244892) sc: WiFi Connected to ap
|
|
|
|
I (247952) sc: SC_STATUS_LINK_OVER
|
|
|
|
I (247952) sc: Phone ip: 192.168.0.31
|
|
|
|
I (247952) sc: smartconfig over
|
|
|
|
```
|