Now is an era of interconnection of all things. Since the interconnection of all things is to be realized, the communication between various IoT devices is an unavoidable problem. The interfaces of our commonly used single-chip microcomputers, such as spi, i2c, uart, etc., are all wired connections, and the addressing and transmission protocols are relatively simple, which determines that their main scope of application is mainly board-level communication and transmission. In a wired connection, the network interface is the one that can achieve long-distance transmission. With the help of switching and transmission equipment such as routers, switches, and optical fibers in the Internet infrastructure, based on the complex TCP/IP protocol stack, mankind has built a huge Internet system, and has derived various applications from this system.
However, as more and more devices need to be connected to the network, and to further improve the online capabilities of the devices, wired communication alone can no longer meet the demand. Therefore, wireless communication technology is booming, and there are more common communication protocols, including wifi, bluetooth, zigbee, 2G, 3G, 4G, 5G and so on. These wireless communication protocols have their own technical advantages and disadvantages. At present, in addition to the networks covered by operators or mobile communication networks (2G, 3G, 4G, 5G, etc.), the most commonly used are wifi and Bluetooth communication technologies, which can be considered as short-range communication (or fixed wireless Communication) solutions are the best, such as our mobile phones are generally equipped with wifi and Bluetooth communication modules. Among them, wifi communication has a wider range of applications because of its natural ability to connect to the Internet.
Generally speaking, Wifi and Bluetooth communication technologies have their own advantages. The amount of data transmitted by wifi communication is relatively large, but the power consumption is high. The data transmission speed of Bluetooth is relatively slower, but the power consumption is low.
In addition, the range of Wifi coverage is wider than that of Bluetooth, and the coverage radius can reach 300m, which is certainly possible to use in homes and offices. With the development of wifi technology, some wifi networks can even cover the entire office building. Bluetooth is different, its coverage range is often only a dozen meters. In the frequency band, Bluetooth has been working in the 2.45Ghz frequency band; but Wifi currently has two frequency bands, one is the 2.4G frequency band and the other is the 5G frequency band. It can be seen from the above description that for wifi to achieve these functions, it must have strong wall penetration capabilities, but their working frequency bands are the same, so an important difference is that their power is different: The power of Wifi is relatively large, so it can penetrate walls. In terms of power consumption, designing a Bluetooth module with an effective transmission distance of 10m has a power consumption of only about 2.5mW. It is difficult to expect it to achieve the wall-through function.
However, the ultra-low power consumption of Bluetooth provides a very competitive advantage for its use in battery-powered scenarios. Therefore, the main communication method of many smart door locks is Bluetooth communication. Because the power consumption of Wifi communication is too high, it is generally not suitable for battery-powered scenarios.
Today we focus on analyzing the wifi module in the Internet of Things application. So the first problem we encounter here is why we are referring to modules instead of modules? What is the difference between a wifi module and a chip?
From the point of view of the name alone, the wifi module contains more things than the chip. What is the main thing that comes out? Generally speaking, it is mainly the realization of rf radio frequency module, memory chip and Wifi protocol stack. The development of RF radio frequency module requires relatively high signal quality and signal integrity. Of course, its development is more difficult and requires more equipment. This is a very high cost for small batch products or products that need to be shipped quickly. In addition, it is also a threshold for companies with weaker technical capabilities. Therefore, companies specializing in the production of modules have appeared on the market. They use their technical strength to package wifi chips + storage chips + radio frequency modules together to form a unified solution. Then, through commercial marketing and large-scale shipments, they can share their research and development costs and make a certain profit from it. This is a win-win solution for IoT developers and themselves. If the shipment volume of a certain product is indeed very large, after it has been verified by the market, its developers have the ability and motivation to choose to develop their own wifi modules, to further reduce costs or to make more distinctive solutions.
In fact, from a commercial point of view, it may be cheaper to use a universal wifi module because of its larger shipments. Furthermore, these general WiFi modules may have been tested in various actual scenarios in actual applications, and the manufacturers of the modules may have continuous product iterations, so its stability should be more reliable. Of course, these are based on choosing the right wifi module. If you choose the wrong product, it may be counterproductive.
So how do we use the wifi module? There are two ways here, one is to directly use the microcontroller inside the wifi module to realize the control and data acquisition functions, but the microcontroller inside the module is generally not so powerful and the number of pins is limited. , So this solution can only be used in scenarios with simple functions. Another one is that we choose the matching single-chip microcomputer according to the actual function requirements; the wifi module is only used as a transparent transmission tool. How to use it can be determined according to your actual situation.
Regardless of the different implementation methods, users of the wifi module generally can only use AT commands to operate the wifi module integrated in the module. When the developer refers to the module description and uses the AT command to operate the wifi module, the wifi module can perform the correct work according to the command, such as networking or something.
So what do we mean by transparent transmission? Under normal circumstances, our main control MCU and wifi module use UART communication. The main control MCU sends AT commands to our wifi through the UART interface. After the wifi module receives the commands, it will proceed according to the content of the AT commands. Already working. Therefore, on the surface, our wifi module does not seem to exist, just like we use the uart interface for networking operations. In this scenario, the wifi module can be understood as a transparent transmission module. Because of this way of use, we need to use two single-chip microcomputers, which is relatively expensive. But because we need to implement relatively complex functions, if the microcontroller inside the wifi module can’t achieve what we want, this is also a no-brainer.