Dual-protocol stack system used for IOT Wifi

By adopting dual protocol stack systems and Linux operating systems in IOT Wifi products, virtual Ethernet port devices and implementing cloud communication, the development difficulty and cost of existing IOT Wifi products in cloud platform migration and low-power operation is solved. , realizes low-cost and easy-to-develop solutions.

CN119277573AActive Publication Date: 2025-01-07HEFEI JUNZHENG TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310821953.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-01-07
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

Existing IOT Wifi products have problems such as difficult development, high cost and limited resources when migrating cloud platforms and running at low power consumption, especially due to the lack of protocol stack of main control and limited memory and storage resources, resulting in complex and increased portability.

Method used

Using a dual protocol stack system, the Ethernet port device that supports 802.3 protocol is virtualized through the IOT Wifi chip. The main control uses the Linux operating system and transmits audio and video streams with the main control chip through the SPI or SDIO interface to achieve the protection of the device and the cloud server. It also has the functions of equipment distribution network, account binding, cloud communication and OTA upgrade.

Benefits of technology

It realizes low-cost, easy-to-develop and easy-to-transfer IOT Wifi solutions, reducing the difficulty and cost of product development, while improving the product's low-power operation capability and the stability of cloud platform docking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277573A_ABST
    Figure CN119277573A_ABST
Patent Text Reader

Abstract

The invention provides a dual-protocol stack system for IOT Wifi, and the system comprises a main control chip which is a T31 type chip; the IOT Wifi chip is a chip of an MT7682 model number; the IOT Wifi chip serves as a traditional Wifi plug-in chip of the main control chip through an SPI or an SDIO, the system uses a dual-protocol stack mode, the IOT Wifi is virtualized into Ethernet port equipment supporting the 802.3 protocol on the main control chip side, the main control can have the own protocol stack, and due to the fact that the main control uses a Linux operating system which is an IPC product conventional system, the development difficulty is small, and the development cost is low. And the online reference data is rich and is easy to transplant, and the cloud platform and the mobile phone APP can be almost seamlessly connected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of wireless network applications, and in particular relates to a dual protocol stack system used by IOT Wifi. Background Art

[0002] Wifi can be simply understood as wireless Internet access. Almost all smartphones, laptops, and IPC cameras support Wifi Internet access, and it is the most widely used wireless network transmission technology today. With the advancement of the Internet of Things (IOT), people are quickly accustomed to the state of interconnection of all things. At present, IPC cameras have also become a must-have product for home anti-theft and elderly and baby care, and are increasingly recognized by the market. Low-cost, simple to develop, and simple to transplant wifi solutions are indispensable for IPC products.

[0003] At present, traditional IPC network camera products need to be powered by an external power cord, which makes the product inconvenient to install and has a low appearance. Therefore, battery-powered IPC products are increasingly recognized by users, such as battery doorbells, door locks, cat-eye cameras and other products. Battery-powered products have limited battery capacity, so low-power operation and low-power keep-alive are essential features of the product. Traditional low-power product solutions use three chip devices, such as Beijing Ingenic Integrated Circuit Co., Ltd. (referred to as Beijing Ingenic), such as T31 chip + MCU + wifi, but such solutions increase the cost of MCU chips. Therefore, IOTwifi with its own MCU module has more cost advantages, and only two chip devices, T31 chip + IOT wifi, are needed to achieve a low-power product solution.

[0004] However, most of the protocol stacks of products equipped with IOT Wifi currently run on the Wifi side. The main control has no protocol stack and transmits data to Wifi through a private protocol and then sends it out through the Wifi protocol stack. When cloud platform migration is required, IOT Wifi usually uses the RTOS operating system. However, there are relatively few software engineers specializing in this operating system, and there is relatively little parameter information online. Migration is very difficult, which leads to increased costs. In addition, the memory and flash storage on the Wifi side are relatively small, and the resources that can be accommodated are also limited.

[0005] In addition, common terms in the prior art include:

[0006] IOT: Internet of Things (IoT) is the "Internet of Everything Connected", which is an extension and expansion of the Internet. It combines various information sensing devices with the network to form a huge network, realizing the interconnection of people, machines and things at any time and any place.

[0007] Wifi: wireless network.

[0008] IPC: IP Camera, network camera.

[0009] Low-power camera: generally refers to an IPC that is battery-powered, has extremely low operating power consumption, and requires a fast startup function.

[0010] MT7682: One of the models of IOT wifi.

[0011] MCU: Microcontroller unit, also known as single-chip microcomputer.

[0012] Routine: It is a collection of functional interfaces or services provided by a system. For example, the API and services of the operating system are routines; the standard functions and library functions provided by Delphi or C++Builder are also routines. Summary of the invention

[0013] In order to solve the above problems, the purpose of this application is to use a dual protocol stack approach, where IOT Wifi is virtualized into an Ethernet port device that supports the 802.3 protocol on the Beijing Junzheng T31 model chip side, for example. The main control can have its own protocol stack. Since the main control uses the Linux operating system, which is a conventional system for IPC products, the development difficulty is small, there are abundant online reference materials, and the porting is simple, so the cloud platform and mobile phone APP can be almost seamlessly connected.

[0014] Specifically, the present invention provides a dual protocol stack system used by IOT Wifi, the system comprising:

[0015] The main control chip adopts a high-performance H.265 / H.264 / JPEG SoC chip, which integrates a high-performance ISP image processing module with a resolution of up to 2592*1920@30fps. At the same time, it integrates 128MB DDR memory internally, with a maximum main frequency of 1.5Ghz, and has complete peripheral interfaces required for applications, including USB, SDIO and Ethernet, which can be applied to a variety of network camera products; The IOT Wifi chip includes a microcontroller unit MCU, a low-power 1x11n single-band Wi-Fi subsystem and a power management unit PMU; The IOT wifi contains an ARM Cortex-M4 processor with a floating-point unit, which is integrated with 1MB of flash memory and is a highly integrated chipset; The Wi-Fi subsystem includes 802.11b / g / n radio, baseband and MAC for low-power and high-throughput application development; It also contains a 32-bit RISC CPU, which can completely unload the application processor; It also supports UART, I2C, SPI, I2S, PWM, SDIO and ADC interfaces;

[0016] The IOT Wifi chip is used as a traditional Wifi plug-in chip of the main control chip through SPI or SDIO. The main control chip maps the IOT Wifi chip to a network interface interface by loading the driver: z7682inf.ko, which is the same driver as the driver described below. The audio and video protocol stack of the main control chip is bound to this wifi interface to create an interface socket for network communication;

[0017] The main control chip and the IOT Wifi chip transmit audio and video streams via SPI or SDIO. The cloud server SDK is also run on the IOT Wifi chip to achieve keep-alive between the device and the cloud server, and has the functions of device network configuration, account binding, cloud communication, and OTA upgrade;

[0018] The virtual network port mapped on the main control chip side and the network port of IOT wifi, these two network ports have the same MAC and IP address to the outside, and the main control chip main control side data or the IOT Wifi chip side data are distinguished according to different ports;

[0019] The main control chip manages Wifi through an API interface and uses a private protocol to drive the internal encapsulation of the interface that data transmission relies on, including:

[0020] Z7682_IOTC_POWEROFF to control system power off,

[0021] Get the IOT Wifi version information Z7682_IOTC_FW_VERSION_READ (get MT7682 version information),

[0022] Z7682_IOTC_INT_MASK_READ for reading data,

[0023] Z7682_IOTC_INT_MASK_WRITE for writing data,

[0024] Read the interrupt wake-up event Z7682_IOTC_WKUP_INTF_READ, get the IOT Wifi IP information Z7682_IOTC_GET_IP_INFO (get MT7682 ip information), etc.

[0025] Communicate with the application layer of the IOT Wifi chip; the IOT Wifi chip distinguishes whether it is IP network data or private protocol data according to different custom packet headers, and performs corresponding processing or forwarding;

[0026] The main control chip is responsible for waking up event processing in the running state, and the IOT Wifi chip is responsible for function processing and keep-alive processing of peripherals in the sleeping state.

[0027] The event processing and low-power sleep-to-live products include: doorbells, door locks and cameras. Each time the device is started, the main control program needs to know what caused the main control to be awakened. At this time, the event wake-up reason can be read through the API. In addition, during the operation of the device, the event must be monitored in real time to handle triggered events at any time, such as key events.

[0028] The peripheral function processing and keep-alive processing, low-power doorbell and door lock products, in sleep mode, to ensure low power consumption and delay product battery life, the main control is powered off and cannot work, only WiFi works.

[0029] The bottom layer of the application layer of the main control chip and the IOT Wifi chip adopts either SDIO or SPI interface.

[0030] The IOT Wifi chip is responsible for peripheral function processing in the sleep state including PIR human infrared sensing, button wake-up, and remote wake-up package.

[0031] The system of the IOT Wifi chip adopts the FreeRTOS system, including network configuration, network data forwarding, and built-in MCU function configuration; peripherals including PIR human infrared sensing and doorbell buttons are connected to the built-in MCU of the IOT Wifi chip, and the MCU is used to process the function of waking up the peripheral device.

[0032] The IOT Wifi chip registers the Ethernet card driver on the main control chip, loads this driver on the main control chip, generates a network port with the interface name eth0, and uses the Linux common socket method for network communication; in addition, after loading this driver, a / dev / z7682 device node will be generated in the main control chip file system. If it is a main control of other models, this path is also used. The main control chip exchanges data with the IOT Wifi chip through this node ioctl command.

[0033] The network communication using the Linux common socket method includes: data interaction with the cloud server and data interaction with the mobile phone APP.

[0034] The application layer on the main control chip side sets the use of routine code, and the application programs link_listen.c and ioctl_test.c operate the / dev / z7682 device node and call ioctl to read information, including the following contents:

[0035] Network event capture: through the ioctl command, expressed as:

[0036] Z7682_IOTC_LISTEN_LINK_CHANGE, when the IOT Wifi chip successfully connects to WIFI, this command returns; this ioctl has a parameter in ms, the parameter means the timeout time, if the timeout occurs, it returns 0, if an error occurs, it returns a negative value;

[0037] The application writes a while loop to continuously monitor this event. When LINK_CHANGE is monitored, it means that the network situation has changed. Re-read the IP, DNS, MASK, MAC, DHCP, and Gateway network information, which is expressed as follows through the ioctl command:

[0038] Z7682_IOTC_GET_IP_INFO obtains the above network information and sets it to the main control chip through the system interface to complete the network configuration.

[0039] The system also includes: network port configuration:

[0040] The upper network data flow determines whether the data is transmitted to the IOT Wifi chip protocol stack or transparently to the main control chip according to the port number;

[0041] The port range setting of the IOT Wifi chip can be configured in the SDK of the IOT Wifi chip. The port range of the IOT Wifi chip protocol stack in the default SDK is 54000-60000.

[0042] The main control chip obtains the locally randomly allocated port range through cat / proc / sys / net / ipv4 / ip_local_port_range;

[0043] By setting the command echo'x y'> / proc / sys / net / ipv4 / ip_local_port_range, the port range can be modified to (x,y);

[0044] The main control chip will obtain the port range of the IOT Wifi chip when loading the IOT Wifi chip driver, and can also obtain this range by calling an API to read the value in the IOT Wifi chip virtual register REG_INVALID_PORT.

[0045] The main control chip adopts T31 chip, which has excellent image processing capability, extremely high encoding quality and extremely low encoding bit rate;

[0046] The IOT Wifi chip adopts the MT7682 model chip, and MT7682 also supports interfaces such as UART, I2C, SPI, I2S, PWM, SDIO and ADC.

[0047] Therefore, the advantages of this application are: this solution provides a low-cost, easy-to-develop, and easy-to-port IOT Wifi solution for low-power IPC products. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0049] Figure 1 It is a structural diagram of the application system.

[0050] Figure 2 It is a directory diagram of the implementation code involved in this application system.

[0051] Figure 3 This application system involves creating a z7682inf driver, and data interaction is done through a partial screenshot of the code of the z7682_misc_ioctl function.

[0052] Figure 4 This is a screenshot of the code part of the application system involving the application open` / dev / z7682` device node and calling ioctl to read information.

[0053] Figure 5 This is a screenshot of the code part of the application system that involves z7682_spi_cmd_cwr encapsulating the cmd buf format and transmitting the data to MT7682 through the spi data bus. DETAILED DESCRIPTION

[0054] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.

[0055] The specific implementation of this application solution is a dual protocol stack system used by IOT Wifi, such as Figure 1 As shown, taking the main chip using the Ingenic T31 chip (Beijing Ingenic Integrated Circuit Co., Ltd., hereinafter referred to as: Ingenic) and the IOT wifi using the specific model MT7682 chip as an example, the implementation and use instructions of the present invention are described in detail. The system includes:

[0056] The main control chip uses the T31 model chip: a high-performance H.265 / H.264 / JPEG SoC chip. The chip integrates a high-performance ISP image processing module with a resolution of up to 2592*1920@30fps, excellent image processing capabilities, extremely high encoding quality and extremely low encoding bit rate. At the same time, it integrates 128MB DDR memory with a maximum main frequency of 1.5Ghz. It has complete peripheral interfaces required for applications, including USB, SDIO and Ethernet, and can be applied to a variety of network camera products;

[0057] IOT Wifi chip, using MT7682: includes a microcontroller unit (MCU), a low-power 1x11n single-band Wi-Fi subsystem and a power management unit (PMU). The IOT wifi contains an ARMCortex-M4 processor with a floating point unit, integrated with 1MB of flash memory, and is based on a highly integrated chipset. The Wi-Fi subsystem contains 802.11b / g / n radio, baseband and MAC for low-power and high-throughput application development. It also contains a 32-bit RISC cpu that can completely unload the application processor. MT7682 also supports interfaces such as UART, I2C, SPI, I2S, PWM, SDIO and ADC;

[0058] The IOT Wifi chip (MT7682 model chip) is used as a traditional Wifi plug-in chip of the main control chip (T31 model chip) through SPI or SDIO. The main control chip (T31 model chip) loads the driver: z7682inf.ko. The corresponding driver is also the driver of the registered Ethernet card described below. This driver loaded on the main control chip (T31ZX) maps the IOT Wifi chip (MT7682 model chip) to a network interface interface. The audio and video protocol stack of the main control chip (T31 model chip) is bound to this wifi interface to create an interface socket for network communication;

[0059] The main control chip (T31 model chip) and IOT Wifi chip (MT7682 model chip) transmit audio and video streams through SPI or SDIO. The cloud server SDK is run on the IOT Wifi chip (MT7682 model chip) at the same time to achieve keep-alive between the device and the cloud server, and at the same time have device network configuration, account binding, cloud communication, and OTA upgrade functions;

[0060] The virtual network port mapped on the main control chip (T31 model chip) side and the network port of IOT wifi, these two network ports have the same MAC and IP address to the outside, and the main control chip (T31 model chip) main control side data or IOT Wifi chip (MT7682 model chip) side data are distinguished according to different ports;

[0061] The main control chip (T31 model chip) manages Wifi through the API interface and uses a private protocol to drive the internal encapsulation of the interface on which data transmission depends, such as: Z7682_IOTC_POWEROFF (control system power off), Z7682_IOTC_FW_VERSION_READ (obtain MT7682 version information), Z7682_IOTC_INT_MASK_READ (read data), Z7682_IOTC_INT_MASK_WRITE (write data), Z7682_IOTC_WKUP_INTF_READ (read interrupt wake-up event), Z7682_IOTC_GET_IP_INFO (obtain MT7682 ip information), etc., and communicates with the application layer of the IOT Wifi chip (MT7682 model chip); the IOT Wifi chip (MT7682 model chip) distinguishes whether it is IP network data or private protocol data according to different custom packet headers, and performs corresponding processing or forwarding;

[0062] The main control chip (T31 model chip) is responsible for waking up the event processing in the running state. For low-power dormant and live-keeping products, such as doorbells, door locks and cameras, each time the device is started, the main control program needs to know what caused the main control to be awakened. At this time, the event wake-up reason can be read through the API. In addition, during the operation of the device, the event must be monitored in real time to handle triggered events at any time, such as key events. The IOT Wifi chip (MT7682 model chip) is responsible for the function processing and live-keeping processing of peripherals in the dormant state. For low-power doorbell and door lock products, in the dormant state, in order to ensure low power consumption and delay the battery life of the product, the main control is in a power-off state and cannot work. Only wifi works.

[0063] That is, in the solution of T31 model chip (hereinafter referred to as: T31) + MT7682 model chip (hereinafter referred to as: MT7682), the MT7682 is used as the traditional wifi plug-in chip of T31 through SPI or SDIO. T31 maps MT7682 to an interface (network interface) through the corresponding driver, and the T31 audio and video protocol stack can be bound to this wifi interface to create a socket (network communication interface).

[0064] T31 and MT7682 transmit audio and video streams via SPI or SDIO. The cloud server SDK runs on MT7682 at the same time to achieve keep-alive between the device and the cloud server, and also has functions such as device network configuration, account binding, cloud communication, and OTA upgrade.

[0065] The virtual network port mapped on the T31 side and the IOT wifi network port have the same MAC and IP address to the outside world. The data on the T31 master side and the MT7682 side can be distinguished based on different ports.

[0066] T31 manages wifi through API interface and uses private protocol to communicate with MT7682 application layer. The underlying SDIO and SPI interfaces are optional. MT7682 distinguishes IP network data and private protocol data according to different custom packet headers, and processes or forwards them accordingly.

[0067] T31 is mainly responsible for waking up event processing in the running state, and MT7682 is mainly responsible for keep-alive processing in the sleep state, as well as peripheral function processing, such as: PIR human infrared sensing, button wake-up, remote wake-up package, etc.

[0068] like Figure 2 As shown, the implementation code of this application is described as follows:

[0069] Take Z7682_IOTC_FW_VERSION_READ to obtain MT7682 version information as an example to illustrate the implementation code:

[0070] 1. Create the z7682inf driver. All data interactions are done through the z7682_misc_ioctl function. Figure 3 shown.

[0071] 2. The application opens the ` / dev / z7682` device node and calls ioctl to read information, such as Figure 4 shown.

[0072] 3. After z7682_spi_cmd_cwr encapsulates cmd buf format, it transmits the data to MT7682 through spi data bus, such as Figure 5 shown.

[0073] 4. MT7682 parses the received cmd buf, performs corresponding operations, and returns corresponding data information.

[0074] MT7682_sdk is the MT7682 system code, which uses the FreeRTOS system and includes network configuration, network data forwarding, built-in MCU function configuration and other codes. Since only MT7682 is running at low power consumption in the low-power keep-alive state of the product, peripheral resources such as PIR human infrared sensor and doorbell button are connected to the built-in MCU of MT7682, and the MCU is used to process the function of waking up the peripheral device.

[0075] z7682_inf_t31 This part is the driver code for MT7682 to register the Ethernet card on T31. Loading this driver on T31 can generate a network port named eth0, and can use the Linux common socket method for network communication. For example: data interaction with cloud servers, data interaction with mobile phone APPs. In addition, after loading this driver, the / dev / z7682 device node will be generated in the T31 file system, and T31 can use this node ioctl command to interact with MT7682 for data.

[0076] z7682_user This part is the routine code used by the application layer on the T31 side. Through the application to operate the / dev / z7682 device node, call ioctl to read information, including the following: Network event capture: through the ioctl command Z7682_IOTC_LISTEN_LINK_CHANGE, when MT7682 successfully connects to WIFI, the command returns. This ioctl has parameters (in ms), which means the timeout time. If the timeout is exceeded, it returns 0, and if an error occurs, it returns a negative value. The application can write a while loop to continuously monitor this event. When LINK_CHANGE is monitored, it means that the network situation has changed. You can re-read IP, DNS, MASK, MAC, DHCP, Gateway and other information, and obtain the above network information through the ioctl command Z7682_IOTC_GET_IP_INFO, and set it to T31 through the system interface. The network configuration is completed.

[0077] Network port configuration: The upper network data flow determines whether the data goes through the MT7682 protocol stack or is transparently transmitted to T31 based on the port number. The port range setting on the MT7682 side can be configured in the MT7682 SDK. The default port range of the MT7682 protocol stack in the SDK is 54000–60000. On T31, you can get the locally randomly assigned port range through cat / proc / sys / net / ipv4 / ip_local_port_range. By setting the command echo'x y'> / proc / sys / net / ipv4 / ip_local_port_range, the port range can be modified to (x,y). The T31 side will obtain the port range of MT7682 when loading the MT7682 driver, or it can obtain this range by calling the API to read the value in the MT7682 virtual register REG_INVALID_PORT.

[0078] In summary, the IOT Wifi is registered as an Ethernet card on the T31ZX chip side and the T31 model chip transparently transmits data to the IOTWifi. The overall system of wifi network management solves the problems of the prior art very well.

[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A dual protocol stack system used in IOT Wifi, characterized in that: The system includes: a main control chip, which adopts a high-performance H.265 / H.264 / JPEG SoC chip, which integrates a high-performance ISP image processing module, with a resolution of up to 2592*1920@30fps, and an internal 128MB DDR memory with a maximum main frequency of 1.5Ghz. It has complete peripheral interfaces required for applications, including USB, SDIO and Ethernet, and can be applied to a variety of network camera products; an IOT Wifi chip, including a microcontroller unit MCU, a low-power 1x11n single-band Wi-Fi subsystem and a power management unit PMU; it contains an ARM Cortex-M4 processor with a floating-point unit, which is integrated with 1MB of flash memory and is a highly integrated chipset; the Wi-Fi subsystem includes 802.11b / g / n radio, baseband and MAC for low-power and high-throughput application development; it also contains a 32-bit RISC CPU, which can completely unload the application processor; it also supports UART, I2C, SPI, I2S, PWM, SDIO and ADC interfaces; The IOT Wifi chip is used as a traditional Wifi plug-in chip of the main control chip through SPI or SDIO. The main control chip maps the IOT Wifi chip to a network interface interface by loading the driver: z7682inf.ko. The audio and video protocol stack of the main control chip is bound to this wifi interface to create an interface socket for network communication; The main control chip and the IOT Wifi chip transmit audio and video streams via SPI or SDIO. The cloud server SDK is also run on the IOT Wifi chip to achieve keep-alive between the device and the cloud server, and has the functions of device network configuration, account binding, cloud communication, and OTA upgrade; The virtual network port mapped on the main control chip side and the network port of IOT wifi, these two network ports have the same MAC and IP address to the outside, and the main control chip main control side data or the IOT Wifi chip side data are distinguished according to different ports; The main control chip manages Wifi through an API interface and uses a private protocol to drive the internal encapsulation of the interface that data transmission relies on, including: Z7682_IOTC_POWEROFF to control system power off, Get the IOT Wifi version information Z7682_IOTC_FW_VERSION_READ, read data Z7682_IOTC_INT_MASK_READ, Z7682_IOTC_INT_MASK_WRITE for writing data, Read interrupt wake-up event Z7682_IOTC_WKUP_INTF_READ, Get the IOT Wifi IP information Z7682_IOTC_GET_IP_INFO, Communicate with the application layer of the IOT Wifi chip; the IOT Wifi chip distinguishes whether it is IP network data or private protocol data according to different custom packet headers, and performs corresponding processing or forwarding; The main control chip is responsible for waking up event processing in the running state, and the IOT Wifi chip is responsible for function processing and keep-alive processing of peripherals in the sleeping state.

2. The dual protocol stack system used in IOT Wifi according to claim 1, characterized in that: The bottom layer of the application layer of the main control chip and the IOT Wifi chip adopts either SDIO or SPI interface.

3. The dual protocol stack system used in IOT Wifi according to claim 1, characterized in that: The IOTWifi chip is responsible for peripheral function processing in the sleep state including PIR human infrared sensing, button wake-up, and remote wake-up package.

4. The dual protocol stack system used in IOT Wifi according to claim 1, characterized in that: The system of the IOTWifi chip adopts the FreeRTOS system, including network configuration, network data forwarding, and built-in MCU function configuration; peripherals including PIR human infrared sensing and doorbell buttons are connected to the built-in MCU of the IOT Wifi chip, and the MCU is used to process the function of waking up the peripheral device.

5. The dual protocol stack system used in IOT Wifi according to claim 1, characterized in that: The IOTWifi chip registers the driver of the Ethernet card on the main control chip, loads this driver on the main control chip, generates a network port with an interface name of eth0, and uses the Linux common socket method for network communication; in addition, after loading this driver, a / dev / z7682 device node will be generated in the main control chip file system, and the main control chip interacts with the IOT Wifi chip through this node ioctl command.

6. A dual protocol stack system for IOT Wifi according to claim 5, characterized in that: The network communication using the Linux common socket method includes: data interaction with the cloud server and data interaction with the mobile phone APP.

7. The dual protocol stack system used in IOT Wifi according to claim 1, characterized in that: The application layer on the main control chip side sets the use of routine code, and the application programs link_listen.c and ioctl_test.c operate the / dev / z7682 device node and call ioctl to read information, including the following contents: Network event capture: through the ioctl command, expressed as: Z7682_IOTC_LISTEN_LINK_CHANGE, when the IOT Wifi chip successfully connects to WIFI, this command returns; this ioctl has parameters, the unit is ms, the parameter means the timeout time, if the timeout is reached, it returns 0, if an error occurs, it returns a negative value; the application writes a while loop to continuously monitor this event, when LINK_CHANGE is monitored, it means that the network situation has changed, re-read the IP, DNS, MASK, MAC, DHCP, Gateway network information, through the ioctl command, it is expressed as: Z7682_IOTC_GET_IP_INFO obtains the above network information and sets it to the main control chip through the system interface to complete the network configuration.

8. The dual protocol stack system used in IOT Wifi according to claim 7, characterized in that: The system also includes: network port configuration: The upper network data flow determines whether the data is transmitted to the IOT Wifi chip protocol stack or transparently to the main control chip according to the port number; The port range setting of the IOT Wifi chip can be configured in the SDK of the IOT Wifi chip. The port range of the IOT Wifi chip protocol stack in the default SDK is 54000-60000. The main control chip obtains the locally randomly allocated port range through cat / proc / sys / net / ipv4 / ip_local_port_range; By setting the command echo'x y'> / proc / sys / net / ipv4 / ip_local_port_range, the port range can be modified to (x,y); The main control chip will obtain the port range of the IOT Wifi chip when loading the IOT Wifi chip driver, and can also obtain this range by calling an API to read the value in the IOT Wifi chip virtual register REG_INVALID_PORT.

9. The dual protocol stack system used in IOT Wifi according to claim 1, characterized in that: The high-performance H.265 / H.264 / JPEG SoC chip adopts the T31 model chip, that is, the main control chip adopts the T31 model chip, which has image processing capabilities, high encoding quality and low encoding bit rate; The IOT Wifi chip adopts the MT7682 model chip, and MT7682 also supports UART, I2C, SPI, I2S, PWM, SDIO and ADC interfaces.

10. A dual protocol stack system for IOT Wifi according to claim 1, characterized in that: The event processing refers to low-power sleep-to-live products including doorbells, door locks and cameras. Each time the device is started, the main control program needs to know what caused the main control to wake up. At this time, the event wake-up reason can be read through the API. In addition, during the operation of the device, the event must be monitored in real time to handle events including those triggered by key events at any time. The functional processing and keep-alive processing of the peripherals refer to the low-power sleep-alive product. In the sleep state, in order to ensure low power consumption and delay the battery life of the product, the main control is powered off and cannot work. Only the wifi works in a state of connection with the cloud server.

Citation Information

Patent Citations

  • Method for realizing unload protocol stack based on multi-core processor and hybrid operating system

    CN102571912A

  • Wireless protocol stack and realization method thereof

    CN107172139A

  • Two-Chip Co-Design And Co-Optimization In Three-Dimensional Integrated Circuit Net Assignment

    US20120198409A1

  • Receive-side scaling for wireless communication devices

    US20190045421A1