Contact Information and Legal Notices
Quectel Wireless Solutions Co., Ltd.
Building 5, Shanghai Business Park Phase III (Area B), No.1016 Tianlin Road, Minhang District, Shanghai 200233, China
Tel: +86 21 5108 6236
Email: info@quectel.com
For more information on local offices, please visit: http://www.quectel.com/support/sales.htm.
For technical support or to report documentation errors, please visit: http://www.quectel.com/support/technical.htm or email: support@quectel.com.
Legal Notices
The information provided is based on your requirements and Quectel makes every effort to ensure its quality. Users are responsible for using independent analysis and evaluation in designing intended products. Reference designs are provided for illustrative purposes only. Before using any hardware, software, or service guided by this document, please read this notice carefully. Quectel provides this document and related services on an "as available" basis and may revise it at its sole discretion without prior notice.
Use and Disclosure Restrictions
License Agreements
Documents and information provided by Quectel shall be kept confidential unless specific permission is granted and shall not be accessed or used for any purpose except as expressly provided herein.
Copyright
Quectel and third-party products may contain copyrighted material. Such material shall not be copied, reproduced, distributed, merged, published, translated, or modified without prior written consent. Quectel and the third party hold exclusive rights over copyrighted material. No license is granted under any patents, copyrights, trademarks, or service mark rights. Purchasing in any form does not grant a license other than the normal non-exclusive, royalty-free license to use the material. Quectel reserves the right to take legal action for noncompliance with these requirements.
Trademarks
This document does not confer any rights to use any trademark, trade name, name, abbreviation, or counterfeit product thereof owned by Quectel or any third party in advertising, publicity, or other aspects.
Third-Party Rights
This document may refer to hardware, software, and/or documentation owned by third parties. Use of such third-party materials is governed by all applicable restrictions and obligations. Quectel makes no warranty or representation, express or implied, regarding third-party materials, including but not limited to warranties of merchantability, fitness for a particular purpose, quiet enjoyment, system integration, information accuracy, and non-infringement of third-party intellectual property rights. Quectel does not represent or warrant to develop, enhance, modify, distribute, market, sell, offer for sale, or otherwise maintain production of its products or any other hardware, software, device, tool, information, or product. Quectel disclaims all warranties arising from the course of dealing or usage of trade.
Privacy Policy
To implement module functionality, certain device data may be uploaded to Quectel's or third-party's servers. Quectel, abiding by relevant laws and regulations, will retain, use, and disclose relevant data solely for performing the service or as permitted by applicable laws. Users should be informed of third parties' privacy and data security policies before data interaction.
Disclaimer
- Quectel acknowledges no liability for any injury or damage arising from reliance upon the information.
- Quectel shall bear no liability resulting from any inaccuracies or omissions, or from the use of the information contained herein.
- While efforts have been made to ensure functions and features under development are error-free, inaccuracies and omissions may still exist. Unless otherwise provided by valid agreement, Quectel makes no warranties of any kind and excludes all liability for loss or damage suffered in connection with the use of features and functions under development, to the maximum extent permitted by law.
- Quectel is not responsible for the accessibility, safety, accuracy, availability, legality, or completeness of information, advertising, commercial offers, products, services, and materials on third-party websites and resources.
About the Document
Revision History
Version | Date | Author | Description |
---|---|---|---|
- | 2020-04-13 | Fonda FANG | Creation of the document |
1.0 | 2020-04-13 | Fonda FANG | First official release |
1.1 | 2023-10-20 | Miles MA | Added the applicable module BC95-GR. Updated the document name from "Application Note" to "Upgrade Guide". |
1.2 | 2024-09-25 | Howie DONG | Added the chapter of DFOTA implementation and user responsibility (Chapter 1.1). Optimized the DFOTA firmware upgrade flowchart to distinguish between the user side and the Quectel side (Figure 1). Optimized the description of the DFOTA firmware upgrade steps and added relevant notes to distinguish between the user side and the Quectel side (Chapter 2). Updated the declaration of AT command examples (Chapter 3.2). Optimized the explanation of the parameters <HTTP_server_URL> and <HTTP_URL> (Chapter 3.3.1 and Chapter 3.3.3). Updated the URL address and related instructions in the command example (Chapter 4). |
Introduction
Quectel BC65, BC92, and BC95-GR modules support the DFOTA (Delta Firmware Over-The-Air) feature, which allows customers to upgrade or downgrade firmware wirelessly. In DFOTA, a delta firmware package, containing only the differences between the current and target firmware versions, is used. This reduces the amount of data transmitted and the time consumed. This document describes how to upgrade the firmware of Quectel BC65, BC92, and BC95-GR modules via DFOTA.
DFOTA Implementation and User Responsibility
Quectel follows industry best practices for module firmware updates by enabling users to offer DFOTA updates. Quectel does not have the ability to unilaterally push updates to users' devices; full control of the DFOTA process is handed to users. Quectel solely provides the updated firmware but cannot initiate DFOTA updates on users' devices. Users can determine when to push updates to the Quectel modules using the DFOTA mechanism by configuring parameters for updates hosted on their own infrastructures.
DFOTA Procedure
The following chart illustrates the firmware upgrade procedure via DFOTA when the firmware package is stored on an HTTP server.
This flowchart depicts the DFOTA process. On the User Side, a user's host obtains a delta firmware package from Quectel Technical Support or a user MCU file, uploads it to a user-owned HTTP server, and then sends an AT+QFOTADL command to trigger the automatic firmware upgrade on the module. On the Quectel Side, the module checks its network status (NB-IoT/GSM), automatically downloads the firmware package from the user-owned HTTP server via the NB-IoT/GSM network, and then automatically upgrades its firmware.
Customers need to perform the following steps to upgrade the firmware when the firmware package is stored on an HTTP server:
- Step 1: Acquire the delta firmware package from Quectel Technical Support or using a user MCU file (see Chapter 2.1 for details).
- Step 2: Upload the delta firmware package from the host to your HTTP server (see Chapter 2.2 for details).
- Step 3: Check the status of the network (see Chapter 2.3 for details).
- Step 4: Execute AT+QFOTADL on the host to trigger automatic firmware upgrade on the module (see Chapter 2.4 for details).
- Step 5: The module automatically downloads the firmware package from your HTTP server via NB-IoT network or GSM network.
- Step 6: The module internally runs the updating program to automatically upgrade the module firmware.
NOTE:
- Since BC92 supports both NB-IoT and GSM networks, it can download upgrade files through the GSM network.
- When BC92 is under a GSM network, it is necessary to manually configure PDP and activate IP with the command AT+CGDCONT after Step 3.
- Refer to document [1] or document [2] for more details about AT commands other than AT+QFOTADL in this chapter.
- You are responsible for providing and managing the HTTP server for the firmware upgrade. Quectel does not supply the server or assist with its setup.
Acquire Delta Firmware Package
Before firmware upgrading, the current firmware version needs to be checked by executing ATI, and the target firmware version needs to be decided. Customers should then send the two firmware versions to Quectel Technical Support to obtain the corresponding firmware package.
Upload Delta Package to HTTP Server
- Step 1: Set up an HTTP server before using DFOTA (Quectel does not provide such a server).
- Step 2: After the delta firmware package is uploaded to the server and the HTTP path is recorded, the module can acquire the delta firmware package through the HTTP path by executing the corresponding AT command.
NOTE: Please record the HTTP path (URL) to which the delta firmware package is uploaded for the AT+QFOTADL command in Chapter 3.
Check Network Status
After the module is powered on, ensure it is registered on the network before firmware upgrading.
Relevant AT commands are listed below:
AT+CESQ
: Query signal qualityAT+COPS?
: Query the network type and registration statusAT+CGPADDR
: Query allocated IP address
Execute AT Command to Upgrade the Firmware
After the network status is confirmed to be ready, execute AT+QFOTADL
on the host to initiate the automatic over-the-air download and upgrade of the module's delta firmware package. For more details about the DFOTA AT commands, please refer to Chapter 3.3.
Description of DFOTA AT Commands
AT Command Introduction
Definitions
<CR>
: Carriage return character.<LF>
: Line feed character.<...>
: Parameter name. Angle brackets do not appear on the command line.[...]
: Optional parameter of a command or an optional part of TA information response. Square brackets do not appear on the command line. When an optional parameter is not given in a command, the new value equals its previous value or the default settings, unless otherwise specified.- Underline: Default setting of a parameter.
AT Command Syntax
All command lines must start with AT or at and end with <CR>
. Information responses and result codes always start and end with a carriage return character and a line feed character: <CR><LF><response><CR><LF>
. In tables presenting commands and responses, only the commands and responses are presented, and <CR>
and <LF>
are deliberately omitted.
Command Type | Syntax | Description |
---|---|---|
Test Command | AT+<cmd>=? |
Test the existence of the corresponding command and return information about the type, value, or range of its parameter. |
Read Command | AT+<cmd>? |
Check the current parameter value of the corresponding command. |
Write Command | AT+<cmd>=<p1>[,<p2>[,<p3>[...]]] |
Set user-definable parameter value. |
Execution Command | AT+<cmd> |
Return a specific information parameter or perform a specific action. |
Declaration of AT Command Examples
The AT command examples in this document are provided to help users learn about the AT commands. The examples should not be taken as Quectel's recommendations for program flow or module status settings. Multiple examples for one AT command may be provided, but this does not imply correlation or a required sequence. URLs, domain names, IP addresses, usernames/accounts, and passwords in examples are for illustrative purposes only and should be modified to reflect actual usage and specific needs.
DFOTA AT Commands
The AT+QFOTADL
command enables automatic firmware upgrade for Quectel modules via DFOTA. After execution, the package is downloaded from the HTTP server. Upon successful download, the module starts its firmware upgrade. If successful, the module reboots; otherwise, it returns an error and exits DFOTA.
AT+QFOTADL=<HTTP_URL> DFOTA via HTTP Server
If the delta firmware package is stored on an HTTP server, execute AT+QFOTADL=<HTTP_URL>
to initiate the DFOTA upgrade. The module will download the delta firmware package wirelessly from the HTTP server and upgrade the firmware automatically.
DFOTA via HTTP Server | |
---|---|
Test Command | AT+QFOTADL=? |
Write Command | AT+QFOTADL=<HTTP_URL> |
Response | OK +QIND: "FOTA","HTTPSTART" +QIND: "FOTA","DOWNLOADING",<percent> +QIND: "FOTA","DOWNLOADING",<percent> ... +QIND: "FOTA","HTTPEND",<HTTP_err> |
Characteristics
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING",<percent>
+QIND: "FOTA","UPDATING",<percent>
- ...
+QIND: "FOTA","END",<FOTA_err>
- If there is any error:
ERROR
or+CME ERROR: <HTTP_err>
- The command takes effect immediately.
Parameter
Description | |
---|---|
<HTTP_URL> |
String format. The URL where the firmware package is stored on the HTTP server. Maximum length is 511 bytes. It should start with "http://" in the format: "http://<HTTP_server_URL>:<HTTP_port>/<HTTP_file_path>". |
<HTTP_server_URL> |
String type. The IP address or domain of the HTTP server owned and operated by you. |
<HTTP_port> |
Integer type. The port of the HTTP server. Default value is 80. Range is 1-65535. |
<HTTP_file_path> |
String type. The file path in the HTTP server. |
<HTTP_err> |
Integer type. The HTTP error code. 0 means downloaded successfully. Any other value indicates an error. Refer to Chapter 5 for details. |
<percent> |
Integer type. The download or upgrade progress in percentage. |
<FOTA_err> |
Integer type. 0 means upgraded successfully. Any other value indicates an error. Refer to Chapter 5 for details. |
NOTE: If the module is powered off when reporting +QIND: "FOTA","UPDATING",<percent>
, it will automatically enter force upgrade mode upon next power-on and continue the upgrading progress. The URC of the upgrade process is shown as below:
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING",0%
AT+QFOTADL=<para> Local Upgrade
If the delta firmware package already exists in the UFS directory of the module filesystem and is named "fota.pack", the upgrade process will be triggered by executing AT+QFOTADL=1
. If the package name is not "fota.pack", rename it using the filesystem-related AT command.
Local Upgrade | |
---|---|
Write Command | AT+QFOTADL=<para> |
Response | OK +QIND: "FOTA","START" +QIND: "FOTA","UPDATING",<percent> +QIND: "FOTA","UPDATING",<percent> ... +QIND: "FOTA","END",<FOTA_err> |
Characteristics
- If there is any error:
ERROR
or+CME ERROR: <HTTP_err>
- The command takes effect immediately.
Parameter
Description | |
---|---|
<para> |
Integer type. 1 Local Upgrade. |
<percent> |
Integer type. The download or upgrade progress in percentage. |
<HTTP_err> |
Integer type. The HTTP error code. 0 means downloaded successfully. Any other value indicates an error. Refer to Chapter 5 for details. |
<FOTA_err> |
Integer type. 0 means upgraded successfully. Any other value indicates an error. Refer to Chapter 5 for details. |
NOTE:
- Delta firmware packages can be transferred to the UFS directory using filesystem-related AT commands via the AT UART port. The filename must be "fota.pack"; otherwise, the upgrade process cannot be triggered correctly.
- If the module is powered off when reporting
+QIND: "FOTA","UPDATING",<percent>
, it will automatically enter force upgrade mode upon next power-on and continue the upgrading progress. The URC of the upgrade process is shown as below:
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING",0%
+QIND: "FOTA","UPDATING",10%
...
+QIND: "FOTA","END",0
- Refer to document [3] for the AT commands of the filesystem.
AT+QFOTADL=<para>,<HTTP_URL>[,<filename>] Download MCU File Via HTTP Server
If a file for an external MCU is uploaded to the HTTP server, it can be downloaded by executing AT+QFOTADL=<para>,<HTTP_URL>[,<filename>]
. The file will be saved in the UFS directory of the module filesystem. The filename can be specified by the <filename>
parameter or acquired from <HTTP_URL>
.
Download MCU File Via HTTP Server | |
---|---|
Write Command | AT+QFOTADL=<para>,<HTTP_URL>[,<filename>] |
Response | OK +QIND: "FOTA","HTTPSTART" +QIND: "FOTA","DOWNLOADING",<percent> +QIND: "FOTA","DOWNLOADING",<percent> ... +QIND: "FOTA","HTTPEND",<HTTP_err> If there is any error: ERROR or +CME ERROR: <HTTP_err> |
Characteristics
- The command takes effect immediately.
Parameter
Description | |
---|---|
<para> |
Integer type. 2 Download the file to the module via HTTP server. |
<filename> |
String type. File name. Specify the saving name of the file. |
<HTTP_URL> |
String type. The URL where the firmware package is stored on the HTTP server. Maximum length is 511 bytes. It should start with "http://" in the format: "http://<HTTP_server_URL>:<HTTP_port>/<HTTP_file_path>". |
<HTTP_server_URL> |
String type. The IP address or domain name of the HTTP server owned and operated by you. |
<HTTP_port> |
Integer type. The port of the HTTP server. Default value is 80. Range is 1-65535. |
<HTTP_file_path> |
String type. The file path in the HTTP server. |
<HTTP_err> |
Integer type. The HTTP error code. 0 means download successfully. Any other value indicates an error. Refer to Chapter 5 for details. |
<percent> |
Integer type. The download or upgrade progress in percentage. |
NOTE:
- The length of the filename cannot exceed 58 bytes when
<para>=2
, otherwise an error will be returned. If<filename>
is omitted, the module will first obtain the filename from the HTTP URL. If the filename is illegal, the default "mcu_update.bin" will be used. Then, use filesystem-related AT commands to operate it after downloading. - Refer to document [3] for the AT commands of the filesystem.
Examples
DFOTA via HTTP Server Under NB-IoT Network
You can perform the firmware upgrade after storing the delta firmware package on your HTTP server. The URL http://192.0.2.2:3029/update.pack
is used as an example URL below (provided for illustrative purposes only; replace it with a valid URL corresponding to your HTTP server and firmware package).
AT+COPS?
//Query network status.
+COPS: 0,2,"46011",9
//The fourth parameter 9 indicates a NB-IoT network.
OK
//Under NB-IoT network, the module will use the parameter configured by AT+QCGDEFCONT and automatically activate IP.
AT+CGDCONT?
+CGDCONT: 1,"IP","fast.t-mobile.com","192.0.2.2",0,0
OK
//Execute AT+QFOTADL to enable automatic firmware upgrade via DFOTA, and then the module will start to download the delta firmware package and upgrade firmware automatically.
AT+QFOTADL="http://192.0.2.2:3029/update.pack"
OK
+QIND: "FOTA","HTTPSTART"
//Download starts.
+QIND: "FOTA","DOWNLOADING",0%
+QIND: "FOTA","DOWNLOADING",10%
...
+QIND: "FOTA","DOWNLOADING",100%
+QIND: "FOTA","HTTPEND",0
//The package from HTTP server is successfully downloaded.
+QIND: "FOTA","START"
//Upgrade starts.
+QIND: "FOTA","UPDATING",0%
+QIND: "FOTA","UPDATING",10%
...
+QIND: "FOTA","UPDATING",100%
+QIND: "FOTA","END",0
//The firmware is successfully upgraded.
DFOTA via HTTP Server Under GSM Network (for BC92 Only)
You can perform the firmware upgrade after storing the delta firmware package on your HTTP server. Upgrade firmware when the delta firmware package is stored on an HTTP server. The URL http://192.0.2.2:3029/update.pack
is used as an example URL below (provided for illustrative purposes only; replace it with a valid URL corresponding to your HTTP server and firmware package).
AT+COPS?
//Query network status.
+COPS: 0,2,"46000",0
//The fourth parameter 0 indicates a GSM network.
OK
//When BC92 is under GSM network, it is needed to configure PDP and activate IP manually before downloading.
AT+CGDCONT=1,"IP"
//Configure PDP type to "IP".
OK
AT+CGACT=1,1
//Activate the PDP context.
OK
AT+CGDCONT?
+CGDCONT: 1,"IP",,"192.0.2.2",0,0
OK
//Execute AT+QFOTADL to enable automatic firmware upgrade via DFOTA, and then the module will start to download the delta firmware package and upgrade firmware automatically.
AT+QFOTADL="http://192.0.2.2:3029/update.pack"
OK
+QIND: "FOTA","HTTPSTART"
//Download starts.
+QIND: "FOTA","DOWNLOADING",0%
+QIND: "FOTA","DOWNLOADING",10%
...
+QIND: "FOTA","DOWNLOADING",100%
+QIND: "FOTA","HTTPEND",0
//The package from HTTP server is successfully downloaded.
+QIND: "FOTA","START"
//Upgrade starts.
+QIND: "FOTA","UPDATING",0%
+QIND: "FOTA","UPDATING",10%
...
+QIND: "FOTA","UPDATING",100%
+QIND: "FOTA","END",0
//The firmware is successfully upgraded.
Local Upgrade Process
The local upgrade process can be triggered by executing AT+QFOTADL=1
. First, ensure that the file already exists in the module filesystem and its name must be "fota.pack"; otherwise, the module will return an error.
AT+QFLST
//Check whether the file exists or not.
+QFLST: "fota.pack",20135
OK
AT+QFOTADL=1
OK
//Trigger the local upgrade process.
+QIND: "FOTA","START"
//Local upgrade starts.
+QIND: "FOTA","UPDATING",0%
+QIND: "FOTA","UPDATING",10%
...
+QIND: "FOTA","UPDATING",100%
+QIND: "FOTA","END",0
//Upgraded successful.
Download MCU File from HTTP Server Under NB-IoT Network
AT+COPS?
+COPS: 0,2,"46011",9
OK
//Query network status. The fourth parameter 9 indicates a NB-IoT network.
//The module will automatically activate the default PDN, which is set by AT+QCGDEFCONT in NB-IoT network.
AT+CGDCONT?
+CGDCONT: 1,"IP","fast.t-mobile.com","192.0.2.2",0,0
OK
//Execute AT+QFOTADL=2,<HTTP_URL>
to download the MCU upgrade file from the HTTP server and store it in the module. After the download is complete, the corresponding filesystem AT command can be used to operate this MCU upgrade file.
//The URL of the MCU file on the HTTP server is "http://192.0.2.2:3029/test.bin" (The URL is provided for illustrative purpose only. Please replace it with a valid URL that corresponds to your HTTP(S) server and firmware package.)
AT+QFOTADL=2,"http://192.0.2.2:3029/test.bin"
//Trigger the process.
OK
+QIND: "FOTA","HTTPSTART"
//Download starts.
+QIND: "FOTA","DOWNLOADING",0%
+QIND: "FOTA","DOWNLOADING",10%
...
+QIND: "FOTA","DOWNLOADING",100%
+QIND: "FOTA","HTTPEND",0
AT+QFLST
+QFLST: "test.bin",93368
OK
//The MCU file is successfully downloaded.
//List the files in the module filesystem.
Download MCU File from HTTP Server Under GSM Network (for BC92 Only)
AT+COPS?
+COPS: 0,2,"46000",0
OK
//Query network status. The fourth parameter 0 indicates a GSM network.
//When the BC92 is under a GSM network, please manually configure the PDP and activate the IP before downloading.
AT+CGDCONT=1,"IP"
//Configure PDP type to "IP".
OK
AT+CGACT=1,1
//Active the PDP context.
OK
AT+CGDCONT?
+CGDCONT: 1,"IP",,"192.0.2.2",0,0
OK
//Execute AT+QFOTADL=2,<HTTP_URL>
to download the MCU upgrade file from the HTTP server and store it in the module. After the download is complete, the corresponding filesystem AT command can be used to operate this MCU upgrade file.
//The URL of the MCU file on the HTTP server is "http://192.0.2.2:3029/test.bin" (The URL is provided for illustrative purpose only. Please replace it with a valid URL that corresponds to your HTTP(S) server and firmware package.)
AT+QFOTADL=2,"http://192.0.2.2:3029/test.bin"
OK
+QIND: "FOTA","HTTPSTART"
//Download starts.
+QIND: "FOTA","DOWNLOADING",0%
+QIND: "FOTA","DOWNLOADING",10%
...
+QIND: "FOTA","DOWNLOADING",100%
+QIND: "FOTA","HTTPEND",0
AT+QFLST
+QFLST: "test.bin",93368
OK
//The MCU file is successfully downloaded.
//List the files in the module filesystem.
Summary of Error Codes
The error code indicates an error related to mobile equipment or network. The details about <FOTA_err>
and <HTTP_err>
are described in the following tables.
Table 2: Summary of <HTTP_err> Codes
<HTTP_err> | Description |
---|---|
0 | Downloaded successfully |
6500 | Unknown mistake |
6501 | Illegal parameter |
6502 | Upgrade package is too large |
6503 | Download failed |
6504 | Upgrade package not found |
6505 | Upgrade package failed to write flash |
6506 | There are no differential packages in the module file system |
6507 | Differential packet verification error |
6509 | Allocate memory failed |
Table 3: Summary of <FOTA_err> Codes
<FOTA_err> | Description |
---|---|
0 | Upgraded successfully |
6508 | Upgrade failed |
Appendix References
Table 4: Related Documents
Document Name |
---|
[1] Quectel_BC65&BC95-GR_AT_Commands_Manual |
[2] Quectel_BC92_AT_Commands_Manual |
[3] Quectel_BC65&BC92&BC95-GR_Filesystem_Appliaction_Note |
Table 5: Terms and Abbreviations
Abbreviation | Description |
---|---|
DFOTA | Delta Firmware Over-The-Air |
GSM | Global System for Mobile Communication |
HTTP(S) | Hyper Text Transport Protocol (Secure) |
IP | Internet Protocol |
MCU | Microcontroller Unit |
NB-IoT | Narrowband Internet of Things |
PDP | Packet Data Protocol |
UFS | User File Storage |
URL | Uniform Resource Locator |