Wifi hotspot channel selection method, device and medium

The main control chip controls the working mode of the Wi-Fi module to ensure that the hotspot and Wi-Fi channels are consistent or have different frequency bands. This solves the problem of performance degradation of the Wi-Fi module when Wi-Fi and hotspot are turned on at the same time, and improves the communication performance of the Wi-Fi hotspot.

CN120603004APending Publication Date: 2025-09-05FUJIAN STAR NET WISDOM TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510992832.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

When both the Wi-Fi and hotspot functions are enabled, Wi-Fi module performance degrades. This is especially true for single or dual Wi-Fi modules, where hotspot performance is affected by improper channel selection and channel interference.

Method used

This paper provides a Wi-Fi hotspot channel selection method. The main control chip controls the working mode of single and dual Wi-Fi modules to ensure that the hotspot and Wi-Fi channels are consistent or have different frequency bands to avoid channel interference and improve performance.

Benefits of technology

In the case of a single Wi-Fi module, the hotspot and Wi-Fi channels are the same, and performance does not drop sharply. In the case of dual Wi-Fi modules, the hotspot and Wi-Fi use different frequency bands to avoid channel interference and performance does not drop significantly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120603004A_ABST
    Figure CN120603004A_ABST
Patent Text Reader

Abstract

The invention discloses a Wifi hotspot channel selection method, Wifi hotspot channel selection equipment and a medium, and relates to the technical field of Wifi modules. The method comprises the steps that a single Wifi module is connected with a main control chip, and the following method is executed through the main control chip: under the condition that only a hot spot runs, the hot spot freely selects a channel or selects a default channel according to configuration; if the Wifi module is switched from the single working mode to the simultaneous working of the Wifi and the hotspot, using the same channel to open the hotspot according to the Wifi channel, so that the Wifi and the hotspot share the same channel; and if the Wifi and the hotspot are operated at the same time and the Wifi switches connection, opening the hotspot by using the same channel according to the Wifi channel after the Wifi connection is completed. According to the Wifi hotspot channel selection method, the Wifi hotspot channel selection equipment and the medium provided by the invention, the Wifi hotspot performance of a single Wifi module and a double Wifi module is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Wi-Fi modules, and in particular to a Wi-Fi hotspot channel selection method, device, and medium. Background Art

[0002] With the development of electronic technology, various embedded devices have become widely used in people's lives. Relying on mature Internet infrastructure, people can quickly communicate with the outside world through various mobile terminals. Network modules play a crucial role in this communication process, with Wi-Fi modules being a representative example. Wi-Fi modules are often used to connect to wireless LANs or establish hotspots, and are a crucial component of mobile terminals.

[0003] Generally speaking, Wi-Fi modules can support both Wi-Fi and hotspot functions simultaneously. However, many Wi-Fi modules use a time-sharing principle for their different operating modes. If both Wi-Fi and hotspot are enabled simultaneously, their performance will degrade. Therefore, some products use dual Wi-Fi modules, but in actual use, this still results in decreased Wi-Fi and hotspot performance. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a Wi-Fi hotspot channel selection method, device and medium to improve the Wi-Fi hotspot performance of single Wi-Fi modules and dual Wi-Fi modules.

[0005] In a first aspect, the present invention provides a Wi-Fi hotspot channel selection method, which is applied to a single Wi-Fi module connected to a main control chip, and the main control chip performs the following method:

[0006] When only the hotspot is running, the hotspot can freely select the channel or select the default channel according to the configuration;

[0007] If the Wi-Fi module switches from single working mode to simultaneous Wi-Fi and hotspot working, the hotspot will be enabled using the same channel according to the Wi-Fi channel, so that Wi-Fi and hotspot are on the same channel;

[0008] If Wi-Fi and hotspot are already running at the same time, and Wi-Fi switches the connection, after the Wi-Fi connection is completed, the hotspot will be turned on using the same channel according to the Wi-Fi channel.

[0009] Furthermore, if only the hotspot is running, and the hotspot selects the 5G channel according to the configuration, then when switching from simultaneous operation of Wi-Fi and hotspot to only hotspot operation, the hotspot is reopened using the 5G channel.

[0010] Furthermore, the single Wi-Fi module supports 2.4G and 5G frequency bands; the method executed by the main control chip specifically includes:

[0011] If the module does not have Wi-Fi and hotspot functions enabled, prepare to enable the hotspot by using the hostapd tool to start the hotspot service and pass the hotspot channel and other configuration information to the Wi-Fi module, setting the hotspot to use the default 5G channel.

[0012] If the module has Wi-Fi enabled, connect to the hotspot provided by another device using the wpa_supplicant tool. To start the hotspot, first obtain the hotspot channel of the Wi-Fi connection through the system interface, start the hotspot using hostapd, and specify the same channel as the hotspot channel of the Wi-Fi connection.

[0013] If both Wi-Fi and hotspot functions are enabled on the module, to disable or disconnect Wi-Fi, you need to stop the wpa_supplicant process first, then re-enable the hotspot, stop the hostapd process first, and then re-start hostapd using the default 5G channel.

[0014] If the module is already connected to the hotspot and you are about to connect to or change the Wi-Fi network, first stop the wpa_supplicant process, obtain the hotspot channel, ssid, and passwd, and then restart wpa_supplicant. After the Wi-Fi network is connected, stop the hostapd process, obtain the hotspot channel of the Wi-Fi network through the system interface, and then start the hotspot through hostapd. Configure the hotspot channel to be the same as the Wi-Fi channel.

[0015] In a second aspect, the present invention provides a Wi-Fi hotspot channel selection method for a dual Wi-Fi module, including a first Wi-Fi module and a second Wi-Fi module, each of which is connected to a main control chip, and the main control chip performs the following method:

[0016] The first Wi-Fi module is configured to operate in AP mode as an AP module, and the second Wi-Fi module is configured to operate in STA mode as a STA module.

[0017] When only the hotspot is running, the hotspot can select the channel freely or select the default channel according to the configuration;

[0018] If you switch from single working mode to simultaneous Wi-Fi and hotspot operation, use different frequency bands to open the hotspot based on the Wi-Fi channel, so that the hotspot and Wi-Fi operate in different frequency bands;

[0019] If Wi-Fi and hotspot are already running at the same time, and Wi-Fi switches the connection, after the Wi-Fi connection is completed, the hotspot will be turned on using a channel of a different frequency band according to the Wi-Fi channel.

[0020] Furthermore, the method executed by the main control chip specifically includes:

[0021] If both the STA module and the AP module are not enabled, the hotspot is ready to be enabled. The AP module starts the hotspot service through hostapd.

[0022] If the STA module is already powered on and connected to Wi-Fi via wpa_supplcant, prepare to enable the hotspot. First, obtain the Wi-Fi channel to which the STA module is connected. Then, use hostapd to start the hotspot service and configure a different frequency band from that used for the Wi-Fi connected to the STA module.

[0023] If the STA module is connected to Wi-Fi and the AP module has enabled a hotspot, the STA module is about to shut down or disconnect the Wi-Fi. The AP module's hotspot remains unchanged, and the hostapd process continues to run.

[0024] If the AP module's hotspot is enabled and the STA module is preparing to connect to or switch Wi-Fi, it waits for the wpa_supplicant process to start and the Wi-Fi to complete the connection and stabilize. Then, the AP module starts the hotspot service through hostapd. The hotspot uses a different frequency band than the STA module's Wi-Fi.

[0025] Furthermore, the dual Wi-Fi module supports 2.4G, 5.2G, and 5.8G frequency bands; the hotspot uses a different frequency band from the STA module Wi-Fi:

[0026] When the Wi-Fi network connected to the STA module uses 2.4 GHz and 5.2 GHz channels, the AP module's hotspot uses 5.8 GHz channels. When the Wi-Fi network connected to the STA module uses 5.8 GHz channels, the AP module's hotspot uses 5.2 GHz channels.

[0027] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect or the second aspect when executing the program.

[0028] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or the second aspect.

[0029] The technical solutions provided in the embodiments of the present invention have at least the following technical effects:

[0030] When the device has only a single Wi-Fi module, by enabling both Wi-Fi and the hotspot simultaneously, aligning the hotspot and Wi-Fi channel, Wi-Fi hotspot performance will not be significantly degraded due to time-sharing. When the device has two Wi-Fi modules, enabling both Wi-Fi and the hotspot simultaneously, using different frequency bands, will prevent Wi-Fi hotspot performance from being significantly degraded due to Wi-Fi channel interference.

[0031] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0033] Figure 1 This is a schematic diagram of the module structure in Example 1 of the present invention;

[0034] Figure 2 is an overall flow chart of the method in embodiment 1 of the present invention;

[0035] Figure 3 This is a flow chart of opening a hotspot in the method of embodiment 1 of the present invention;

[0036] Figure 4 This is a flowchart of shutting down or disconnecting Wi-Fi in the method of embodiment 1 of the present invention;

[0037] Figure 5 This is a flowchart of connecting or changing Wi-Fi in the method of embodiment 1 of the present invention;

[0038] Figure 6 This is a schematic diagram of the module structure in the second embodiment of the present invention;

[0039] Figure 7 This is an overall flow chart of the method in Embodiment 2 of the present invention;

[0040] Figure 8 This is a flow chart of opening a hotspot in the method of embodiment 2 of the present invention;

[0041] Figure 9 This is a flowchart of shutting down or disconnecting Wi-Fi in the method of embodiment 2 of the present invention;

[0042] Figure 10 This is a flowchart of connecting or changing Wi-Fi in the method of embodiment 2 of the present invention;

[0043] Figure 11 This is a schematic structural diagram of an electronic device in a third embodiment of the present invention;

[0044] Figure 12 Schematic diagram of the structure of the medium in the fourth embodiment of the present invention. DETAILED DESCRIPTION

[0045] The embodiments of the present invention provide a Wi-Fi hotspot channel selection method, device, and medium to improve the Wi-Fi hotspot performance of single Wi-Fi modules and dual Wi-Fi modules.

[0046] The technical solution in the embodiment of the present invention has the following general ideas:

[0047] After research, the inventors found that the main reason for the significant decline in Wi-Fi hotspot performance under a single Wi-Fi module configuration is the unreasonable selection of hotspot channels. Currently, hotspots with a single Wi-Fi module use random channels by default. If Wi-Fi and hotspots operate on different channels, the Wi-Fi module will be in time-sharing sharing mode and constantly switch between the two channels, resulting in a sharp decline in Wi-Fi hotspot performance.

[0048] However, the reason for the dramatic drop in Wi-Fi hotspot performance in a dual Wi-Fi module configuration is completely different from that in a single Wi-Fi module configuration. Dual Wi-Fi hotspots also default to using random channels. The inventors discovered that if the Wi-Fi and hotspot use the same or adjacent channels, the hotspot and Wi-Fi signals interfere with each other, significantly degrading performance.

[0049] Therefore, based on the operating characteristics of Wi-Fi modules, we developed appropriate channel selection strategies and proposed methods for switching hotspot frequency bands to address the issue of degraded hotspot performance when both STAs and APs coexist in single or dual Wi-Fi modules. This prevents a significant drop in hotspot performance and ensures hotspot communication performance when both STAs and APs are used. For a single Wi-Fi module, the hotspot and Wi-Fi channels must be aligned; for dual Wi-Fi modules, the hotspot and Wi-Fi frequency bands must be different.

[0050] The following describes the technical solutions for single Wi-Fi modules and dual Wi-Fi modules respectively:

[0051] When a device is configured with a single Wi-Fi module, given that multiple operating modes of a single Wi-Fi module operate simultaneously using a time-sharing principle, Wi-Fi and hotspot must adhere to the same channel rule when operating both Wi-Fi and hotspot. This prevents the module from switching between different channels, which could degrade Wi-Fi and hotspot performance. Because the Wi-Fi channel depends on the connected hotspot and cannot be modified, to comply with the same channel rule, only the hotspot channel must be modified. According to the above rules, when operating only the hotspot, the hotspot can freely select a channel. To improve connection speeds, you can specify that the default 5G channel be used when operating only the hotspot. If the module switches from single operating mode to simultaneous Wi-Fi and hotspot operation, the hotspot must be enabled on the same Wi-Fi channel to comply with the same channel rule and the hotspot-only channel modification rule. If both Wi-Fi and hotspot are already running simultaneously and Wi-Fi is connected to another hotspot, wait until the Wi-Fi connection is complete before enabling the hotspot on the same channel. If both Wi-Fi and hotspot are running simultaneously and the module switches to hotspot-only operation, to improve hotspot connection speeds, the hotspot must be re-enabled on the default 5G channel.

[0052] When configuring a device with two Wi-Fi modules, to prevent signal interference between the two modules, Wi-Fi and hotspot operation must adhere to the rule that Wi-Fi and hotspot use different frequency bands. Both modules can only operate in one mode: one in STA mode and the other in AP mode. Because the Wi-Fi channel depends on the connected hotspot and cannot be modified, to comply with the rule that Wi-Fi and hotspot have different frequency bands, only the hotspot channel must be modified. According to the above rules, when only the hotspot is operating, the hotspot can freely select a channel. To improve connection speeds, a fixed 5.2 GHz channel is selected when only the hotspot is operating. If the module switches from single-mode operation to simultaneous Wi-Fi and hotspot operation, the hotspot must be enabled using a different frequency band based on the Wi-Fi channel to comply with the rule that Wi-Fi and hotspot have different frequency bands and that only the hotspot channel must be modified. If both Wi-Fi and hotspot are already running simultaneously and Wi-Fi is connected to another hotspot, the Wi-Fi channel must be changed after the Wi-Fi connection is complete, and then the hotspot must be enabled using a different frequency band based on the Wi-Fi channel. If both Wi-Fi and hotspot are already running simultaneously, switching to hotspot-only operation does not change the hotspot.

[0053] Example 1

[0054] This embodiment provides a Wifi hotspot channel selection method, which is applied to a single Wifi module, such as Figure 1As shown, the single Wifi module is connected to the main control chip, which is connected to the Wifi module via pcie, usb or sdio bus to control the working mode of the Wifi module and configure signal parameters. The main control chip controls the module to support Wifi hotspots working simultaneously. Figure 2 As shown, the following method is executed by the main control chip:

[0055] A1. When only the hotspot is running, allow the hotspot to freely select a channel or select the default channel according to the configuration;

[0056] A2. If the Wi-Fi module switches from single working mode to simultaneous Wi-Fi and hotspot operation, the hotspot will be enabled using the same channel as the Wi-Fi channel, so that both Wi-Fi and hotspot are on the same channel.

[0057] A3. If Wi-Fi and hotspot are already running at the same time and Wi-Fi switches the connection, after the Wi-Fi connection is completed, use the same channel as the Wi-Fi channel to open the hotspot.

[0058] Specifically, if only the hotspot is running, the hotspot selects the 5G channel according to the configuration. When switching from simultaneous operation of Wi-Fi and hotspot to only hotspot operation, the hotspot is reopened using the 5G channel.

[0059] In a specific embodiment, the single Wi-Fi module supports 2.4G and 5G frequency bands; the method executed by the main control chip specifically includes:

[0060] If the module does not have Wi-Fi and hotspot functions enabled, prepare to enable the hotspot. Start the hotspot service using the hostapd tool and pass configuration information such as the hotspot channel to the Wi-Fi module, setting the hotspot to use the default 5G channel.

[0061] If the module has Wi-Fi enabled, connect to the hotspot provided by another device using the wpa_supplicant tool. To start the hotspot, first obtain the hotspot channel of the Wi-Fi connection through the system interface, start the hotspot using hostapd, and specify the same channel as the hotspot channel of the Wi-Fi connection.

[0062] The specific steps for opening the hotspot in the above two ways are as follows Figure 3 shown.

[0063] If the module has both Wi-Fi and hotspot enabled, and you are ready to turn off or disconnect Wi-Fi, you must first stop the wpa_supplicant process. Considering that the hotspot may be using the 2.4G band, you must restart the hotspot to maintain high performance. First stop the hostapd process, then re-start hostapd using the default 5G channel, such as Figure 4shown.

[0064] If you are ready to connect to or change Wi-Fi while the module is running a hotspot, first stop the wpa_supplicant process, obtain the hotspot channel, ssid, and passwd to connect to, and then restart wpa_supplicant. After the Wi-Fi connection is complete and stable, stop the hostapd process, obtain the hotspot channel of the Wi-Fi connection through the system interface, and then start the hotspot through hostapd. Configure the hotspot channel to be the same as the Wi-Fi channel, such as Figure 5 shown.

[0065] If Wi-Fi fails to connect to the hotspot using wpa_supplicant, the hotspot remains unchanged and the hostapd process continues to run.

[0066] The above method ensures that when a device has only a single Wi-Fi module and Wi-Fi and hotspot are enabled at the same time, the hotspot and Wi-Fi channels are aligned, and the Wi-Fi hotspot performance does not drop sharply due to time-sharing.

[0067] Example 2

[0068] In this embodiment, a Wifi hotspot channel selection method is provided for a dual Wifi module, including a first Wifi module and a second Wifi module, each of which is connected to a main control chip. Figure 6 As shown, the main control chip is connected to the Wifi module through the PCIe, USB or SDIO bus to control the working mode of the Wifi module and configure signal parameters. Figure 7 As shown, the following method is executed by the main control chip:

[0069] B1. Enable the first Wi-Fi module to operate in AP mode as an AP module, and enable the second Wi-Fi module to operate in STA mode as a STA module;

[0070] B2. When only the hotspot is running, the hotspot can freely select a channel or select the default channel according to the configuration;

[0071] B3. If you switch from single working mode to simultaneous Wi-Fi and hotspot operation, use different frequency bands to open the hotspot according to the Wi-Fi channel, so that the hotspot and Wi-Fi operate in different frequency bands;

[0072] B4. If Wi-Fi and hotspot are already running at the same time, and Wi-Fi switches the connection, after the Wi-Fi connection is completed, use a channel of a different frequency band according to the Wi-Fi channel to open the hotspot.

[0073] In a specific embodiment, the method executed by the main control chip specifically includes:

[0074] If both the STA module and the AP module are disabled and the hotspot is ready to be enabled, the AP module starts the hotspot service through hostapd and specifies the 5.8 GHz frequency channel.

[0075] If the STA module is already powered on and connected to Wi-Fi through wpa_supplcant, and you are ready to open a hotspot, first obtain the Wi-Fi channel connected to the STA module, then use hostapd to start the hotspot service and configure a different frequency band from that used by the STA module. When the Wi-Fi connected to the STA module uses 2.4 GHz and 5.2 GHz channels, the AP module's hotspot uses a 5.8 GHz channel. When the Wi-Fi connected to the STA module uses a 5.8 GHz channel, the AP module's hotspot uses a 5.2 GHz channel.

[0076] The specific steps for opening the hotspot in the above two ways are as follows Figure 8 shown.

[0077] If the STA module is connected to Wi-Fi and the AP module has enabled the hotspot, the STA module is ready to shut down or disconnect the Wi-Fi. The hotspot of the AP module remains unchanged and the hostapd process continues to run. Figure 9 shown.

[0078] If the AP module's hotspot is enabled and the STA module is preparing to connect to or switch Wi-Fi, it will first wait for the wpa_supplicant process to start, the Wi-Fi to complete the connection and stabilize, and then the AP module will enable the hotspot service through hostapd. The hotspot uses a different frequency band from the STA module's Wi-Fi. When the Wi-Fi connected to the STA module uses 2.4G and 5.2G frequency channels, the AP module's hotspot uses 5.8G frequency channels. When the Wi-Fi connected to the STA module uses 5.8G frequency channels, the AP module's hotspot uses 5.2G frequency channels. Figure 10 shown.

[0079] If Wi-Fi fails to connect to the hotspot using wpa_supplicant, the hotspot channel is selected only in the 5.2G and 5.8G bands, and there is no problem of using the 2.4G band channel and the low connection rate. Therefore, the hotspot is not changed and the hostapd process continues to run.

[0080] The above method enables simultaneous activation of Wi-Fi and hotspot when the device has two Wi-Fi modules. Wi-Fi and hotspot use different frequency bands, and Wi-Fi hotspot performance will not be significantly degraded due to Wi-Fi channel interference.

[0081] Based on the same inventive concept, this application provides an electronic device embodiment corresponding to the first embodiment, see the third embodiment for details.

[0082] Example 3

[0083] This embodiment provides an electronic device, such as Figure 11 As shown, it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any implementation method in the first or second embodiment can be implemented.

[0084] Since the electronic device described in this embodiment is the device used to implement the method of the embodiment of this application, based on the method described in Example 1 of this application, those skilled in the art will be able to understand the specific implementation of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method of the embodiment of this application will not be described in detail here. As long as the device used by those skilled in the art to implement the method of the embodiment of this application falls within the scope of protection of this application.

[0085] Based on the same inventive concept, this application provides a storage medium corresponding to Example 1, see Example 4 for details.

[0086] Example 4

[0087] This embodiment provides a computer-readable storage medium, such as Figure 12 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, any implementation method of embodiment 1 or embodiment 2 can be implemented.

[0088] The method of the present invention enables Wi-Fi and hotspot simultaneously when the device has only a single Wi-Fi module, aligning the hotspot with the Wi-Fi channel, thereby preventing a sharp drop in Wi-Fi hotspot performance due to time-sharing. Furthermore, when the device has two Wi-Fi modules, enabling Wi-Fi and hotspot simultaneously, using different frequency bands, prevents a significant drop in Wi-Fi hotspot performance due to Wi-Fi channel interference.

[0089] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0090] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0091] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0092] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0093] Although the specific embodiments of the present invention are described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A Wifi hotspot channel selection method, characterized in that: Applied to a single Wi-Fi module, the single Wi-Fi module is connected to the main control chip, and the following method is executed by the main control chip: When only the hotspot is running, the hotspot can freely select the channel or select the default channel according to the configuration; If the Wi-Fi module switches from single working mode to simultaneous Wi-Fi and hotspot working, the hotspot will be enabled using the same channel according to the Wi-Fi channel, so that Wi-Fi and hotspot are on the same channel; If Wi-Fi and hotspot are already running at the same time and Wi-Fi switches the connection, after the Wi-Fi connection is completed, the hotspot will be turned on using the same channel according to the Wi-Fi channel.

2. The method according to claim 1, wherein: If only the hotspot is running and the hotspot selects the 5G channel according to the configuration, when switching from simultaneous Wi-Fi and hotspot operation to hotspot operation only, the hotspot will be reopened using the 5G channel.

3. The method according to claim 1, wherein: The single Wi-Fi module supports 2.4G and 5G frequency bands; the method executed by the main control chip specifically includes: If the module does not have Wi-Fi and hotspot functions enabled, prepare to enable the hotspot by using the hostapd tool to start the hotspot service and pass the hotspot channel and other configuration information to the Wi-Fi module, setting the hotspot to use the default 5G channel. If the module has Wi-Fi enabled, connect to the hotspot provided by another device using the wpa_supplicant tool. To start the hotspot, first obtain the hotspot channel of the Wi-Fi connection through the system interface, start the hotspot using hostapd, and specify the same channel as the hotspot channel of the Wi-Fi connection. If both Wi-Fi and hotspot functions are enabled on the module, to disable or disconnect Wi-Fi, you need to stop the wpa_supplicant process first, then re-enable the hotspot, stop the hostapd process first, and then re-start hostapd using the default 5G channel. If the module is already connected to the hotspot and you are about to connect to or change the Wi-Fi network, first stop the wpa_supplicant process, obtain the hotspot channel, ssid, and passwd, and then restart wpa_supplicant. After the Wi-Fi network is connected, stop the hostapd process, obtain the hotspot channel of the Wi-Fi network through the system interface, and then start the hotspot through hostapd. Configure the hotspot channel to be the same as the Wi-Fi channel.

4. A Wifi hotspot channel selection method, characterized in that: Applied to dual Wi-Fi modules, including a first Wi-Fi module and a second Wi-Fi module, each connected to a main control chip, and the following method is executed by the main control chip: The first Wi-Fi module is configured to operate in AP mode as an AP module, and the second Wi-Fi module is configured to operate in STA mode as a STA module. When only the hotspot is running, the hotspot can select the channel freely or select the default channel according to the configuration; If you switch from single working mode to simultaneous Wi-Fi and hotspot operation, use different frequency bands to open the hotspot based on the Wi-Fi channel, so that the hotspot and Wi-Fi operate in different frequency bands; If Wi-Fi and hotspot are already running at the same time, and Wi-Fi switches the connection, after the Wi-Fi connection is completed, the hotspot will be turned on using a channel of a different frequency band according to the Wi-Fi channel.

5. The method according to claim 4, characterized in that: The method executed by the main control chip specifically includes: If both the STA module and the AP module are not enabled, the hotspot is ready to be enabled. The AP module starts the hotspot service through hostapd. If the STA module is already powered on and connected to Wi-Fi via wpa_supplcant, prepare to enable the hotspot. First, obtain the Wi-Fi channel to which the STA module is connected. Then, use hostapd to start the hotspot service and configure a different frequency band from that used for the Wi-Fi connected to the STA module. If the STA module is connected to Wi-Fi and the AP module has enabled a hotspot, the STA module is about to shut down or disconnect the Wi-Fi. The AP module's hotspot remains unchanged, and the hostapd process continues to run. If the AP module's hotspot is enabled and the STA module is preparing to connect to or switch Wi-Fi, it waits for the wpa_supplicant process to start and the Wi-Fi to complete the connection and stabilize. Then, the AP module starts the hotspot service through hostapd. The hotspot uses a different frequency band than the STA module's Wi-Fi.

6. The method according to claim 5, characterized in that: The dual Wi-Fi module supports 2.4G, 5.2G, and 5.8G frequency bands. The hotspot uses different frequency bands than the STA module Wi-Fi: When the Wi-Fi network connected to the STA module uses 2.4 GHz and 5.2 GHz channels, the AP module's hotspot uses 5.8 GHz channels. When the Wi-Fi network connected to the STA module uses 5.8 GHz channels, the AP module's hotspot uses 5.2 GHz channels.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Wifi chip and control method during coexistence of station (STA) mode and access point (AP) mode

    CN104185224A

  • Hotspot sharing method, readable storage medium and hotspot sharing device

    CN107370621A

  • WiFi channel automatic test method, system and device, and storage medium

    CN108810951A

  • Method for realizing WIFI sharing on smart television based on Android

    CN112511875A

  • Method for simultaneous working of STA and AP of single WIFI module and related equipment

    CN113242564A