M66: Unable to download file bigger than 100kB

Hello,

We are using Quectel M66 GSM module in out IoT device with firmware version M66FAR02A05BT.

I have implemented file downloading from server via HTTP. The file is first downloaded to modem UFS memory using AT+QHTTPGET and AT+QHTTPDL commands. When it is downloaded successfully, it is read and copied to device’s FLASH memory by 2048B packets. This operation is running smoothly when file size is not greater than 100kB. Otherwise we are receiving invalid data in packet that exceed 100kB. Please check my commands flow after registration to network below:

[...]

MODEM: checking TCP/IP state
>>> AT+QISTAT

MODEM: TCP/IP initial
MODEM: setting APN
>>> AT+QIREGAPP="netland.iot.test","",""

MODEM: set APN ok
MODEM: checking TCP/IP state
>>> AT+QISTAT

MODEM: TCP/IP start
MODEM: activating PDP context
>>> AT+QIACT

MODEM: PDP context activated
MODEM: disabling HTTP header
>>> AT+QHTTPCFG="responseheader",0

MODEM: HTTP header disabled
MODEM: setting firmware file URL
>>> AT+QHTTPURL=79,5

MODEM: URL = http://iot.netland.com.pl:18030/f/d/nl_hakar_pls_gsm/869247041829174/5d8023d6c2
>>> http://iot.netland.com.pl:18030/f/d/nl_hakar_pls_gsm/869247041829174/5d8023d6c2
MODEM: firmware file URL set
MODEM: sending HTTP GET
>>> AT+QHTTPGET=60,300

MODEM: downloading file from HTTP
>>> AT+QHTTPDL="firmware.bin",500000,300

MODEM: content length = 277888
MODEM: result = 0
MODEM: writing firmware file to FLASH
>>> AT+QFOPEN="firmware.bin", 2

MODEM: file 19202049 opened
>>> AT+QFSEEK=19202049,0,0

>>> AT+QFREAD=19202049,2048

MODEM: 2048/277888
>>> AT+QFSEEK=19202049,2048,0

>>> AT+QFREAD=19202049,2048

MODEM: 4096/277888
>>> AT+QFSEEK=19202049,4096,0

>>> AT+QFREAD=19202049,2048

MODEM: 6144/277888
>>> AT+QFSEEK=19202049,6144,0

>>> AT+QFREAD=19202049,2048

// Reading file by 2048B packets

[...] 

// At packet which exceed 100kB size I am getting some random bytes and its size don't match

MODEM: 98304/277888

>>> AT+QFSEEK=19202049,98304,0

>>> AT+QFREAD=19202049,2048

>>> AT+QFCLOSE=19202049

I have tried following workarounds so far:

  • Downloading file to modem RAM memory instead of UFS

  • Downloading file packets by AT+QHTTPGET and AT+QHTTPREAD

  • Writing own HTTP GET requests and send them using AT+QISEND, reading response with AT+QIRD

None on these solved the problem, I am still getting invalid data in response for packet exceeding 100kB.

I am using similar approach in other device with Quectel BG600L modem, where I download file to modem memory and then read it in the same way as above. There is no such issue in BG600L, I am successfully downloading files greater than 300kB.

I have found information that M66-OpenCPU reserves 100kB RAM space for the embedded application. Maybe the problem here is RAM memory overflow?

Thank you in advance for response,
Adam

If anyone here will face the same issue in future, I have resolved it by writing my own HTTP GET requests and sending them through TCP/IP using transparent mode.

So used commands are:
AT+QIMODE=1 - set transparent TCP mode
AT+QITCFG=5,2,256,1 - transparent mode configuration
AT+QIDNSIP=1 - set to 1 if domain name is used instead of IP address
AT+QIOPEN=“TCP”,<host_address>, - open TCP connection to server

Adam

1 Like

After these AT Commands do I have to call HTTP GET AT Command to download file???

Hi,

Actually I faced this problem when using AT+QHTTPGET command flow.
After AT commands enlisted in my solution I send buffer with my self-built HTTP request via AT+QISEND.

Adam

HI Actually I am trying to download file in SD Card, problem is download is not working with UFS or SD card, just working with RAM. Trying to built a work around. Can you help me with this??

Hello everyone,
I am using M66 GSM module and trying to download file from the server and save that file to RAM and I have tried following AT command.
AT+QICSGP=1,“vodafonegprs.com
OK
AT+QIREGAPP
OK
AT+QIACT

OK

AT+QHTTPURL=115,10
CONNECT

OK

AT+QHTTPGET=60
OK

AT+QHTTPDL=“RAM:file1_9_0.bin”,10240
OK

+QHTTPDL: 224,224,0
+QHTTPDL: 10240,3159232,4017 // this shows that file size is too large

I want to see the file how to open the file and read the file or copy that file to new file
I have tried below command to open the file but getting CME ERROR. if anyone have any suggestions please suggest how to download a file which is very big more than 1mb.
AT+QFOPEN=“RAM:file1_9_0.bin”,0
+CME ERROR: 3765

Thanku