ESP8266--smartconfig usage example

Table of contents

1. What is smartconfig used for?

2. The use process, here we take ESP-Touch as an example.

1. Download the ESP-Touch APP

2. View AT commands

3. Perform network distribution


 

1. What is smartconfig used for?

Imagine you have a temperature and humidity controller and can observe the temperature and humidity. Due to product upgrades, now you want to observe real-time temperature and humidity on the mobile phone or PC, so the first thing to consider is how to connect your temperature and humidity controller to the Internet?

Give a monitor and keyboard for user input? ——This is not realistic, the cost is too high, and the temperature and humidity controller itself does not need a display and keyboard

In order to solve this problem, smartconfig came into being.

Install a WiFi device on the temperature and humidity controller, and then enter the WiFi name and password on the mobile phone (the mobile phone must be connected to WiFi first), and through smartconfig, you can connect your temperature and humidity controller to your WiFi!

You can use the ESP-Touch APP on Espressif’s official website to experience smartconfig, or directly search for “Anxinke Technology” in WeChat, pay attention, click “Application Development” --> there is a WeChat distribution network in it. Both can achieve the purpose of one-click network configuration.

2. The use process, here we take ESP-Touch as an example.

1. Download the ESP-Touch APP

The ESP-Touch APP can be downloaded from Espressif’s official website, here is the link  https://www.espressif.com/en/support/download/apps  to download and install

Please refer to the ESP-TOUCH User Guide for a detailed introduction to Smartconfig    https://www.espressif.com/zh-hans/support/documents/technical-documents

2. View AT commands

Prepare an ESP8266 module and connect it with a serial port. Note: The ESP8266 firmware here must have the smartconfig function. Firmware download can refer to firmware download , this firmware already has smartconfig function.

First, let's observe the instructions about smartconfig in the AT instruction set

 

Note: After entering the smartconfig mode, other commands cannot be executed. If you want to execute other commands, you can send AT+CWSTOPSMART to end smartconfig, and then send other commands.

3. Perform network distribution

Enter something in the serial port:

//串口端输入的AT指令
AT+CWMODE=1
AT+RST
AT+CWSTARTSMART //开启smartconfig

Then use ESP-Touch, first connect the mobile phone to WiFi, open EspTouch, enter the password, device number, broadcast or multicast (it is all available here, but the sending method of UDP is different), and you will see the following information

//输入AT+CWSTARTSMART之后显示的信息
OK
WIFI DISCONNECT
smartconfig type:ESPTOUCH
Smart get wifi info
ssid:yongxing
password:12345678

You can see that the wifi information has been obtained. sssid is the WiFi name, and password is the WiFi password.

Using WeChat distribution network can achieve the same effect, and the operation method is the same.

 

Guess you like

Origin blog.csdn.net/guaizaiguaizai/article/details/113996958