Wireless equipment offline firmware upgrading method based on 2.4 G private protocol
Through the offline firmware upgrade method of wireless devices with 2.4G private protocol, the problem of firmware upgrade relies on the Internet in a network-free environment is solved, and low-cost and fast firmware upgrade is achieved, suitable for IoT devices and smart home devices.
Patent Information
- Application Number
- CN202510971385.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-07-15
Smart Images

Figure CN120469706A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of wireless communication technology, and in particular relates to a method for offline firmware upgrade of wireless devices based on a 2.4G private protocol. Specifically, it relates to a method for implementing firmware upgrade of wireless devices in an internet-free environment through a private protocol in the 2.4GHz frequency band (non-WiFi / Bluetooth). The method is suitable for scenarios such as IoT devices, smart home devices, and cost-sensitive consumer electronics. Background Art
[0002] Current firmware upgrades require a WiFi / Bluetooth connection to a cloud server, making them unusable in isolated or disconnected environments. Some devices also require a USB / UART wired connection, making them incompatible with sealed or embedded devices. Regarding protocol compatibility, public wireless protocols (such as Bluetooth DFU and Device Firmware Update) require devices to support a standard protocol stack; devices with proprietary protocols are incompatible.
[0003] Therefore, in view of the above situation, the existing firmware upgrade has the following main technical defects: 1. The current firmware upgrade relies on the Internet or mobile terminals and is not suitable for use in an environment without an Internet connection.
[0004] 2. Public wireless protocols (such as Bluetooth OTA) have slow upgrade speeds, complex pairing processes, and compatibility issues.
[0005] 3. Some firmware upgrades use differential upgrade algorithms, which are computationally complex and require high MCU performance, making them unsuitable for low-cost consumer electronics. Summary of the Invention
[0006] The purpose of the present invention is to provide a method and system for offline firmware upgrade of wireless devices based on a 2.4G private protocol. The main design is a low-cost method for establishing 2.4G private protocol communication between a local host and the device to be upgraded, so as to achieve the purpose of offline firmware upgrade with a simple communication protocol and without the need for Internet support.
[0007] To solve the above technical problems, the present invention provides a method for offline firmware upgrade of wireless devices based on a 2.4G private protocol, comprising: Power on the host to boot the host BootLoader module into the launch upgrade firmware mode; The host scans and evaluates the channel quality in the current environment, and selects 5 to 10 channels based on the evaluation results to generate a frequency hopping sequence. By starting the timer on the host side, the public channel is triggered to transmit and receive data regularly. The transmitted data content is a private protocol, which includes the packet header, the current working channel, the current firmware transmission status, the firmware package number, the valid data and the CRC check. By powering on the slave end, the slave BootLoader module is booted and loaded into the receiving and upgrading firmware mode; By starting the timer on the slave side, the public channel is triggered to receive and transmit data at regular intervals. When the slave side first detects data from the host side through the public channel scan, the data is returned on the public channel. The returned data content is a private protocol, which includes the packet header, the current working channel, the current firmware transmission status, the firmware package number, the response and the CRC check.
[0008] Preferably, the following communication process is also included between the host side and the slave side: The host sends a handshake signal carrying a frequency hopping sequence to wait for the slave to respond; When the slave receives the handshake signal and the data verification is successful, it indicates that the handshake is successful and sends a response signal back to the host. When the host receives the response signal from the slave, it enters the firmware data transmission phase. The data includes a package number, which is the unique identifier of the upgraded firmware. After receiving the data, the slave determines whether the packet number is a continuous packet. If so, it continues to check the correctness of the firmware data. If it is correct, it writes the corresponding firmware address and notifies the host to continue to send the next packet of firmware data. If not, it tells the host to send the firmware data of the current packet number again. When all firmware data has been transmitted, the host enters the end phase of the transmission communication. After receiving the end frame, the slave sends back a response signal and jumps to the firmware upgrade program area. The offline firmware upgrade is completed.
[0009] Preferably, before transmitting the upgraded firmware, the host side further comprises: reading the data of the firmware to be upgraded loaded on the host side in blocks, and storing the read data into a transmission cache array.
[0010] Preferably, when the host sends the frequency hopping sequence to the slave, the sending process is further included: The host sends the frequency hopping sequence to the slave during the handshake phase. After the handshake succeeds, the channel is switched from the public channel to the first channel of the frequency hopping sequence. The host calculates the bit error rate of the data transmitted on the current working channel; if the bit error rate exceeds the set threshold, the current working channel is switched to the second channel of the frequency hopping sequence; if the bit error rate does not exceed the set threshold, the current working channel continues to be used, and so on.
[0011] Preferably, when verifying the firmware data, the following verification process is also included: Verify the consistency between the packet header in the private protocol and the pre-set packet header; Verify the consistency between the channel in the private protocol and the current working channel; Verify the consistency between the package number in the private protocol and the pre-set package number; Compare the consistency between the CRC check in the private protocol and the calculated CRC check.
[0012] Preferably, the host side starts the timer to regularly open the transceiver window, so that the host side and the slave side can exchange data, and synchronize the time for opening the transceiver window next time to ensure timing synchronization.
[0013] Preferably, the transceiver window includes a Tx window and an Rx window; the host end opens the Tx window and the Rx window successively every 30ms, wherein the Tx window occupies 2ms and the Rx window is opened for 8ms; the slave end opens the Rx window and the Tx window successively, wherein the Rx window is opened for 8ms and the Tx window occupies 2ms; The frequency at which the slave opens the communication window is related to when the host Tx signal is received. Within the slave's Rx window, once data is received from the host, the slave sets this moment as the time anchor point and starts timing. After a certain time has passed, the Tx window is opened. The time adjustment must ensure that the slave's Tx window is within the host's Rx window. When the slave receives the next packet of data, the time anchor point is updated again.
[0014] Preferably, in the private protocol, the data frame size of the packet header, current working channel, current firmware transmission status and response is 1 byte, the data frame size of the firmware package number and CRC check is 2 bytes, and the data frame size of the valid data is 32 bytes.
[0015] The present invention also provides a wireless device offline firmware upgrade system based on a 2.4G private protocol, which adopts the wireless device offline firmware upgrade method based on a 2.4G private protocol as described above, including: The host BootLoader module is installed on the host side and is used to establish 2.4G communication between the host side and the slave side to send the upgraded firmware; The slave BootLoader module is installed on the slave side and is used to establish 2.4G communication between the slave side and the host side to receive the upgraded firmware; The adaptive frequency hopping module is installed on the master and slave ends and is used to evaluate the channel quality of the master end to generate a frequency hopping sequence and send it to the slave end; A private protocol module is installed on the host and slave ends and is used to provide the wireless data frame format for communication between the host and slave ends; The timing synchronization module is installed on the host and slave ends to provide an interactive mechanism for synchronization of the sending and receiving timing between the host and slave ends.
[0016] Preferably, a timer is also included to provide a timing function for the switching of working channels and the timing synchronization.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The present invention uses a 2.4G private protocol, adopts a data interaction timing synchronization mechanism and combines it with an adaptive frequency hopping method, and establishes a 2.4G private protocol communication between the local host and the device to be upgraded, thereby realizing offline firmware upgrade without Internet support. The communication protocol is simple and has the advantages of low cost and strong anti-interference. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The present invention provides a flowchart of a method for offline firmware upgrade of a wireless device based on a 2.4G private protocol.
[0019] Figure 2 This is a structural block diagram of a wireless device offline firmware upgrade system based on a 2.4G private protocol provided by the present invention.
[0020] Figure 3 This is a data diagram of the data frame format transmitted by the host side provided by the present invention.
[0021] Figure 4 This is a data diagram of the data frame format transmitted by the slave end provided by the present invention.
[0022] Figure 5 This is a schematic diagram of the communication timing between the host end and the slave end provided by the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description. It should be noted that the drawings are greatly simplified and not to exact scale, and are only used to facilitate and clearly illustrate the embodiments of the present invention.
[0024] like Figure 1 As shown, an embodiment of the present invention provides a method for offline firmware upgrade of a wireless device based on a 2.4G private protocol, comprising: The host enters transmit firmware upgrade mode by powering on and pressing a specific button (or other detectable operation). The host first scans and assesses the quality of the 2402MHz to 2530MHz channels in the current environment and generates a frequency hopping sequence.
[0025] The host starts the timer to transmit and receive data on the public channel at regular intervals. Before transmitting the upgraded firmware, it reads the firmware loaded by itself in blocks and stores it in the transmit buffer array. The transmitted data content belongs to the private protocol and includes the packet header, the current working channel, the current firmware transmission status, the firmware package number, the valid data and the CRC check. The host transmits the data frame as follows: Figure 3 shown.
[0026] The slave device boots and loads the slave BootLoader module by pressing a specific button (or other detectable operation) after powering on, and enters the mode of receiving upgraded firmware.
[0027] The slave starts the timer to receive and transmit data on the public channel at regular intervals. When the slave scans and monitors the data from the host on the public channel for the first time, it will return it on the public channel. The returned data content belongs to the private protocol and includes the packet header, current working channel, current firmware transmission status, firmware package number, response and CRC check. The slave transmits the data frame as follows: Figure 4 shown.
[0028] like Figure 2 As shown, an embodiment of the present invention further provides an offline firmware upgrade system for wireless devices based on a 2.4G private protocol, including a host end, a slave end, a host BootLoader module, a slave BootLoader module, an adaptive frequency hopping module, a private protocol module, and a timing synchronization module. The host end is used to load the firmware to be upgraded, transmit and receive wireless data, and exchange wireless data with the slave end; the slave end is used to transmit and receive wireless data, exchange wireless data with the host end, and obtain the upgraded firmware from the host end; the host BootLoader module is used to establish 2.4G communication between the host end and the slave end to send the upgraded firmware; the slave BootLoader module is used to establish 2.4G communication between the slave end and the host end to receive the upgraded firmware; the adaptive frequency hopping module is used by the host end to evaluate channel quality, generate a frequency hopping sequence, and send it to the slave end; the private protocol module is used to meet the wireless data frame format requirements for communication between the host end and the slave end; the timing synchronization module is used to synchronize the transmission and reception timing of the host end and the slave end, providing a stable data interaction timing mechanism.
[0029] As one of the preferred embodiments of the present invention, a timer is also included for timing switching of working channels, timing synchronization and other timing functions.
[0030] As one of the preferred embodiments of the present invention, the complete communication process between the host and the slave is also included: 1) The host sends a handshake signal (carrying a frequency hopping sequence) and waits for the slave to respond; 2) After receiving the handshake signal and verifying the data successfully, the slave device indicates that the handshake is successful and sends a response signal back to the host device, informing the host device that it can proceed to the next stage. 3) After the host receives the response from the slave, it enters the firmware data transmission phase. The data contains the package number as the unique identifier of the upgraded firmware; 4) After receiving the data, the slave side determines whether the packet number is a continuous packet to ensure the integrity of the firmware data. If it is, it will continue to verify the correctness of the firmware data. If it is correct, it will write the corresponding firmware address and inform the host side that it can continue to send the next packet of firmware data. Otherwise, it will tell the host side to send the firmware data of the current packet number again. 5) After all firmware data is transmitted, the host enters the end phase of the transmission communication. After receiving the end frame, the slave sends back a response signal and jumps to the firmware upgrade program area. The offline firmware upgrade is completed.
[0031] Among them, the timing synchronization mechanism is as follows: for example, the host side opens the Tx and Rx windows every 30ms, Tx occupies 2ms, and the Rx window is open for 8ms. The slave side opens the Rx and Tx windows in turn, the Rx window is open for 8ms, and Tx occupies 2ms. The frequency of opening the communication window on the slave side is related to when the host Tx signal is received. Within the Rx window of the slave side, once the data from the host side is received, the slave side will set this moment as the time anchor point and start timing. When the timing reaches a certain time, the Tx window will be opened. This time needs to be adjusted according to the actual program operation situation, so the time anchor point may be different, but the key to the adjustment is that the Tx window on the slave side must be within the Rx window on the host side. After the slave side receives the next packet of data, the time anchor point will be updated again. The communication diagram is as follows Figure 5 shown.
[0032] It should be noted that the host side starts the timer, regularly opens the send and receive window, exchanges data with the slave side, and synchronizes the time for opening the send and receive window next time.
[0033] As one of the preferred embodiments of the present invention, the verification process is as follows: first, check whether the packet header in the private protocol is consistent with the pre-set packet header, then check whether the channel in the private protocol is consistent with the current working channel, then check whether the packet number in the private protocol is consistent with the pre-set packet number, and finally compare the CRC check in the private protocol with the calculated CRC check to see if they are consistent.
[0034] As one of the preferred embodiments of the present invention, adaptive frequency hopping is that after the host side is powered on and enters the firmware upgrade mode, it first scans and evaluates the quality of the 2402MHz~2530MHz channels in the current environment, selects 5~10 channels according to the evaluation results, and generates a frequency hopping sequence.
[0035] The host sends a frequency hopping sequence to the slave during the handshake phase. After a successful handshake, the host switches the channel from the public channel to the first channel of the frequency hopping sequence. In subsequent communications, the host calculates the bit error rate of the data transmitted on the current channel. If the bit error rate exceeds the set threshold, the current working channel is switched to the second channel of the frequency hopping sequence; if the bit error rate does not exceed the set threshold, the current channel continues to be used, and so on.
[0036] The above description is only a description of the preferred embodiments of the present invention and does not limit the scope of the present invention. Any changes and modifications made by ordinary technicians in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.
Claims
1. A method for offline firmware upgrade of wireless devices based on 2.4G private protocol, characterized in that: include: Power on the host to boot the host BootLoader module into the launch upgrade firmware mode; The host scans and evaluates the channel quality in the current environment, and selects 5 to 10 channels based on the evaluation results to generate a frequency hopping sequence. By starting the timer on the host side, the public channel is triggered to transmit and receive data regularly. The transmitted data content is a private protocol, which includes the packet header, the current working channel, the current firmware transmission status, the firmware package number, the valid data and the CRC check. By powering on the slave end, the slave BootLoader module is booted and loaded into the receiving and upgrading firmware mode; By starting the timer on the slave side, the public channel is triggered to receive and transmit data at regular intervals. When the slave side first detects data from the host side through the public channel scan, the data is returned on the public channel. The returned data content is a private protocol, which includes the packet header, the current working channel, the current firmware transmission status, the firmware package number, the response and the CRC check.
2. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 1, wherein: It also includes the following communication process established between the host and the slave: The host sends a handshake signal carrying a frequency hopping sequence to wait for the slave to respond; When the slave receives the handshake signal and the data verification is successful, it indicates that the handshake is successful and sends a response signal back to the host. When the host receives the response signal from the slave, it enters the firmware data transmission phase. The data includes a package number, which is the unique identifier of the upgraded firmware. After receiving the data, the slave determines whether the packet number is a continuous packet. If so, it continues to check the correctness of the firmware data. If it is correct, it writes the corresponding firmware address and notifies the host to continue to send the next packet of firmware data. If not, it tells the host to send the firmware data of the current packet number again. When all firmware data has been transmitted, the host enters the end phase of the transmission communication. After receiving the end frame, the slave sends back a response signal and jumps to the firmware upgrade program area. The offline firmware upgrade is completed.
3. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 1, wherein: Before transmitting the upgraded firmware, the host side further comprises: reading the data of the firmware to be upgraded loaded on the host side in blocks, and storing the read data into a transmission buffer array.
4. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 1, wherein: When the host sends the frequency hopping sequence to the slave, the sending process also includes the following: The host sends the frequency hopping sequence to the slave during the handshake phase. After the handshake succeeds, the channel is switched from the public channel to the first channel of the frequency hopping sequence. The host calculates the bit error rate of the data transmitted on the current working channel; if the bit error rate exceeds the set threshold, the current working channel is switched to the second channel of the frequency hopping sequence; if the bit error rate does not exceed the set threshold, the current working channel continues to be used, and so on.
5. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 2, wherein: When verifying the firmware data, the following verification process is also included: Verify the consistency between the packet header in the private protocol and the pre-set packet header; Verify the consistency between the channel in the private protocol and the current working channel; Verify the consistency between the package number in the private protocol and the pre-set package number; Compare the consistency between the CRC check in the private protocol and the calculated CRC check.
6. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 1, wherein: The host side starts the timer to regularly open the transceiver window, so that the host side and the slave side can exchange data, and synchronize the time for opening the transceiver window next time to ensure timing synchronization.
7. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 6, wherein: The transceiver window includes a Tx window and an Rx window; the host side opens the Tx window and the Rx window successively every 30ms, wherein the Tx window occupies 2ms and the Rx window is opened for 8ms; the slave side opens the Rx window and the T window successively, wherein the Rx window is opened for 8ms and the T window occupies 2ms; The frequency at which the slave opens the communication window is related to when the host Tx signal is received. Within the slave's Rx window, once data is received from the host, the slave sets this moment as the time anchor point and starts timing. After a certain time has passed, the Tx window is opened. The time adjustment must ensure that the slave's Tx window is within the host's Rx window. When the slave receives the next packet of data, the time anchor point is updated again.
8. The method for offline firmware upgrade of a wireless device based on a 2.4G private protocol according to claim 1, wherein: In the private protocol, the data frame size of the packet header, current working channel, current firmware transmission status and response is 1 byte, the data frame size of the firmware package number and CRC check is 2 bytes, and the data frame size of the valid data is 32 bytes.
9. A wireless device offline firmware upgrade system based on a 2.4G private protocol, using a wireless device offline firmware upgrade method based on a 2.4G private protocol according to any one of claims 1 to 8, characterized in that: include: The host BootLoader module is installed on the host side and is used to establish 2.4G communication between the host side and the slave side to send the upgraded firmware; The slave BootLoader module is installed on the slave side and is used to establish 2.4G communication between the slave side and the host side to receive the upgraded firmware; The adaptive frequency hopping module is installed on the master and slave ends and is used to evaluate the channel quality of the master end to generate a frequency hopping sequence and send it to the slave end; A private protocol module is installed on the host and slave ends and is used to provide the wireless data frame format for communication between the host and slave ends; The timing synchronization module is installed on the host and slave ends to provide an interactive mechanism for synchronization of the sending and receiving timing between the host and slave ends.
10. The wireless device offline firmware upgrade system based on 2.4G private protocol according to claim 9, characterized in that: It also includes a timer for providing a timing function for the switching of working channels and the timing synchronization.
Citation Information
Patent Citations
Remote software upgrading technique
CN102075564A
Method for transmitting and receiving upgrade documents, system, intelligent television and remote controller
CN104602114A
Point-to-point multi-channel network building method and system of private protocol
CN112165733A
Wireless remote controller upgrading method and system
CN112711431A
Multi-transmitting and one-receiving wireless microphone based on 2.4 G private protocol and use method thereof
CN115987328A