1, hardware platform

I use Esp8266 NodeMcu(Esp-12s)
2, development environment
Arduino IDE
3, Development board model selection

4,AP pattern
#include <ESP8266WiFi.h> // This procedure uses ESP8266WiFi library const char *ssid = "Fle"; //
esp8266 Established wifi name const char *password = "gxd001213"; //esp8266 Established wifi password void
setup() { Serial.begin(9600); // Start serial communication WiFi.softAP(ssid, password); //
This sentence is the key .WiFi.softAP For startup NodeMCU of AP pattern . // There are two parameters in parentheses ,ssid yes WiFi name .password yes WiFi password . //
The specific contents of these two parameters are shown in setup Define the position before the function . Serial.print("Access Point: "); // Output information through serial port monitor
Serial.println(ssid); // Inform the user NodeMCU Established WiFi name Serial.print("IP address: "); //
as well as NodeMCU of IP address Serial.println(WiFi.softAPIP()); //
By calling WiFi.softAPIP() Available NodeMCU of IP address , Fixed as 192.168.4.1 } void loop() { }

5,STA pattern
#include <ESP8266WiFi.h> // This procedure uses ESP8266WiFi library const char* ssid = "Fle"; //
connect WiFi name ( Use mobile hotspot here Fle) const char* password = "gxd001213"; // connect WiFi password void setup(
) { Serial.begin(115200); // Start serial communication WiFi.begin(ssid, password); // Start network connection Serial
.print("Connecting to "); // Serial port monitor outputs network connection information Serial.print(ssid); Serial.println("
..."); // Inform the user NodeMCU Trying WiFi connect int i = 0; // This program statement is used to check WiFi Whether the connection is successful while (WiFi.
status() != WL_CONNECTED) { // WiFi.status() The return value of the function is NodeMCU of WiFi Determined by connection status . delay(
1000); // If WiFi If the connection is successful, the return value is WL_CONNECTED Serial.print(i++); Serial.print(' '); //
Pass here While Circular yield NodeMCU Check every second WiFi.status() Function return value } // meanwhile NodeMCU Read the connection time through the serial port monitor output .
// This second reading is through the variable i Self adding every second 1 To achieve . Serial.println(""); // WiFi After successful connection Serial.println(
"Connection established!"); // NodeMCU Will output through the serial port monitor " Connection successful " information . Serial.print("IP
address: "); // Also output NodeMCU of IP address . This function is achieved by calling Serial.println(WiFi.localIP()); //
WiFi.localIP() Function . The return value of this function is NodeMCU of IP address . } void loop() { }

If there is a situation of waiting all the time , hold AP The frequency band is changed to 2.4GHZ, seemingly Esp8266 I won't support it 5GHZ Frequency band .

Technology
©2019-2020 Toolsou All rights reserved,
Solve in servlet The Chinese output in is a question mark C String function and character function in language MySQL management 35 A small coup optimization Java performance —— Concise article Seven sorting algorithms (java code ) use Ansible Batch deployment SSH Password free login to remote host according to excel generate create Build table SQL sentence Spring Source code series ( sixteen )Spring merge BeanDefinition Principle of Virtual machine installation Linux course What are the common exception classes ?