0% found this document useful (0 votes)
83 views

MC65&M65&M08-R: DFOTA Application Note

Uploaded by

jakepoy740
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

MC65&M65&M08-R: DFOTA Application Note

Uploaded by

jakepoy740
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

MC65&M65&M08-R

DFOTA Application Note

GSM/GPRS/GNSS Module Series

Rev. MC65&M65&M08-R_DFOTA_Application_Note_V1.0

Date: 2020-07-08

Status: Released

www.quectel.com
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:

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: [email protected]

Or our local office. For more information, 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 to: [email protected]

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. 2020. All rights reserved.

MC65&M65&M08-R_DFOTA_Application_Note 1 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

About the Document

Revision History

Version Date Author Description

Oven TAO/
1.0 2020-07-08 Initial
Simon HU

MC65&M65&M08-R_DFOTA_Application_Note 2 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

Contents

About the Document ................................................................................................................................... 2


Contents ....................................................................................................................................................... 3
Table Index ................................................................................................................................................... 4
Figure Index ................................................................................................................................................. 5

1 Introduction .......................................................................................................................................... 6

2 Firmware Upgrading Procedure via DFOTA ..................................................................................... 7


2.1. DFOTA Procedure over HTTP .................................................................................................... 7
2.1.1. Get Delta Firmware Package ........................................................................................... 8
2.1.2. Put Delta Firmware Package on HTTP Server ................................................................ 8
2.1.3. Check Network Status ...................................................................................................... 8
2.1.4. Configure and Activate PDP Context to Get IP Address ................................................. 9
2.1.5. Execute AT Command to Upgrade the Firmware ............................................................ 9
2.2. DFOTA Procedure over Local File System ................................................................................. 9
2.2.1. Get Delta Firmware Package ......................................................................................... 10
2.2.2. Upload Delta Firmware Package to Local File System ................................................. 10
2.2.3. Execute AT Command to Upgrade the Firmware .......................................................... 10

3 DFOTA Related AT Commands ........................................................................................................ 11


3.1. AT+QFOTADL=<HTTP_URL> Trigger DFOTA over HTTP ................................................... 11
3.2. AT+QFOTADL=<para> Trigger DFOTA over Local File System............................................ 13

4 Examples ............................................................................................................................................ 15
4.1. DFOTA over HTTP .................................................................................................................... 15
4.2. DFOTA over Local File System ................................................................................................. 16

5 Summary of Error Codes .................................................................................................................. 18

6 Appendix A References..................................................................................................................... 19

MC65&M65&M08-R_DFOTA_Application_Note 3 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

Table Index

Table 1: Summary of <FOTA_err> Codes.................................................................................................. 18


Table 2: Related Documents ...................................................................................................................... 19
Table 3: Terms and Abbreviations .............................................................................................................. 19

MC65&M65&M08-R_DFOTA_Application_Note 4 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

Figure Index

Figure 1: DFOTA Procedure over HTTP ...................................................................................................... 7


Figure 2: DFOTA Procedure over Local File System ................................................................................... 9

MC65&M65&M08-R_DFOTA_Application_Note 5 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

1 Introduction
Quectel MC65&M65&M08-R modules support DFOTA (Delta Firmware Upgrade Over-The-Air) function,
which allows you to upgrade or downgrade the firmware wirelessly. This document mainly describes how
to upgrade the firmware of Quectel MC65&M65&M08-R modules via DFOTA.

Before firmware updating, a delta firmware package which contains only the differences between the
source and the target firmware versions has to be obtained. In this way, the amount of data transmitted
and the time taken can be reduced.

NOTE

For MC65&M65&M08-R modules, the maximum number of DFOTA is 800. It is recommended not to
upgrade the firmware frequently because the Flash may be damaged when the number of DFOTA
exceeds 800.

MC65&M65&M08-R_DFOTA_Application_Note 6 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

2 Firmware Upgrading Procedure via


DFOTA

2.1. DFOTA Procedure over HTTP

The following chart illustrates the DFOTA procedure when the firmware package is stored on an HTTP
server.

HTTP
Server

2. Put the package on


an HTTP server

1. Get the delta firmware package GSM/GPRS


(HTTP)

6.Download the delta firmware package from HTTP


server via GSM/GPRS network

3. Check network status


4. Configure and activate PDP
Ext. context to get IP address Quectel
MCU Module
5. Execute AT+QFOTADL
7. Upgrade the
module s
firmware

Figure 1: DFOTA Procedure over HTTP

MC65&M65&M08-R_DFOTA_Application_Note 7 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

As shown in the above figure, the following steps need to be performed to update the firmware when the
firmware package is stored on an HTTP server:

Step 1: Get the delta firmware package from Quectel.


Step 2: Put the delta firmware package on HTTP server.
Step 3: Check network status.
Step 4: Configure and activate PDP context to get IP address.
Step 5: Execute AT+QFOTADL. Then the module will download the delta firmware package from HTTP
server via GSM/GPRS network (Step 6) and upgrade the firmware (Step 7).

2.1.1. Get Delta Firmware Package

Before updating, check the source firmware version with ATI command and confirm the target firmware
version, and then send the two firmware versions to Quectel or the module agents to get a delta firmware
package.

2.1.2. Put Delta Firmware Package on HTTP Server

Since Quectel does not provide such servers, an HTTP server needs to be established before using
DFOTA function. Then put the delta firmware package on the server, and record the storage path.

2.1.3. Check Network Status

Before firmware upgrading, check whether the module has registered on the network after it is powered
on.

The relevant AT commands are listed below:

 AT+CSQ: Query signal quality.


 AT+CGREG?: Query network registration status.

For more details about the above commands, please refer to document [1].

If the module has registered on the network, the PDP context can be configured and activated, otherwise
please check the insertion of the (U)SIM card and the connection of Antenna. If needed, please contact
Quectel Technical Supports Team.

MC65&M65&M08-R_DFOTA_Application_Note 8 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

2.1.4. Configure and Activate PDP Context to Get IP Address

After module registers on the network, configure and activate the PDP context to get IP address.

The relevant AT commands are listed below:

 AT+QIFGCNT=<id>: Select PDP context.


 AT+QICSGP=1[,<APN>,<user_name>,<password>]: Select GPRS as the bearer and configure
APN.
 AT+QIREGAPP: Start task.
 AT+QIACT: Activate PDP context to get IP address.

For more details about the above commands, please refer to document [1].

2.1.5. Execute AT Command to Upgrade the Firmware

After getting the IP address, execute AT+QFOTADL command and then the module will download the
delta firmware package from the HTTP server wirelessly and upgrade the firmware. For more details
about this command, please refer to Chapter 3.

2.2. DFOTA Procedure over Local File System

The following chart illustrates the DFOTA procedure when the firmware package is stored on local file
system.

1. Get the delta


firmware package

2. Execute AT+QFUPL command


to upload delta firmware package to
External local file system via file . Quectel
MCU Module
3. Execute AT+QFOTADL=1 to
upgrade the Firmware

Figure 2: DFOTA Procedure over Local File System

MC65&M65&M08-R_DFOTA_Application_Note 9 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

2.2.1. Get Delta Firmware Package

Before updating, check the source firmware version with ATI command and confirm the target firmware
version, and then send the two firmware versions to Quectel or the module agents to get a delta firmware
package.

2.2.2. Upload Delta Firmware Package to Local File System

The relevant AT command is listed below:

 AT+QFUPL=<file_name>[,<file_size>[,<timeout>[,<ackmode>]]]: upload file to local file system.

For more details about this command, please refer to document [2].

2.2.3. Execute AT Command to Upgrade the Firmware

After the delta is uploaded, execute AT+QFOTADL command to upgrade the firmware.

MC65&M65&M08-R_DFOTA_Application_Note 10 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

3 DFOTA Related AT Commands


The AT+QFOTADL command is used to trigger the firmware upgrading for module via DFOTA.

3.1. AT+QFOTADL=<HTTP_URL> Trigger DFOTA over HTTP

When the delta firmware package is stored on HTTP server, executing AT+QFOTADL=<HTTP_URL> will
make the module download the delta firmware package from the HTTP server. If downloading is
successful, the module will update the firmware. When updating completes successfully, the module will
reboot, otherwise it will return an error, exit from DFOTA and continue to run on the source firmware
version.

AT+QFOTADL=<HTTP_URL> Trigger DFOTA over HTTP


Test Command Response
AT+QFOTADL=? OK
Write Command Response
AT+QFOTADL=<HTTP_URL> OK

+QIND: "FOTA","HTTPSTART"

+QIND: "FOTA","DOWNLOADING",<percent>

+QIND: "FOTA","DOWNLOADING",<percent>

...

+QIND: "FOTA","HTTPEND",<FOTA_err>

+PDP DEACT

+QIND: "FOTA","START"

+QIND: "FOTA","UPDATING",<percent>

+QIND: "FOTA","UPDATING",<percent>
...
+QIND: "FOTA","END",<FOTA_err>

MC65&M65&M08-R_DFOTA_Application_Note 11 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

If the error is related to ME function:


+CME ERROR: <FOTA_err>
Maximum Response Time 300 ms
Take effect immediately (determined by network).
Characteristics
Remain invalid after powering down.

Parameter

<HTTP_URL> String format. The max length is 255 bytes. It should be started with
“HTTP://”, 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 server.
<HTTP_port> Integer type. The port of the HTTP server. Range: 1-65535. Default value: 80.
<HTTP_file_path> String type. The file name in HTTP server.
<FOTA_err> Integer type. The error code during downloading or upgrading.
0 Downloaded or updated successfully.
Others Error code. Please refer to Chapter 5 for more details.
<percent> Integer type. The download or upgrade progress in percentage. Range:
1-100. Unit: %.

NOTE

If the module is powered off during +QIND: "FOTA","UPDATING",<percent>, process, the module will
automatically enter forced upgrade mode. When it is powered on next time, it will continue to update. The
update interface is shown as below:
+QIND: "FOTA","START"

+QIND: "FOTA","UPDATING",2%

+QIND: "FOTA","UPDATING",4%
...
+QIND: "FOTA","END",0

MC65&M65&M08-R_DFOTA_Application_Note 12 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

3.2. AT+QFOTADL=<para> Trigger DFOTA over Local File System

When the delta firmware package is stored on Local File System, executing AT+QFOTADL=<para> will
make the module update the firmware. When updating completes successfully, the module will reboot,
otherwise it will return an error, exit from DFOTA and continue to run on the source firmware version.

AT+QFOTADL=<para> Trigger DFOTA over Local File System Firmware


Test Command Response
AT+QFOTADL=? OK
Write Command Response
AT+QFOTADL=<para> OK

+QIND: "FOTA","START"

+QIND: "FOTA","UPDATING",<percent>

+QIND: "FOTA","UPDATING",<percent>
...
+QIND: "FOTA","END",<FOTA_err>

If the error is related to ME function:


+CME ERROR: <FOTA_err>

Maximum Response Time 10 s


Take effect immediately (determined by network).
Characteristics
Invalid after powering down.

Parameter

<para> Integer type.


1 Start upgrade.
<percent> Integer type. The upgrade progress in percentage. Range: 1-100. Unit: %.
<FOTA_err> Integer type. The error code during downloading or upgrading.
0 Downloaded or updated successfully.
Others Error code. Please refer to Chapter 5 for more details.

NOTES

1. The delta firmware name must be "fota.pack".


2. If the baud rate of the module is configurated to a fixed value, the module will report +QIND:
"FOTA","UPDATING",<percent> via the same baud rate after reboot. If the baud rate of the module
is configurated to adaptive mode, the module will report +QIND: "FOTA","UPDATING",<percent>

MC65&M65&M08-R_DFOTA_Application_Note 13 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

via baud rate 115200.


3. If the module is powered off during +QIND: "FOTA","UPDATING",<percent>, the module will
automatically enter forced upgrade mode when powered on next time and continue the upgrading
progress. The upgrade interface is shown as below:
+QIND: "FOTA","START"

+QIND: "FOTA","UPDATING",2%

+QIND: "FOTA","UPDATING",4%
...
+QIND: "FOTA","END",0

MC65&M65&M08-R_DFOTA_Application_Note 14 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

4 Examples

4.1. DFOTA over HTTP

//Upgrade firmware when delta firmware package is stored on an HTTP server.

//The HTTP server address is “http://www.quectel.com:8111/DFOTA/A2B.pack”.

AT+CSQ;+CGREG?;+CPIN? //Query network status.


+CSQ: 25,0

+CGREG: 0,1

+CPIN: READY

OK
AT+QIFGCNT=0
OK
AT+QICSGP=1,"CMNET" //Configure the PDP context.
OK
AT+QIREGAPP
OK
AT+QIACT //Activate the PDP context to get IP address.
OK

//Execute AT+QFOTADL command to enable DFOTA over HTTP, and then the module will start to
download the delta firmware package and update firmware.

AT+QFOTADL="http://www.quectel.com:8111/DFOTA/A2B.pack"
OK

+QIND: "FOTA","HTTP START" //Start download

+QIND: "FOTA","DOWNLOADING",0% //Download progress

+QIND: "FOTA","DOWNLOADING",10%
...
+QIND: "FOTA","DOWNLOADING",100%

MC65&M65&M08-R_DFOTA_Application_Note 15 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

+QIND: "FOTA","HTTPEND",0 //Finish downloading the package from HTTP server.

+PDP DEACT

+QIND: "FOTA","START" //Start update

+QIND: "FOTA","UPDATING", 2% //Update progress

+QIND: "FOTA","UPDATING", 4%
...
+QIND: "FOTA","UPDATING", 100%

+QIND: "FOTA","END",0 //Upgraded successfully

4.2. DFOTA over Local File System

//Execute AT+QFUPL command to upload the delta firmware package to the local file system.

AT+QFUPL="fota.pack",156104 //The delta firmware name must be "fota.pack"


CONNECT //After this string is reported, the host starts to send file content to
module.

+QFUPL: 156104,4300

OK

//Execute AT+QFOTADL to enable DFOTA over Local File System, and then the module will start to
upgrade firmware.

AT+QFOTADL=1
OK

+QIND: "FOTA","START" //Start update

+QIND: "FOTA","UPDATING", 2% //Update progress

+QIND: "FOTA","UPDATING", 4%
...
+QIND: "FOTA","UPDATING", 100%

MC65&M65&M08-R_DFOTA_Application_Note 16 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

+QIND: "FOTA","END",0 //Upgraded successfully

MC65&M65&M08-R_DFOTA_Application_Note 17 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

5 Summary of Error Codes


The error code indicates an error related to mobile equipment or network. The details about <FOTA_err>
are described in the following tables.

Table 1: Summary of <FOTA_err> Codes

<FOTA_err> Meaning

6500 Unknown error

6501 Invalid parameter

6502 Package too large

6503 Download failed

6504 Package not found

6505 Write file failed

6506 Package not exist

6507 Package error

6508 Update failed

6509 No memory

MC65&M65&M08-R_DFOTA_Application_Note 18 / 19
GSM/GPRS/GNSS Module Series
MC65&M65&M08-R DFOTA Application Note

6 Appendix A References

Table 2: Related Documents

SN Document Name Remark

Quectel_ MC65&M65&M08-R _AT_Commands MC65&M65&M08-R AT commands


[1]
_Manual manual
File AT commands manual for GSM
[2] Quectel_GSM_FILE_AT_Commands_Manual
modules

Table 3: Terms and Abbreviations

Abbreviation Description

APN Access Point Name

DFOTA Delta Firmware Upgrade Over-The-Air

FOTA Firmware Over-The-Air

GPRS General Packet Radio Service

GSM Global System for Mobile Communications

HTTP Hypertext Transfer Protocol

IP Internet Protocol

PDP Packet Data Protocol

URL Uniform Resource Locator

MC65&M65&M08-R_DFOTA_Application_Note 19 / 19

You might also like