A WiFi connection system for desktop-less embedded devices
Patent Information
- Application Number
- CN202610902967.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-09-15
AI Technical Summary
该方式要求用户具备Linux命令操作能力,用户需要重新编辑系统文件,不利于普通用户在现场快速完成配置
本发明的面向无桌面嵌入式设备的WiFi连接系统,在设备上电后,开机自启服务检测网络状态,若未联网,热点控制模块创建临时热点,Web配置模块提供本地配置页面,用户手机连接热点后,WiFi扫描模块展示周边网络列表,用户选择目标网络并提交凭据,网络配置写入模块校验并写入配置,切换网卡连接目标路由器,连接状态检测模块检测连接结果,成功则关闭热点,失败则恢复热点并提示错误原因。本发明无需外设或专用App即可可视化配网,降低操作门槛,失败时自动恢复避免设备失联,标签结合凭据加密与权限验证保障安全,显著提升设备交付成功率与用户体验,适用于无桌面嵌入式设备批量部署。
Smart Images

Figure CN122765656A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a WiFi connectivity system for desktopless embedded devices. Background Technology
[0002] Small embedded hosts such as Raspberry Pi are commonly used in IoT gateways, data acquisition terminals, display controllers, and edge computing nodes. These devices are typically deployed in the field without a monitor, keyboard, and mouse, a configuration known as desktopless or headless mode. When using desktopless devices for the first time or changing installation locations, WiFi connection configuration is required before they can connect to a local area network or cloud service platform.
[0003] Currently, the existing methods for configuring WiFi on such devices mainly include: pre-writing the WiFi name (SSID) and password into the system configuration file; configuring via serial port, SSH, or Bluetooth; temporarily connecting a monitor and keyboard to access the desktop system for configuration; or using a manufacturer-specific application (App) for network configuration. Furthermore, after the system boots up normally, the network management service will connect to the designated WiFi network according to the pre-configured settings. If the pre-configured SSID does not exist or the password is incorrect, the device will be offline. Users typically need to reinsert the memory card and edit the configuration file to modify the configuration, or log in to the device via a wired network to modify the network parameters. Some configuration solutions create a temporary hotspot on the device; the user's mobile phone connects to this hotspot, accesses the configuration webpage, and then enters the target router's WiFi name and password.
[0004] However, the aforementioned existing technologies have the following drawbacks and shortcomings in practical applications in desktop-less scenarios: (1) The pre-configured method has a high operational threshold and is not suitable for batch delivery and on-site network replacement. This method requires users to have Linux command operation capabilities and users need to re-edit system files, which is not conducive to ordinary users completing the configuration quickly on-site.
[0005] (2) The configuration method that relies on peripherals has poor applicability. Relying on monitors, keyboards, serial ports or SSH requires additional peripherals and is not suitable for embedded terminals such as Raspberry Pi that are already encapsulated in the device housing.
[0006] (3) Hotspot network configuration solutions based on scripts or distributed processes suffer from chaotic state management. Existing solutions mostly use scripts or distributed processes to implement hotspot management, web services, and configuration writing, resulting in inconsistent state switching and weak failure recovery mechanisms. This easily leads to problems such as hotspots not being turned off, failure to recover after a target WiFi connection fails, and users not being able to know the reason for the failure. In addition, in the .NET / C# ecosystem, there is currently a lack of complete service-oriented implementations suitable for Raspberry Pi without a desktop environment.
[0007] (4) Conventional web-based network configuration lacks a complete closed-loop processing mechanism. Ordinary web-based network configuration only submits the SSID and password, without performing complete closed-loop processing on connection status, configuration security, timeout recovery, and credential storage, resulting in insufficient reliability and security of the network configuration process. Summary of the Invention
[0008] In view of the above problems, the present invention is proposed to provide a WiFi connectivity system for desktopless embedded devices that overcomes or at least partially solves the above problems.
[0009] This invention provides a WiFi connectivity system for desktop-less embedded devices, comprising: The power-on service is used to automatically start on desktop-less embedded devices after power-on and to detect whether a valid network connection is currently available. The hotspot control module is used to control the wireless network card to create a temporary WiFi hotspot when the startup service detects that no valid network is connected. The Web configuration module is used to start a local HTTP service and provide a local configuration page to user terminals connected to the temporary WiFi hotspot. The WiFi scanning module is used to obtain information about surrounding wireless networks and display an optional list on the local configuration page through the Web configuration module. The network configuration writing module is used to receive the target WiFi credentials submitted by the user terminal through the local configuration page, perform format verification on the target WiFi credentials, write the verified target WiFi credentials into the network configuration, and control the wireless network card to switch to client mode to connect to the target router. The connection status detection module is used to detect whether the target router has successfully connected within a preset time. If the connection is successful, it controls the hotspot control module to turn off the temporary WiFi hotspot and return a success result. If the connection fails, it controls the hotspot control module to restore the temporary WiFi hotspot and displays the error reason on the local configuration page through the Web configuration module.
[0010] Optionally, the automatic startup service uses a background persistent service as a persistent process, and the Web configuration module uses the default browser Kestrel to provide local pages and interfaces; The automatic startup service also includes a state machine, which is used to write the status of the hotspot control module, web configuration module, WiFi scanning module, network configuration writing module, and connection status detection module at each step of the network configuration process into the local state machine for unified scheduling and management.
[0011] Optionally, the hotspot control module is further configured to: A temporary hotspot name is generated using at least one of the following: device serial number, product model, and random code; When creating the temporary WiFi hotspot, set the hotspot password, device IP address, and DHCP address pool; If no one operates the network configuration for more than a preset time, the temporary WiFi hotspot will be automatically turned off or the hotspot password will be changed.
[0012] Optionally, the WiFi scanning module is further configured to: Call the system scanning interface to obtain information about surrounding wireless networks; The acquired surrounding wireless network information is filtered to remove duplicate WiFi names, hidden networks, and networks with weak signals; The filtered WiFi name, signal strength, and encryption method are returned to the local configuration page for display.
[0013] Optionally, the system further includes a secure storage module, which is used to encrypt and save the WiFi password in the target WiFi credentials using at least one of the following methods: system key ring, file encryption, and device unique key derivation.
[0014] Optionally, the Web configuration module is further configured to: When a user terminal accesses the local configuration page, it is required to enter at least one of the following: a one-time configuration code on the device label, scan the device QR code, or verify the initial password, in order to verify access rights; After successfully connecting to the target router, the connection completion information is sent to the user terminal through the local configuration page.
[0015] Optionally, the connection status detection module is further configured to: The wireless interface status, IP address acquisition status, gateway reachability status, and Internet reachability status are cyclically detected within the preset time period. When the connection to the target router fails, the cause of failure is determined based on the status detection results. The cause of failure includes incorrect password, weak signal, DHCP acquisition failure, and router unreachable. The cause of failure is then displayed through the Web configuration module.
[0016] Optionally, the desktopless embedded device is also connected to at least one of an indicator light, a buzzer, and a voice prompt device; The power-on auto-start service is also used to control at least one of the indicator lights, buzzers, and voice prompt devices to provide feedback to the user on the successful connection status after the target router is successfully connected.
[0017] Optionally, the network configuration writing module is further configured to: Execute network commands through controlled process calls or system network management interfaces; Hotspot creation is accomplished through the hostapd or NetworkManager interface, and DHCP and DNS configuration is accomplished through dnsmasq or the NetworkManager built-in shared network.
[0018] Optionally, the system is characterized in that it is suitable for desktopless embedded devices running Linux and the .NET framework, wherein the desktopless embedded device includes at least a desktopless Raspberry Pi host.
[0019] This invention has the following advantages: This invention provides a WiFi connection system for desktopless embedded devices. Upon device power-on, a service automatically starts to check network status. If no network is available, a hotspot control module creates a temporary hotspot, and a web configuration module provides a local configuration page. After the user's mobile phone connects to the hotspot, a WiFi scanning module displays a list of nearby networks. The user selects a target network and submits credentials. A network configuration writing module verifies and writes the configuration, switches the network card to connect to the target router, and a connection status detection module checks the connection result. If successful, the hotspot is turned off; otherwise, it is restored and the error reason is displayed. This invention provides visual network configuration without the need for external devices or a dedicated app, lowering the operational threshold. Automatic recovery in case of failure prevents device disconnection. Tag-based credential encryption and permission verification ensure security, significantly improving device delivery success rate and user experience. It is suitable for batch deployment of desktopless embedded devices. Attached Figure Description
[0020] Figure 1 This is a structural block diagram of a WiFi connection system for desktop-less embedded devices provided by the present invention; Figure 2 This is a flowchart illustrating the operation of the WiFi connection system for desktop-less embedded devices according to the present invention. Detailed Implementation
[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] Reference Figure 1This invention provides a WiFi connectivity system for desktopless embedded devices, aiming to solve problems such as high barriers to network configuration, reliance on additional peripherals, chaotic state management, and lack of a complete closed-loop processing mechanism when deploying existing desktopless devices (such as Raspberry Pi) in the field. This invention enables desktopless embedded devices to complete WiFi configuration without a monitor, keyboard, serial cable, network cable, or dedicated mobile app, transforming the initial network connection process into a visual operation within the user terminal's (such as a mobile phone) browser. It also automatically returns to a configurable state when configuration fails, thereby reducing the difficulty of on-site installation and after-sales maintenance, improving device delivery success rate, and enhancing user experience.
[0023] System hardware and basic environment architecture The system hardware and basic environment of this invention mainly include: a desktopless Raspberry Pi host or other desktopless embedded device, a wireless network card, a user terminal (such as a mobile terminal), and a target router.
[0024] The desktopless Raspberry Pi host is equipped with a desktopless Linux system and a .NET runtime environment. The wireless network card can operate in both access point (AP) mode and station mode. Background service programs based on the .NET framework (such as using .NET Worker Services) are deployed on the desktopless Raspberry Pi host as background services and configured to start automatically at boot via systemd or an equivalent startup manager, forming an automatic startup service.
[0025] System module composition and functions The WiFi connection system for desktopless embedded devices of the present invention mainly includes: a power-on auto-start service, a hotspot control module, a web configuration module, a WiFi scanning module, a network configuration writing module, a connection status detection module, and a secure storage module. The specific functions of each module are as follows: 1. Startup service The service automatically starts upon power-on of the desktop-less embedded device and checks if a valid network connection is currently available. After starting, it first reads the local status file and network configuration to determine if the device is connected to an available network. If not, it calls the hotspot control module to create a temporary WiFi hotspot. In the C# implementation, the automatic startup service uses a background persistent service (such as a .NET Worker Service) as a persistent process.
[0026] The automatic startup service also includes a state machine, which records the status of the hotspot control module, web configuration module, WiFi scanning module, network configuration writing module, and connection status detection module at each step of the network configuration process, enabling unified scheduling and management. Since all modules are managed by the same C# backend service's state machine, temporary hotspots can be automatically restored in case of connection failure, preventing devices from losing connectivity due to incorrect passwords or unreachable routers.
[0027] 2. Hotspot control module When the startup service detects no valid network connection, it controls the wireless network adapter to enter access point mode to create a temporary WiFi hotspot. Specifically, the hotspot control module is also used for: (1) Use at least one of the device serial number, product model, and random code to generate a temporary hotspot name, so that users can identify the target device in the mobile phone WiFi list; (2) When creating a temporary WiFi hotspot, set the hotspot password, device IP address, and DHCP address pool; (3) When no one operates the network for more than a preset time, the temporary WiFi hotspot will be automatically turned off or the hotspot password will be changed to improve system security.
[0028] 3. Web Configuration Module A local HTTP service is started to provide a local configuration page to user terminals connecting to the temporary WiFi hotspot. The web configuration module uses ASP.NET Core Kestrel to provide the local page and interface. After connecting to the temporary hotspot, user terminals can access the configuration interface by visiting a fixed local address in their browser or through an automatic pop-up window.
[0029] In addition, the Web configuration module is also used for: (1) When a user terminal accesses the local configuration page, it is required to enter at least one of the following: a one-time configuration code on the device label, scan the device QR code, or verify the initial password, in order to verify access rights and prevent unauthorized mobile phones from modifying network configurations; (2) After the target router is successfully connected, the connection completion information is sent to the user terminal through the local configuration page.
[0030] 4. WiFi scanning module The system acquires information about nearby wireless networks and displays a list of available networks on a local configuration page via a web configuration module. The configuration webpage shows a list of scanned SSIDs; users simply select the target Wi-Fi network and enter the password in their mobile browser, reducing errors caused by manually entering the SSID. Specifically, the Wi-Fi scanning module is also used for: (1) Call the system scanning interface to obtain information about surrounding wireless networks; (2) Filter the acquired surrounding wireless network information to remove duplicate WiFi names (SSID), hidden networks and networks with weak signals; (3) Return the filtered WiFi name, signal strength and encryption method to the local configuration page for display.
[0031] 5. Network configuration writing module The system receives the target WiFi credentials submitted by the user terminal through the local configuration page, performs format verification on the target WiFi credentials (such as checking whether the SSID is empty and whether the password length meets the encryption method requirements), writes the verified target WiFi credentials into the network configuration, and controls the wireless network card to switch to client mode to connect to the target router.
[0032] Specifically, the network configuration writing module is also used for: (1) Execute network commands through controlled process calls or system network management interfaces; (2) Hotspot creation is accomplished through the hostapd or NetworkManager interface, and DHCP and DNS configuration is accomplished through dnsmasq or the NetworkManager built-in shared network. This implementation method is not limited to specific network management tools; the above components are all equivalent implementations.
[0033] 6. Connection Status Detection Module Within a preset time, the system checks whether the target router has successfully connected. If the connection is successful, the hotspot control module shuts down the temporary WiFi hotspot and returns a success result. If the connection fails, the hotspot control module restores the temporary WiFi hotspot and displays the error reason on the local configuration page via the Web configuration module.
[0034] Specifically, the connection status detection module is also used for: (1) Circularly detect the wireless interface status, IP address acquisition status, gateway reachability status and Internet reachability status within a preset time period; (2) When the target router connection fails, determine the reason for failure based on the status detection results. The reasons for failure include incorrect password, weak signal, DHCP acquisition failure, and router unreachable. The reason for failure is then displayed through the Web configuration module so that the user can reconnect and change the password or select another network.
[0035] 7. Secure storage module The system also includes a secure storage module, which uses at least one of the following methods—system key ring, file encryption, and device unique key derivation—to encrypt and save the WiFi password in the target WiFi credentials, thereby preventing the WiFi password from being saved in plaintext and ensuring configuration security.
[0036] 8. External feedback device control The desktop-less embedded device is also connected to at least one of the following: indicator lights, buzzers, and voice prompt devices; the power-on auto-start service is also used to control at least one of the following: indicator lights, buzzers, and voice prompt devices to provide feedback to the user on the successful connection status after the target router is successfully connected, forming a multi-dimensional result feedback in combination with page prompts.
[0037] Reference Figure 2 The operating flow of the system of the present invention is as follows: After powering on desktopless embedded devices such as S1 and desktopless Raspberry Pi hosts, the systemd or equivalent startup manager automatically starts the .NET framework-based startup service.
[0038] S2: The service reads the local status file and network configuration to check if a valid network is currently connected. If not, it enters the network configuration state, calls the hotspot control module to create a temporary WiFi hotspot, and starts the web configuration module to enable the local HTTP service.
[0039] S3: The mobile terminal connects to the temporary hotspot emitted by the Raspberry Pi, opens the local configuration page in the browser (accessing a fixed local address or an automatic pop-up window), and completes the one-time configuration code and other permission verification.
[0040] S4, the Web configuration module calls the WiFi scanning module to obtain the surrounding SSID, signal strength and encryption method (filtering duplicate, hidden and weak signal networks), and displays an optional list on the page.
[0041] On the S5, the user selects the target WiFi network, enters the password, and submits.
[0042] S6, the network configuration writing module performs format validation on the input, encrypts the credentials through the secure storage module and writes them into the network configuration, stops the temporary hotspot, switches the wireless network card to client mode, and attempts to connect to the target router.
[0043] S7, the connection status detection module cyclically checks the connection status within a preset time. If successful, the temporary hotspot is closed, and a success result is returned via the page, indicator light, or buzzer; if it fails, the reason for the failure is recorded, the temporary hotspot and configuration page are restored, and the specific error reason is displayed on the page.
[0044] The system of this invention is applicable to desktopless embedded devices running Linux and .NET. Desktopless embedded devices include at least a desktopless Raspberry Pi host, and can also be widely used in IoT terminals, educational experimental equipment, industrial data acquisition gateways, and edge controllers.
[0045] Implemented using C# and the .NET framework, this invention facilitates integration with existing business applications, device drivers, logging systems, and remote management interfaces, making it ideal for mass deployment of IoT terminals. This invention integrates fragmented script control into a unified state machine management system, achieving a complete closed loop from hotspot creation, webpage configuration, network writing to state detection. This completely resolves the technical shortcomings of traditional solutions, such as inconsistent state transitions and weak failure recovery mechanisms.
[0046] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0047] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, electronic devices, storage media, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0048] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0049] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0050] The foregoing has provided a detailed description of a WiFi connection system for desktopless embedded devices provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are merely for the purpose of helping to understand the method and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application. The above embodiments are merely preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the protection scope of the present invention.
Claims
1. A WiFi connectivity system for desktopless embedded devices, characterized in that, The system includes: The power-on service is used to automatically start on desktop-less embedded devices after power-on and to detect whether a valid network connection is currently available. The hotspot control module is used to control the wireless network card to create a temporary WiFi hotspot when the startup service detects that no valid network is connected. The Web configuration module is used to start a local HTTP service and provide a local configuration page to user terminals connected to the temporary WiFi hotspot. The WiFi scanning module is used to obtain information about surrounding wireless networks and display an optional list on the local configuration page through the Web configuration module. The network configuration writing module is used to receive the target WiFi credentials submitted by the user terminal through the local configuration page, perform format verification on the target WiFi credentials, write the verified target WiFi credentials into the network configuration, and control the wireless network card to switch to client mode to connect to the target router. The connection status detection module is used to detect whether the target router has successfully connected within a preset time. If the connection is successful, it controls the hotspot control module to turn off the temporary WiFi hotspot and return a success result. If the connection fails, it controls the hotspot control module to restore the temporary WiFi hotspot and displays the error reason on the local configuration page through the Web configuration module.
2. The system according to claim 1, characterized in that, The automatic startup service uses a background persistent service as a persistent process, and the Web configuration module uses the default browser Kestrel to provide local pages and interfaces; The automatic startup service also includes a state machine, which is used to write the status of the hotspot control module, web configuration module, WiFi scanning module, network configuration writing module, and connection status detection module at each step of the network configuration process into the local state machine for unified scheduling and management.
3. The system according to claim 1, characterized in that, The hotspot control module is also used for: A temporary hotspot name is generated using at least one of the following: device serial number, product model, and random code; When creating the temporary WiFi hotspot, set the hotspot password, device IP address, and DHCP address pool; If no one operates the network configuration for more than a preset time, the temporary WiFi hotspot will be automatically turned off or the hotspot password will be changed.
4. The system according to claim 1, characterized in that, The WiFi scanning module is also used for: Call the system scanning interface to obtain information about surrounding wireless networks; The acquired surrounding wireless network information is filtered to remove duplicate WiFi names, hidden networks, and networks with weak signals; The filtered WiFi name, signal strength, and encryption method are returned to the local configuration page for display.
5. The system according to claim 1, characterized in that, The system also includes a secure storage module, which is used to encrypt and save the WiFi password in the target WiFi credentials using at least one of the following methods: system key ring, file encryption, and device unique key derivation.
6. The system according to claim 1, characterized in that, The Web configuration module is also used for: When a user terminal accesses the local configuration page, it is required to enter at least one of the following: a one-time configuration code on the device label, scan the device QR code, or verify the initial password, in order to verify access rights; After successfully connecting to the target router, the connection completion information is sent to the user terminal through the local configuration page.
7. The system according to claim 1, characterized in that, The connection status detection module is also used for: The wireless interface status, IP address acquisition status, gateway reachability status, and Internet reachability status are cyclically detected within the preset time period. When the connection to the target router fails, the cause of failure is determined based on the status detection results. The cause of failure includes incorrect password, weak signal, DHCP acquisition failure, and router unreachable. The cause of failure is then displayed through the Web configuration module.
8. The system according to claim 1, characterized in that, The desktop-less embedded device is also connected to at least one of the following: indicator lights, buzzers, and voice prompt devices; The power-on auto-start service is also used to control at least one of the indicator lights, buzzers, and voice prompt devices to provide feedback to the user on the successful connection status after the target router is successfully connected.
9. The system according to claim 1, characterized in that, The network configuration writing module is also used for: Execute network commands through controlled process calls or system network management interfaces; Hotspot creation is accomplished through the hostapd or NetworkManager interface, and DHCP and DNS configuration is accomplished through dnsmasq or the NetworkManager built-in shared network.
10. The system according to any one of claims 1 to 9, characterized in that, The system is suitable for desktopless embedded devices running Linux and the .NET framework, wherein the desktopless embedded device includes at least a desktopless Raspberry Pi host.