Analysis of the principle of one-click configuration of esp8266

First, the ESP8266 chip overview

The ESP8266 is a complete and self-contained Wi-Fi network solution that can host software applications or offload all Wi-Fi network functions through another application processor.

The ESP8266 can be booted directly from an external flash memory when it is powered by an application and is the only application processor in the device. The built-in cache helps improve system performance and reduce memory requirements.

In another case, when the wireless Internet access is responsible for the Wi-Fi adapter, it can be added to any microcontroller-based design. The connection is simple and easy to use, only through the SPI/SDIO interface or central processing. The AHB bridge interface can be used.

The ESP8266's powerful on-chip processing and storage capabilities allow it to integrate sensors and other application-specific devices through the GPIO port, minimizing system resources during minimal up-front development and operation. The ESP8266 is highly integrated on-chip, including the antenna switch balun, power management converter, so only a small amount of external circuitry is required, and the entire solution, including the front-end module, minimizes PCB space during design.

The leading features of the ESP8266-equipped system include: fast switching between energy-saving VoIP in sleep/wake mode, adaptive radio biasing with low-power operation, front-end signal processing, troubleshooting, and radio system coexistence. Eliminate cellular/Bluetooth/DDR/LVDS/LCD interference.

Second, the application body of ESP8266

Smart power plug

Home automation

Mesh network

Industrial wireless control

Baby monitor

Web video camera

Sensor network

Wearable electronic sub-product

Wireless location aware device

Security ID tag

Wireless positioning system signal

Third, esp8266 one-key configuration principle analysis 1, remote control method

Method 1: Buy the server hardware yourself, build the Tencent server Baidu server center, etc. (convenient maintenance), and develop the server software itself. (very large enterprise)

Method 2: By renting Alibaba Cloud, you can write the software implementation of the server yourself. (Enterprise users, more difficult)

Method 3: Through some P2P platforms, penetration is achieved. But the domestic technology is relatively inaccurate. (used by a small number of companies)

Method 4: Implemented through a third-party platform, such as wit cloud. (Enterprise users and individual developers)

Method 5: Through the router's peanut shell technology analysis, the mapping process is realized. (amateurs)

It can be clearly seen from the above that for the average enterprise, to make the device network, from the perspective of cost, maintenance, cycle, etc., choose a solution such as wit cloud is one of the fastest, safe and reliable networking methods. .

2, one-button configuration works

1) The device enters the initialization state and starts listening to nearby WiFi packets.

2) After setting the WiFi name and password on the phone/tablet, send a UDP broadcast packet.

3) The device obtains the configuration information through the UDP packet (length), switches the network mode, connects to the home WiFi, and the configuration is completed.

Next, let's analyze the principle.

IoT smart item route: Intelligent hardware + APP + cloud

The APP will configure the wifi username and password of the route to enter the intelligent hardware. At present, each WIFI chip manufacturer basically adopts the following methods:

1) SmartConfig

2) AP mode: APP configures the mobile phone to connect to the intelligent hardware (AP of the WIFI chip) and builds it into a local area network. Of course, the local area network cannot access the Internet, but the communication of each device in the local area network is OK. At this time, there are generally three devices in the local area network (the WIFI chip works in the AP mode or the AP+STATION mode), and the mobile phone and the smart hard work in the STATION mode. SmartConfig is also called a one-click configuration, faster than AP mode, why? Please see below for decomposition.

The so-called SmartConfig is: the mobile APP sends a UDP broadcast packet or a multicast packet containing the WIFI username WIFI password; the WIFI chip of the smart terminal can receive the UDP packet, and as long as the UDP organization form is known, the received UDP can be received. The package decrypts the WIFI username and password; then the smart hardware is configured to the specified WIFI AP. The AP mode is not good. The configuration time is longer than smartconfig. The WIFI access point connected to the mobile phone will change. If the configuration is unsuccessful, the mobile phone cannot access the Internet. You need to manually configure WIFI to enable the mobile phone to access the Internet.

3, ESP8266 chip SDK two connection methods

1) smartconfig

Use UDP broadcast mode (UDP receiving IP address is 255.255.255.255) esp8266 first scan the AP, get the AP related information, such as the working channel, then configure the wifi chip to work on the channel just scanned to receive the UDP packet, if not received To continue, configure ESP8266 to work on another channel, and so on, until the UDP packet is received. Why do you need to perform WIFI AP under SCAN in advance?

Just to improve the efficiency of the configuration. Suppose there are only two APs in the current network, one AP works in CHANEL1, and the other ap works in channel13. We need to configure intelligent hardware to connect to AP2, which is channel13. If you do not scan ahead, you need to scan the time from 1--13. . Just need to pass from channel1-chane2---. . .channnel13 has been scanned all the time. If the AP is scanned, the chip will quickly get the UDP packet from AP CHANNNEL1 to channel13.

2) AP access

AP is an abbreviation for (Wireless) AccessPoint, which is a (wireless) access point. Simply speaking, it is like a wireless router. After the device is turned on, it enters AP mode. In the network list of the mobile phone, you can search for the name (SSID) similar to TPLINKXXX.

Aluminum Extrusion Radiator

Aluminum Extrusion Radiator,Led Heat Sink Aluminum,Heatsink Extrusion Profiles,Aluminium Heatsinks

Original Electronics Technology (Suzhou) Co., Ltd. , https://www.original-te.com

Posted on