Method and device for connecting Wi-Fi module with cloud server and intelligent equipment
Through the Wi-Fi module, it works in the access point + site coexistence mode, and uses mobile phones to transmit SSID and passwords, and realizes fast cloud server connection without external input interface, solving the compatibility of IoT devices when connecting to cloud servers and Cost issues, improve connection speed and stability, suitable for a variety of devices.
Patent Information
- Application Number
- CN202410772090.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-01-16
- Filing Date
- 2024-06-16
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing IoT devices have compatibility, signal monitoring, time-consuming and cost limitations when connecting to cloud servers. Especially in the absence of external input interfaces, it is difficult to achieve rapid connection between Wi-Fi modules and target routers. .
Using Wi-Fi modules to work in access point + site coexistence mode, transmit the SSID and password of the target router through the mobile phone, realize quick connection without external input interface, avoiding the dependence of NFC or BLE modules, and simplifying the user operation process .
Improves connection speed and stability, reduces costs, is suitable for a variety of operating systems and smart devices, simplifies user operations, supports multi-device management and remote control, and improves user experience and device ease of use.
Smart Images

Figure CN119012415A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for connecting a Wi-Fi module to a cloud server, and also relates to a corresponding device and a smart device including the device, belonging to the technical field of Internet of Things. Background Art
[0002] With the rapid development of IoT technology, smart home appliances and smart home products have been widely integrated into our daily lives. As the carrier of the application layer of the IoT system, these devices have a basic and key functional requirement to connect to the cloud server. At present, IoT devices are mainly connected to the Internet in two ways: one is through the input interface, and the other does not require an input interface. Specific technologies include AirKiss network configuration technology, NFC network configuration technology, BLE network configuration technology, EasyConnect network configuration technology, and AP function network configuration technology.
[0003] Although existing technologies provide a variety of networking methods, they each have some limitations. For example, AirKiss networking technology performs poorly in terms of compatibility, signal monitoring, time consumption, and failure rate. NFC networking technology requires a built-in NFC chip, which increases costs. BLE networking technology also requires a built-in BLE module, which also increases costs. EasyConnect networking technology has problems with compatibility and connection time consumption, while AP function networking technology requires confirmation of the connection status through a cloud server, which increases the complexity and time consumption of the connection process.
[0004] Faced with these challenges, the IoT field urgently needs a new method for Wi-Fi modules to connect to cloud servers to solve the problems existing in existing technologies. The ideal solution should be able to provide a fast, stable and cost-effective way to connect to the Internet, while having good compatibility to adapt to different brands and types of smart devices. In addition, the method should also simplify user operations and improve the success rate of connection, especially in the absence of an external input interface, to achieve a fast connection between the Wi-Fi module and the target router. Summary of the invention
[0005] The primary technical problem to be solved by the present invention is to provide a method for connecting a Wi-Fi module to a cloud server.
[0006] Another technical problem to be solved by the present invention is to provide a device for connecting a Wi-Fi module to a cloud server.
[0007] Another technical problem to be solved by the present invention is to provide an intelligent device including the above-mentioned device.
[0008] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0009] According to a first aspect of an embodiment of the present invention, a method for connecting a Wi-Fi module to a cloud server is provided, wherein the Wi-Fi module has no external input interface, and the method comprises the following steps:
[0010] Step S1: After the Wi-Fi module is powered on and starts up, it enters the access point + site state;
[0011] Step S2: The mobile phone connects to the Wi-Fi module as a station and transmits the SSID and password of the target router to the Wi-Fi module;
[0012] Step S3: After the Wi-Fi module obtains the SSID and password of the target router, it connects to the target router in STA mode to determine whether the connection is successful. If not, the SSID and password of the target router obtained in step S2 are cleared, and then the next station is waited for to connect. If successful, it proceeds to step S4;
[0013] Step S4: After the Wi-Fi module is successfully connected to the target router, it connects to the cloud server through the target router, and then the Wi-Fi module notifies the mobile phone that the connection is successful in AP mode;
[0014] Step S5: The Wi-Fi module works in AP mode, and receives and executes commands from the target router and station at the same time; if no command is received within a timeout period, the module is powered off.
[0015] Preferably, when the Wi-Fi module works in AP mode and STA mode, different MAC addresses are used respectively.
[0016] Preferably, in the access point + site state, the Wi-Fi acts as an access point to broadcast its own wireless network on the one hand, and acts as a site to connect to another wireless network to upload and communicate data on the other hand.
[0017] Preferably, between step S1 and step S2, the following is further included:
[0018] The Wi-Fi module reads the configuration table to determine whether it has been connected to the target router. If it is determined to be yes, the Wi-Fi module reads the SSID and password of the target router in the configuration table and then enters step S3. If it is determined to be no, it enters step S2.
[0019] Preferably, the step S2 specifically includes:
[0020] The mobile phone is connected to the Wi-Fi module in AP mode as a station to determine whether the connection is successful within the specified time. If it is judged to be yes, the mobile phone transmits the SSID and password of the target router to the Wi-Fi module. If it is judged to be no, it enters step SS: determine whether the mobile phone and the Wi-Fi module are successfully connected within the specified time.
[0021] Preferably, step S3 specifically includes:
[0022] If the connection fails, the SSID and password of the target router obtained in step S2 are cleared, and the mode is switched to AP mode and the process returns to step S22.
[0023] When the next mobile phone establishes a connection with the Wi-Fi module, step S3 is entered again to obtain the SSID and password of the target router.
[0024] Preferably, step S4 specifically includes:
[0025] After the Wi-Fi module is successfully connected to the target router, the target router is connected to the cloud server. After the connection is successful, the target router notifies the Wi-Fi module in site mode that it has successfully connected to the cloud server. The Wi-Fi module notifies the mobile phone in AP mode that it has successfully connected to the target router and the cloud server.
[0026] According to a second aspect of an embodiment of the present invention, there is provided a device for connecting a Wi-Fi module to a cloud server, comprising a Wi-Fi module, wherein the Wi-Fi module is used to implement the aforementioned method.
[0027] According to a third aspect of an embodiment of the present invention, a smart device is provided, which includes the aforementioned device for connecting the Wi-Fi module to a cloud server.
[0028] Compared with the prior art, the present invention provides a method for quickly connecting a Wi-Fi module to a cloud server without an external input interface. The method simplifies the networking process of smart devices through the access point + site coexistence mode, significantly improving the connection speed and stability. At the same time, since it does not rely on specific technical modules, it has wide compatibility and is suitable for a variety of operating systems and smart devices. The method also reduces costs because it avoids the need for built-in NFC or BLE modules and improves user experience by simplifying the user operation process. In addition, it supports the management of multiple smart devices through a single target router, facilitates system expansion, and allows users to achieve remote control through mobile phone APP, increasing the convenience of operation. Through these technical means, the present invention not only improves the ease of use and user satisfaction of smart devices, but also provides strong support for the widespread application and rapid deployment of Internet of Things devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A flow chart of a method for connecting a Wi-Fi module to a cloud server provided by an embodiment of the present invention;
[0030] Figure 2 A working state diagram of a device for connecting a Wi-Fi module to a cloud server provided by an embodiment of the present invention;
[0031] Figure 3 An example diagram of a smart device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The technical content of the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] The method for connecting a Wi-Fi module to a cloud server provided by an embodiment of the present invention allows the Wi-Fi module to start the AP (access point) and STA (station) coexistence function after power-on without any external input interface. The Wi-Fi module first reads the configuration table to determine whether the parameters for connecting to the target router have been stored. If the existing connection parameters are detected, the Wi-Fi module will use these parameters to directly establish a connection with the target router. If the connection parameters are not stored, the Wi-Fi module will wait for the mobile phone to connect in AP mode within the specified time. Once the mobile phone is successfully connected, the Wi-Fi module will obtain the SSID and password of the target router. Subsequently, the Wi-Fi module uses the STA mode to establish a connection with the target router. After the connection is successful, it connects to the cloud server through the target router, sends a successful connection signal to the mobile phone, and saves the configuration information to the configuration table. Using the above method, the Wi-Fi module is connected to the target router quickly, stably and efficiently without an external input interface, with fast connection speed and good compatibility. Under normal conditions, there is basically no failure to connect to the target router.
[0034] like Figure 1 As shown, the method for connecting a Wi-Fi module to a cloud server provided by the first embodiment of the present invention specifically includes the following steps:
[0035] Step S1: After the Wi-Fi module is powered on and starts up, it enters the access point + station coexistence state.
[0036] The above steps are the initial stage of the method for the Wi-Fi module to connect to the cloud server. The core is that the Wi-Fi module enters the coexistence state of AP (access point) and STA (station) immediately after power-on. In this state, the Wi-Fi module can play the role of wireless network provider and connector at the same time. Specifically, the Wi-Fi module first configures the network parameters, including setting the local IP address, gateway, subnet mask and remote IP address, and also configures the corresponding parameters on the AP side to ensure that other devices such as mobile phones or computers can correctly provide and join the wireless network.
[0037] Next, the Wi-Fi module will initialize the network connection, including establishing AP mode and setting the network name (SSID) and password, allowing other devices such as mobile phones or computers to connect to the Wi-Fi module. In addition, the Wi-Fi module will also set the local port and remote port to facilitate the reception and transmission of data. During this process, the Wi-Fi module will also make necessary security settings and use appropriate encryption standards to protect the security of the network connection.
[0038] Finally, the Wi-Fi module will enter the listening state, waiting for connection requests from other devices and responding to these requests. At the same time, the Wi-Fi module will initialize the baud rate, disconnect any existing connections, and ensure that it restarts in the access point + station state. This lays the foundation for the connection of the Wi-Fi module to the target router and the communication with the cloud server in the subsequent steps. Through this series of initialization and configuration operations, the Wi-Fi module provides the technical prerequisite for the fast and stable connection of smart devices.
[0039] It should be noted that the access point + station state is a working state of the Wi-Fi module, which allows the Wi-Fi module to have the functions of AP (access point) and STA (station) at the same time. In this mode, the Wi-Fi module can realize dual roles: on the one hand, as an access point, it can broadcast its own wireless network, allowing other devices such as mobile phones or computers to connect to this network; on the other hand, as a station, it can connect to another wireless network, such as a target router or upper server, in order to upload and communicate data. This dual role capability greatly enhances the flexibility and application scope of the Wi-Fi module.
[0040] In addition, when the Wi-Fi module works in AP mode and STA mode, it uses different MAC addresses. This means that in AP mode, the MAC address seen by other devices such as mobile phones or computers when connected to the Wi-Fi module is inconsistent with the MAC address of the Wi-Fi module seen by the target router or server in STA mode. This address distinction is critical for network management and data routing, ensuring correct communication and device identification in different network environments. Therefore, when designing and implementing the access point + station state, this MAC address difference must be taken into account to ensure the correctness and stability of the network connection.
[0041] In one embodiment of the present invention, the access point+station coexistence mode is implemented by the following sub-steps:
[0042] Step S101: Set the local IP, gateway, subnet mask, and lower remote IP;
[0043] Step S102: Set the AP IP, gateway, subnet mask, and upper remote IP;
[0044] Step S103: Setting the local port and the remote port;
[0045] Step S104: Setting the name and password for connecting to the remote AP;
[0046] Step S105: Setting the name and password of the AP;
[0047] Step S106: Setting a sending and receiving buffer;
[0048] Step S107: Initialize the baud rate;
[0049] Step S108: Disconnect (prevent connection) WiFi.disconnect();
[0050] Step S109: Set to access point + station state WiFi.mode (WiFi_AP_STA);
[0051] Step S110: Setting AP network parameters WiFi.softAPConfig();
[0052] Step S111: Set AP account and password WiFi.softAP();
[0053] Step S112: Connect to the designated router WiFi.begin();
[0054] Step S113: Setting local network parameters WiFi.config();
[0055] Step S114: Waiting for routing connection, the corresponding pseudo code example is as follows:
[0056] Serial.println("pleasewait")WiFi.status()! =WL_CONNECTED;
[0057] Step S115: Establish UDP Server and listen to the specified port udp.begin(localPort);
[0058] Step S116: Display the IP address WiFi.localIP() WiFi.softAPIP();
[0059] Step S117: Read data. The corresponding pseudo code example is as follows:
[0060] udp.read(buff, 255) udp.beginPacket(serverip, remoteport) udp.write(buff, 255) udp.endPacket();
[0061] Step S118: Clear buffer data memset(buff, 0, 255).
[0062] In general, implementing the AP (access point) + STA (station) coexistence mode involves a series of detailed network configuration and initialization steps. First, the network parameters need to be set, including the local IP address, gateway, subnet mask, and remote IP address configuration to ensure that the Wi-Fi module can correctly communicate with other devices in the network. At the same time, the IP address and related network parameters of the AP side, as well as the local and remote port numbers, need to be set to establish a channel for data transmission.
[0063] Next, the above steps emphasize the consideration of network security, including setting the username and password to connect to the remote AP, as well as the network name and password used when establishing the AP, which provides basic access control for the access point. In addition, in order to ensure the efficiency and stability of data transmission, it also involves the setting of the transmit and receive buffers and the initialization of the baud rate.
[0064] During the configuration process, it is important to note that in order to avoid conflicts with existing connections, you need to disconnect any existing Wi-Fi connections first. After that, set the Wi-Fi module to access point + station status through specific function calls, and then configure the AP network parameters and account password to complete the establishment of the AP. In addition, you also need to connect to the specified target router through the Wi-Fi.begin() function and configure the local network parameters.
[0065] While waiting for the router to connect, ensure that the device can wait correctly when it is not connected to the network by printing prompt information and checking the Wi-Fi.status() status. Once the connection is established, the next step is to establish a UDP server and listen to the specified port, which provides the basis for communication between devices. Displaying the IP address and the IP address of the soft AP provides the necessary information for identification and communication between devices.
[0066] Finally, to ensure the accuracy of data transmission, the buffer data needs to be cleared after reading the data to prevent old data from interfering with new data transmission. These steps together ensure that the Wi-Fi module can operate stably in AP mode and STA mode, achieving efficient data exchange and network services.
[0067] Step S2: The Wi-Fi module obtains the SSID and password of the target router through the access point + station coexistence state;
[0068] The method for obtaining the SSID and password of the target router comprises at least the following sub-steps:
[0069] S21: The Wi-Fi module reads the configuration table to determine whether it has been connected to the target router.
[0070] The configuration table is a functional module in the Wi-Fi module that stores the SSID and password of the target router that has been connected, and is usually implemented using a Flash memory.
[0071] If the target router has been connected, go to step S3; if the target router has not been connected, go to step S22.
[0072] S22: The mobile phone connects to the Wi-Fi module (in AP mode) as a station to determine whether the connection is successful within a specified time.
[0073] If the connection fails within the specified time, the power is turned off; if the connection is successful within the specified time, the mobile phone manually enters the SSID and password of the target router on the APP and sends it to the Wi-Fi module, and enters step S3.
[0074] Among them, because the Wi-Fi module does not have any external input interface, the above method successfully solves the problem of connecting the Wi-Fi module to the target router in this scenario. In addition, the above method does not add NFC, Bluetooth or other technical modules, and solves the problem of connecting the Wi-Fi module to the target router without increasing the cost of the Wi-Fi module.
[0075] In this step, if the Wi-Fi module fails to connect to the mobile phone within the specified time, it means that no mobile phone is configuring the Wi-Fi module, so the power is turned off and the phone is powered on next time.
[0076] The technical key of step S2 focuses on how the Wi-Fi module obtains the SSID and password of the target router through the access point + station coexistence state. First, the Wi-Fi module reads the internal configuration table to identify whether the connection information of the target router has been stored. The configuration table is usually implemented using an external memory, which can save the SSID and password of the target router that the Wi-Fi module has connected to. This process is automated, reducing the complexity of user operations.
[0077] If the Wi-Fi module detects that the connection information of the target router has been stored, it will directly use this information to connect and enter step S3. However, if the relevant information is not stored in the Wi-Fi module, it will enter step S22. In S22, the user needs to use the mobile phone as a site to establish a connection with the Wi-Fi module. This step requires the connection to be completed within the specified time. If the connection fails, the Wi-Fi module will perform a power-off operation and wait for the next power-on to try again. If the connection is successful, the user needs to manually enter the SSID and password of the target router on the mobile phone APP and send this information to the Wi-Fi module so that the Wi-Fi module can establish a connection with the target router.
[0078] It is worth noting that since the Wi-Fi module does not have an external input interface, this step receives the SSID and password input by the user wirelessly, which cleverly solves the input problem. In addition, this step avoids the use of NFC, Bluetooth or other technical modules that may increase costs, maintaining the economy of the Wi-Fi module.
[0079] When implementing step S2, special attention should be paid to several key points. First, ensure that the configuration table of the Wi-Fi module can reliably store and read the connection information. Secondly, a reasonable time limit needs to be set to determine whether the connection is successful and decide the next step accordingly. In addition, the design of the user interface (such as mobile phone APP) should be simple and intuitive so that users can easily enter the SSID and password. Finally, throughout the process, all communications should be ensured to be secure to prevent sensitive information from being intercepted or tampered with during transmission.
[0080] Step S3: After the Wi-Fi module obtains the SSID and password of the target router, it connects to the target router in station (STA) mode to determine whether the connection is successful.
[0081] Among them, because the Wi-Fi module is in the access point + site coexistence state at this time, it can be directly connected to the target router in site mode without switching from AP state to site state.
[0082] If the connection fails, the SSID and password of the target router obtained in step S2 are cleared, and the next site connection is awaited; if the connection is successful, step S4 is entered.
[0083] Specifically, if the connection fails, the SSID and password of the target router obtained in step S2 are cleared, and the AP mode is switched to return to step S22. When the next station (mobile phone) establishes a Wi-Fi connection with the Wi-Fi module, step S3 is entered again to obtain the SSID and password of the target router.
[0084] Step S3 is the key step for the Wi-Fi module to connect to the target router. The technical point is that after the Wi-Fi module obtains the SSID and password of the target router, it uses the STA mode to attempt to connect. In the access point + site coexistence state, the Wi-Fi module can maintain its own AP service while trying to connect to other wireless networks as sites. The advantage of this state is that the Wi-Fi module does not need to switch between AP and STA modes, which simplifies the connection process and improves efficiency.
[0085] During the implementation process, it is first necessary to ensure that the Wi-Fi module can correctly parse and use the SSID and password information obtained from step S2. Then, the Wi-Fi module will try to establish a connection with the target router. If the connection attempt fails, the Wi-Fi module will execute an error handling mechanism: clear the previously obtained SSID and password information, and automatically switch back to AP mode, waiting for the next device (such as a mobile phone or computer) to connect. In this process, the stability and error recovery capabilities of the Wi-Fi module are crucial to ensure that it can be quickly and correctly reset when the connection fails.
[0086] In addition, when the Wi-Fi module successfully connects to the target router as a site, it will automatically enter step S4 to perform subsequent cloud server connection operations. The success of this step not only depends on the correct network parameters, but also requires the Wi-Fi module to have good network compatibility and stable connection performance. Therefore, developers need to conduct detailed tests on the network connection logic of the Wi-Fi module to ensure stable operation in various network environments.
[0087] In terms of precautions, first of all, it is necessary to ensure that the configuration information of the Wi-Fi module is accurate. Any configuration error may cause the connection to fail. Secondly, the connection attempt of the Wi-Fi module should have a clear time limit and retry mechanism to avoid waiting for a response indefinitely. Thirdly, in the case of connection failure, the Wi-Fi module should be able to provide clear error messages to facilitate troubleshooting by users or system administrators. Finally, ensure the security of data transmission during the entire connection process, and use appropriate encryption and authentication mechanisms to prevent the leakage of sensitive information.
[0088] Step S4: After the Wi-Fi module is successfully connected to the target router, it connects to the cloud server through the target router, and then the Wi-Fi module notifies the mobile phone of the successful connection in AP mode, and saves the SSID and password of the target router to the configuration table;
[0089] Among them, the Wi-Fi module notifies the mobile phone of the successful connection in AP mode, eliminating the need for the mobile phone to connect to the cloud server, thereby solving the problem of time-consuming status confirmation due to the mobile phone connecting to the cloud server.
[0090] Step S4 is a key operation step after the Wi-Fi module successfully connects to the target router. The technical point is that the Wi-Fi module further connects to the cloud server through the target router and sends a successful connection signal to the mobile phone through the AP mode. The core of this step is to ensure that the Wi-Fi module can not only establish a connection with the local network, but also successfully access the remote cloud server to achieve remote management and control of data.
[0091] In the implementation process, once the Wi-Fi module successfully connects to the target router as a station, it will automatically try to establish a communication link with the cloud server using the network connection capabilities of the target router. This design utilizes the network capabilities of the target router and avoids the delays and complexities that may be caused by direct communication between the mobile phone and the cloud server, thereby speeding up the status confirmation and improving the overall connection efficiency.
[0092] At the same time, after the Wi-Fi module is successfully connected, it will send a notification to the mobile phone in AP mode to inform the user that the connection has been successfully established. This instant feedback mechanism is crucial to the user experience because it provides clear operation results and enables users to understand the status of the device in a timely manner.
[0093] In addition, after the Wi-Fi module completes the connection, it also needs to save the SSID and password of the target router into the configuration table. This operation not only facilitates future automatic connections, but also ensures that even after the Wi-Fi module is powered off and restarted, it can still remember and automatically connect to the correct network, improving the reliability of the device and the convenience of user use. When implementing this step, it is necessary to consider the security and persistence of storage to ensure that the configuration information will not be lost due to abnormal circumstances.
[0094] Step S5: The Wi-Fi module works in AP mode, and receives and executes commands from the target router and station at the same time; if no command is received within a timeout period, the module is powered off.
[0095] Step S5 is the stable operation stage of the Wi-Fi module after completing the connection to the cloud server. The technical point is that the Wi-Fi module continues to work in AP mode, receiving and executing instructions from the target router and site. This step ensures that the Wi-Fi module can not only achieve the initial network connection, but also maintain communication with the user device, respond to its control instructions, and realize the functions of the smart device.
[0096] At the same time, the timeout power-off mechanism mentioned in step S5 is an important power management function. If the Wi-Fi module does not receive any instructions within a certain period of time, it will automatically power off and enter a low-power or sleep state. This not only helps save energy, but also reduces the power consumption of the device when there is no activity, extending the service life of the device.
[0097] like Figure 2 As shown, the second embodiment of the present invention provides a device for connecting a Wi-Fi module to a cloud server, including a Wi-Fi module. The method for the device to connect the Wi-Fi module to the cloud server is the same as the method described in the first embodiment of the present invention, which will not be repeated here.
[0098] like Figure 3 As shown, the third embodiment of the present invention provides an intelligent device, which includes the device provided by the second embodiment of the present invention (specifically, it can be implemented by a processor). The intelligent device includes at least a processor and a memory, and can further include a communication component, a sensor component, a power component, a multimedia component and an input / output interface according to actual needs. Among them, the memory, the communication component, the sensor component, the power component, the multimedia component and the input / output interface are all connected to the processor. The memory can be a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, etc., and the processor can be a central processing unit (CPU), a graphics processing unit (GPU), a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a digital signal processing (DSP) chip, etc. Other communication components, sensor components, power components, multimedia components, etc. can all be implemented using general components, which will not be specifically described here. The method for the intelligent device to realize the connection of the Wi-Fi module to the cloud server is the same as the method described in the first embodiment of the present invention, which will not be repeated here.
[0099] The method for connecting a Wi-Fi module to a cloud server provided in an embodiment of the present invention provides a fast, stable and highly compatible network configuration solution for smart home appliances. When the smart home appliance is installed and powered on for the first time, the Wi-Fi module automatically enters AP mode, establishes a connection with the user's mobile phone, and enters the SSID and password of the target router through the intuitive mobile phone APP interface. This step not only simplifies the configuration process, but also greatly improves the user experience by eliminating the need for manual input, especially for user groups who are not familiar with technical operations, such as the elderly.
[0100] After the initial configuration is completed, the Wi-Fi module switches to STA mode, establishes a connection with the target router using the information input by the user, and further connects to the cloud server. The method of the present invention has a high degree of compatibility and supports connections with a variety of cloud service providers, including but not limited to Alibaba Cloud, Baidu Cloud, Telecom Cloud, etc., avoiding the limitation that smart home appliances can only connect to specific cloud networks, thereby improving the versatility and applicability of smart home appliances.
[0101] In addition, the above method supports easy expansion and remote control of smart home appliances through cloud server control. Since the target router can manage the connection of multiple devices at the same time, the present invention takes advantage of this feature to allow multiple smart home appliances to connect and operate the cloud server through a single target router, which is particularly useful for users with multiple smart devices in the home. At the same time, the network connection of the target router is usually more stable than the Wi-Fi connection of a single device, which further improves the user experience.
[0102] Once the first mobile phone completes the connection to the cloud server of the smart home appliance, the user can remotely control it through the mobile phone APP. Moreover, when other smart devices in the home are connected to the Wi-Fi module, the Wi-Fi module can automatically read the SSID and password of the target router, complete the network configuration, and realize the connection to the cloud server. This design is not only convenient for users, but also enables all smart devices in the home to seamlessly access the cloud server and enjoy the convenience and efficiency brought by the present invention.
[0103] It should be noted that the above-mentioned multiple embodiments are only examples, and the technical solutions of the various embodiments can be combined, all within the scope of protection of the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0104] The above is a detailed description of the method, device and smart device for connecting the Wi-Fi module to the cloud server provided by the present invention. For those skilled in the art, any obvious changes made to it without departing from the essence of the present invention will constitute an infringement of the patent right of the present invention and will bear corresponding legal liabilities.
Claims
1. A method for connecting a Wi-Fi module to a cloud server, wherein the Wi-Fi module has no external input interface. Features The steps include: Step S1: After the Wi-Fi module is powered on and starts up, it enters the access point + site state; Step S2: The mobile phone connects to the Wi-Fi module as a station and transmits the SSID and password of the target router to the Wi-Fi module; Step S3: After the Wi-Fi module obtains the SSID and password of the target router, it connects to the target router in STA mode to determine whether the connection is successful. If not, the SSID and password of the target router obtained in step S2 are cleared, and then the next station is waited for to connect. If successful, it proceeds to step S4; Step S4: After the Wi-Fi module is successfully connected to the target router, it connects to the cloud server through the target router, and then the Wi-Fi module notifies the mobile phone that the connection is successful in AP mode; Step S5: The Wi-Fi module works in AP mode, and receives and executes commands from the target router and station at the same time; if no command is received within a timeout period, the module is powered off.
2. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 1, Features: When the Wi-Fi module works in AP mode and STA mode, different MAC addresses are used respectively.
3. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 2, Features: In the access point + station state, the Wi-Fi acts as an access point on the one hand, broadcasting its own wireless network; on the other hand, acts as a station, connecting to another wireless network for data upload and communication.
4. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 1, It is characterized in that The method further includes the following steps between step S1 and step S2: The Wi-Fi module reads the configuration table to determine whether it has been connected to the target router. If it is determined to be yes, the Wi-Fi module reads the SSID and password of the target router in the configuration table and then enters step S3. If it is determined to be no, it enters step S2.
5. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 1, It is characterized in that The step S2 specifically includes: The mobile phone is connected to the Wi-Fi module in AP mode as a station to determine whether the connection is successful within the specified time. If it is judged to be yes, the mobile phone transmits the SSID and password of the target router to the Wi-Fi module. If it is judged to be no, it enters step SS: determine whether the mobile phone and the Wi-Fi module are successfully connected within the specified time.
6. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 5, It is characterized in that The step S3 specifically includes: If the connection fails, the SSID and password of the target router obtained in step S2 are cleared, and the mode is switched to AP mode and the process returns to step S22; When the next mobile phone establishes a connection with the Wi-Fi module, step S3 is entered again to obtain the SSID and password of the target router.
7. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 6, It is characterized in that The step S4 specifically includes: After the Wi-Fi module is successfully connected to the target router, the target router is connected to the cloud server; after the connection is successful, the target router notifies the Wi-Fi module in STA mode that it has successfully connected to the cloud server, and the Wi-Fi module notifies the mobile phone in AP mode that it has successfully connected to the target router and the cloud server.
8. The method for connecting a Wi-Fi module to a cloud server as claimed in claim 1, It is characterized in that In step S1, the specific steps of entering the access point + station state include: Step S101: Set the local IP, gateway, subnet mask, and lower remote IP; Step S102: Set the AP IP, gateway, subnet mask, and upper remote IP; Step S103: Setting the local port and the remote port; Step S104: Setting the name and password for connecting to the remote AP; Step S105: Setting the name and password of the AP; Step S106: Setting a sending and receiving buffer; Step S107: Initialize the baud rate; Step S108: disconnect; Step S109: Setting to access point + STA mode; Step S110: Setting AP network parameters; Step S111: Set AP account password: Step S112: Connect to the designated route; Step S113: Setting local network parameters; Step S114: Waiting for routing connection; Step S115: Establish a UDP Server to listen to the specified port; Step S116: Display the IP address; Step S117: reading data; Step S118: Clear buffer data.
9. A device for connecting a Wi-Fi module to a cloud server, Features It comprises a Wi-Fi module, and the Wi-Fi module is used to implement the method described in any one of claims 1 to 8.
10. A smart device, Features This includes a device for connecting the Wi-Fi module described in claim 9 to a cloud server.
Citation Information
Patent Citations
Method and device for connecting Wi-Fi module with cloud and intelligent equipment
CN117440533A
Method and device for connecting Wi-Fi module with cloud and intelligent equipment
CN117729612A
