Laoganma's Notes - esp8266 is configured as a server _stm32

Finished in one sentence: use serial port 2 to send AT commands to esp8266 module configuration, AT command steps are as follows

1. AT+CWMODE=2     selects the mode as 2-AP mode (if 1 is Station mode, 3 is AP+Station mode, the configuration will remain after power off and restart);

2. AT+RST     restart the module;

3. AT+CWSAP = "DogZhou", "123456789", 6, 4    set AP mode parameters, DogZhou is the name of the WiFi hotspot, 123456789 is the password of the WiFi hotspot, 6 is the channel number (I don't know the purpose of setting this for now), 4 is WPA_WPA2_PSK encryption method, the configuration is retained after power off and restart;

4. AT+CIPAP = "192.168.5.1"    to set the IP address of AP mode, the configuration will be retained after power off and restart;

5. AT+CIPMUX=1 enables    multi-channel connection mode (0-single-channel connection mode, 1-multi-channel connection mode), only when AT+CIPMUX=1 can start the server;

6. AT+CIPSERVER=    1, 333 is configured as a server, 1-open server mode (0-close server mode), 333-port number, the default value is 333.

Understand the steps The next step is to send commands to esp8266 through serial port 2 of stm32, pay attention to the serial port baud rate configuration, the default baud rate of esp8266 is 115200, and the serial port is also configured to 115200, or you can first connect the module to the computer through the serial port, and use the serial port assistant to send Command AT+UART=9600,8,1,0,0 (<baud rate><data bit><stop bit> <check bit><flow control> ) to configure esp8266 serial port;


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325560955&siteId=291194637