Quectel BG96 DFOTA User Guide V1.0

Quectel_BG96_DFOTA_User_Guide_V1.0

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 17

BG96 DFOTA User Guide
LTE Module Series
Rev. BG96_DFOTA_User_Guide_V1.0
Date: 2017-12-19
Status: Released
www.quectel.com
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 1 / 16
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
Quectel Wireless Solutions Co., Ltd.
7th Floor, Hongye Building, No.1801 Hongmei Road, Xuhui District, Shanghai 200233, China
Tel: +86 21 5108 6236
Email: info@quectel.com
Or our local office. For more information, please visit:
http://quectel.com/support/sales.htm
For technical support, or to report documentation errors, please visit:
http://quectel.com/support/technical.htm
Or email to: support@quectel.com
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION
AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE
FORBIDDEN WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF
DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR
REGISTRATION OF A UTILITY MODEL OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2017. All rights reserved.
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 2 / 16
About the Document
History
Revision
Date
Author
Description
1.0
2017-12-19
Matt YE/
Lucifer YAN
Initial
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 3 / 16
Contents
About the Document ................................................................................................................................... 2
Contents ....................................................................................................................................................... 3
Table Index ................................................................................................................................................... 4
1 Introduction .......................................................................................................................................... 5
2 Firmware Upgrade Procedure via DFOTA ......................................................................................... 6
2.1. Get Delta Firmware Package ...................................................................................................... 7
2.2. Put Delta Package on HTTP(S) Server ...................................................................................... 7
2.3. Check APN Setting...................................................................................................................... 7
2.4. Check Network Status ................................................................................................................. 8
2.5. Execute AT Command to Upgrade the Firmware ....................................................................... 8
3 Description of DFOTA AT Commands ............................................................................................... 9
3.1. AT+QFOTADL=<httpURL> Upgrade Firmware When Delta Package is Stored on HTTP(S)
Server ................................................................................................................................................... 9
3.2. AT+QFOTADL=<para> Upgrade Firmware When Delta Package is Stored in Local File
System ................................................................................................................................................. 11
4 Examples ............................................................................................................................................ 13
4.1. Upgrade Firmware from HTTPS Server by DFOTA ................................................................. 13
4.2. Upgrade Firmware from Local File System by DFOTA ............................................................ 14
5 Summary of Error Codes .................................................................................................................. 15
6 Appendix A References ..................................................................................................................... 16
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 4 / 16
Table Index
TABLE 1: SUMMARY OF <HTTP_ERR> CODES ............................................................................................ 15
TABLE 2: SUMMARY OF <ERR> CODES........................................................................................................ 15
TABLE 3: RELATED DOCUMENTS .................................................................................................................. 16
TABLE 4: TERMS AND ABBREVIATIONS ........................................................................................................ 16
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 5 / 16
1 Introduction
Quectel BG96 module supports DFOTA (Delta Firmware Upgrade Over-the-air) function, which allows
customers to upgrade the firmware over the air. It can upgrade the firmware to a new version, and revert
to the old version as well.
Before firmware upgrading, customers only need to prepare the firmware package which contains only
the differences between the old and new firmware versions. This reduces the amount of data transmitted
and accelerates the speed of firmware upgrade.
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 6 / 16
2 Firmware Upgrade Procedure via
DFOTA
The following chart illustrates the firmware upgrade procedure via DFOTA when the firmware package is
stored on HTTP(S) server.
1. Get delta
firmware package
HTTP(S)
Server
4. Automatically download
from HTTP(S) server via
LTE/GPRS network
LTE/GPRS
(HTTP(S))
Ext.
MCU
Quectel
Module
2. Put the package on
HTTP(S) server
3. Execute AT+QFOTADL
command
5. Automatically
upgrade the
modules
firmware
Figure 1: Firmware Upgrade Procedure via DFOTA
As shown in the above figure, customers only need to perform the following steps to upgrade the firmware
when the firmware package is stored on HTTP(S) server:
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 7 / 16
Step 1: Get the delta firmware package from Quectel.
Step 2: Put the delta firmware on HTTP(S) server.
Step 3: Execute AT+QFOTADL command. Then the module will automatically download the package
from HTTP(S) server via LTE/GPRS network (Step 4) and finally automatically upgrade the
modules firmware (Step 5).
2.1. Get Delta Firmware Package
Before upgrading, customers need to check the current firmware version (the old version) by executing
ATI command, and also need to know the target firmware version (the new version). Then the two
firmware versions should be provided for Quectel or the module supplier, to get the delta firmware
package.
2.2. Put Delta Package on HTTP(S) Server
When using the DFOTA function, customers need to setup an HTTP(S) server by themselves, for Quectel
does not provide such a server. Then please put the delta firmware package on the server, and record the
HTTP(S) path. The module will get the delta package from the path after executing corresponding AT
command.
2.3. Check APN Setting
After putting the delta firmware package on the HTTP(S) server, there is a need to check whether the APN
is set properly. For instance, the APN for Telstra (U)SIM card should be Telstra.internet, and the
relevant AT commands are listed below:
- Query APN: AT+CGDCONT?
- Set APN: AT+CGDCONT=1,"IP","Telstra.internet"
For more details about AT+CGDCONT, please refer to Quectel_BG96_AT_Commands_Manual.
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 8 / 16
2.4. Check Network Status
After APN setting confirmation, please check whether the data network is registered before firmware
upgrading.
The relevant AT commands are listed below:
- Query signal quality: AT+CSQ
- Query network registration status: AT+CREG? or AT+CGREG?
- Query the registered operator: AT+COPS?
For more details about the above commands, please refer to Quectel_BG96_AT_Commands_Manual.
2.5. Execute AT Command to Upgrade the Firmware
After APN setting and network status confirmation, customers need to execute AT+QFOTADL command.
Then the module will download the firmware package from the HTTP(S) server over the air and upgrade
the firmware automatically. For more details, please refer to Chapter 3.
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 9 / 16
3 Description of DFOTA AT Commands
AT+QFOTADL command enables automatic firmware upgrade for module via DFOTA. After executing the
command, the module will automatically download the package from HTTP(S) server. After the package
download is finished, the module will automatically upgrade the modules firmware. If firmware is
upgraded successfully, the module will reboot, otherwise it will return an error and exit from DFOTA.
3.1. AT+QFOTADL=<httpURL> Upgrade Firmware When Delta Package
is Stored on HTTP(S) Server
If the delta firmware package is stored on an HTTP(S) server, AT+QFOTADL=<httpRUL> command
should be executed to enable automatic firmware upgrade via DFOTA. Then the module will download
the delta package from the HTTP(S) server over the air and upgrade the firmware automatically.
Test Command
AT+QFOTADL=?
Response
OK
Write Command
AT+QFOTADL=<httpURL>
Response
OK
+QIND: "FOTA","HTTPSTART"
+QIND: "FOTA","HTTPEND",<http_err>
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING",<percent>
+QIND: "FOTA","UPDATING",<percent>
...
+QIND: "FOTA","RESTORE",<percent>
+QIND: "FOTA","RESTORE",<percent>
...
+QIND: "FOTA","END",<err>
If there is any error, response:
ERROR
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 10 / 16
Parameter
1. "RESTORE" means the process of copying the upgraded firmware to the original partition from
backup partition.
2. If the module is powered down during "RESTORE", the module will automatically enter into forced
upgrade mode when power up next time and continue upgrade from "RESTORE". The upgrade
interface is shown as below:
+QIND: "FOTA","Last upgrade was not finished,continue upgrade"
+QIND: "FOTA","RESTORE",1%
+QIND: "FOTA","RESTORE",2%
...
+QIND: "FOTA","RESTORE",100%
+QIND: "FOTA","END",0
3. If SSL certificates are needed while downloading the firmware package from an HTTPS server, then
they should be uploaded to /datatx of BG96, and must be renamed in accordance with the following
rules:
- The root certificate must be renamed into fota_cacert.pem;
- The client certificate must be renamed into fota_client_cert.pem;
- The private key must be renamed into fota_client_key.pem.
Quectel QEFS Explorer tool can be used to upload the certificates. For more details about the tool,
please refer to Quectel_BG96_QEFS_Explorer_User_Guide.
<httpURL> String format. The max length is 255 bytes. It should be started with "HTTP://" or
“HTTPS://, for example:
“HTTP://<http_server_URL>:<http_port>/<http_file_path>”.
<http_server_URL> String type. The IP address or domain name of the HTTP(S) server.
<http_port> Integer type. The port of the HTTP(S) server. The default value is 80. The range is
1-65535.
<http_file_path> String type. The file name in HTTP(S) server.
<http_err> Integer type. The HTTP(S) error code. 0 means upgraded successfully. Any other
value means an error. Please refer to Chapter 5 for more details.
<percent> Integer type. The upgrade progress in percentage.
<err> Integer type. 0 means upgraded successfully. Any other value means an error.
Please refer to Chapter 5 for more details.
NOTES
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 11 / 16
3.2. AT+QFOTADL=<para> Upgrade Firmware When Delta Package is
Stored in Local File System
If the delta firmware package has already been stored in the module’s file system, AT+QFOTADL=<para>
command should be executed to enable automatic firmware upgrade via DFOTA. Then the module will
upgrade the firmware automatically.
Parameter
1. "RESTORE" means the process of copying the upgraded firmware to the original partition from
backup partition.
2. The storage path for delta firmware package is /fota/update.zip. Both the path and the package name
cannot be modified. Customers can use the QEFS Explorer tool provided by Quectel to upload the
upgrade package.
3. If the module is powered down during "RESTORE", the module will automatically enter into forced
upgrade mode when power up next time and continue upgrade from "RESTORE". The upgrade
interface is shown as below:
Write Command
AT+QFOTADL=<para>
Response
OK
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING",<percent>
+QIND: "FOTA","UPDATING",<percent>
...
+QIND: "FOTA","RESTORE",<percent>
+QIND: "FOTA","RESTORE",<percent>
...
+QIND: "FOTA","END",<err>
If there is any error, response:
ERROR
<para> Integer type.
1 Start upgrade
<percent> Integer type. The upgrade progress in percentage.
<err> Integer type. 0 means upgraded successfully. Any other value means an error.
Please refer to Chapter 5 for more details.
NOTES
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 12 / 16
+QIND: "FOTA","Last upgrade was not finished,continue upgrade"
+QIND: "FOTA","START"
+QIND: "FOTA","RESTORE",1%
+QIND: "FOTA","RESTORE",2%
...
+QIND: "FOTA","RESTORE",100%
+QIND: "FOTA","END",0
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 13 / 16
4 Examples
4.1. Upgrade Firmware from HTTPS Server by DFOTA
//Upgrade firmware when delta firmware package is stored on an HTTPS server.
//The HTTPS server address is “https://www.quectel.com:100/update.zip".
AT+CGDCONT? //Query APN setting
+CGDCONT: 1,"IPV4V6","Telstra.internet","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
OK
AT+CSQ;+CREG?;+CGREG?;+COPS? //Query network status
+CSQ: 26,99
+CREG: 0,1
+CGREG: 0,1
+COPS: 0,0,"Telstra Mobile Telstra",7
OK
//Execute AT+QFOTADL command to enable automatic firmware upgrade via DFOTA, and then the
module will start to download the delta package and upgrade firmware automatically.
AT+QFOTADL="https://www.quectel.com:100/update.zip"
OK
+QIND: "FOTA","HTTPTART"
+QIND: "FOTA","HTTPEND",0 //Finish downloading the package from HTTPS server.
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING", 1%
+QIND: "FOTA","UPDATING", 2%
...
+QIND: "FOTA","UPDATING", 100%
+QIND: "FOTA","RESTORE", 1%
+QIND: "FOTA","RESTORE", 2%
...
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 14 / 16
+QIND: "FOTA","RESTORE", 100%
+QIND: "FOTA","END",0 //Finish upgrading the firmware.
4.2. Upgrade Firmware from Local File System by DFOTA
//The delta firmware package has already been stored in the modules file system.
//Execute AT+QFOTADL command to enable automatic firmware upgrade via DFOTA, and then the
module will start to download the firmware package and upgrade firmware automatically..
AT+QFOTADL=1
OK
+QIND: "FOTA","START"
+QIND: "FOTA","UPDATING", 1%
+QIND: "FOTA","UPDATING", 2%
...
+QIND: "FOTA","UPDATING", 100%
+QIND: "FOTA","RESTORE", 1%
+QIND: "FOTA","RESTORE", 2%
...
+QIND: "FOTA","RESTORE", 100%
+QIND: "FOTA","END",0 //Finish upgrading the firmware.
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 15 / 16
5 Summary of Error Codes
The error code indicates an error related to mobile equipment or network. The details about <http_err>
and <err> are described in the following tables.
Table 1: Summary of <http_err> Codes
<http_err>
Meaning
0
Download successful
701
HTTP(S) unknown error
Table 2: Summary of <err> Codes
<err>
Meaning
0
Upgraded successfully
504
Firmware upgrade failed
505
Upgrade package not exist
506
Upgrade package check failed
LTE Module Series
BG96 DFOTA User Guide
BG96_DFOTA_User_Guide 16 / 16
6 Appendix A References
Table 3: Related Documents
Table 4: Terms and Abbreviations
SN
Document Name
Remark
[1]
Quectel_BG96_AT_Commands_Manual
AT commands manual for BG96
[2]
Quectel_BG96_QEFS_Explorer_User_Guide
User guide for QEFS Explorer tool
Abbreviation
Description
DFOTA
Delta Firmware Upgrade Over-the-Air
GPRS
General Packet Radio Service
HTTP(S)
Hyper Text Transport Protocol (Secure)
LTE
Long Term Evolution

Navigation menu