FTP Download issues with HL7800

We are experiencing problems with downloading files from an FTP server. The idea is to download new firmware for our board.

As a test, we are trying to download a 100KB file from the FTP server and we receive the first 512 byte chunk, but things just hang up after that. Here is the command sequence:

AT+KFTPCFG=1,“ourftpserver.net”,“xxxxxxx”,“xxxxxxxx”,21
← +KFTPCFG: 1
← OK

← +KCNX_IND: 1,6
← +KCNX_IND: 1,1,0

→ AT+KFTPLS=1,“100KB.zip”
← +KFTPLS: 100KB.zip 102400
← OK

→ AT+KFTPRCV=1,“100KB.zip”,0,512
← CONNECT

← --EOF–Pattern–

→ AT+KFTPRCV=1,“100KB.zip”,512,512

NO more answer from here…

Do you have any ideas?

Hi @Rique,

I have just tried this case on my HL7800 module, it is successful when receive FTP data as you want.
Please refer this log:

[2021-04-22 14:14:50.907] ati
[2021-04-22 14:14:52.239] HL7800
[2021-04-22 14:14:52.239] 
[2021-04-22 14:14:52.239] OK
[2021-04-22 14:14:52.754] ati3
[2021-04-22 14:14:53.855] HL7800.4.6.8.0
[2021-04-22 14:14:53.855] 
[2021-04-22 14:14:53.855] OK
[2021-04-22 14:14:54.278] at+cereg?
[2021-04-22 14:14:56.347] +CEREG: 0,5
[2021-04-22 14:14:56.347] 
[2021-04-22 14:14:56.347] OK
[2021-04-22 14:15:06.702] at+cops?
[2021-04-22 14:15:08.559] +COPS: 0,0,"",7
[2021-04-22 14:15:08.575] 
[2021-04-22 14:15:08.575] OK
[2021-04-22 14:15:22.737] at+kcnxcfg=1,"GPRS","my APN"
[2021-04-22 14:15:23.810] OK
[2021-04-22 14:15:28.371] at+kftpcfg=1,"my FTP server","username","password"
[2021-04-22 14:15:28.970] +KFTPCFG: 1
[2021-04-22 14:15:29.008] 
[2021-04-22 14:15:29.008] OK
[2021-04-22 14:15:29.008] 
[2021-04-22 14:15:29.008] +KCNX_IND: 1,1,0
[2021-04-22 14:15:33.020] 
[2021-04-22 14:15:33.020] +KFTP_IND: 1,1
[2021-04-22 14:15:37.256] at&k3
[2021-04-22 14:15:38.803] OK
[2021-04-22 14:15:45.588] at+kftpls=1,,"100KB.zip"
[2021-04-22 14:15:47.004] +KFTPLS: 100KB.zip 102400
[2021-04-22 14:15:47.004] 
[2021-04-22 14:15:47.004] OK
[2021-04-22 14:15:47.004] 
[2021-04-22 14:15:47.004] +KFTP_IND: 1,2
[2021-04-22 14:15:54.188] at+kftprcv=1,,,"100KB.zip",,0,512
[2021-04-22 14:15:54.858] CONNECT
[2021-04-22 14:15:55.865] B¬ <vº!?÷Âóèáuðñ
[2021-04-22 14:15:55.865] #
[2021-04-22 14:15:55.865] nP/A7£3*»Ä,(¿¼AÄ©'Á?÷Ì4³¢hòÝ>ç»à³ÛV@[¿®1ì¢ð>
[2021-04-22 14:15:55.865] óyßo¢¡	f?ÃÍ?÷?èeíl°'äÕÀØÞÀ8XÒúuDõ¸º7þ|Ëw
[2021-04-22 14:15:55.865] ·Vìán¡/Ï_v?&'i·* ïfQZ8z?JÆ/L^{(V/âZ¤¹À/7[«|ôÌ£Ïu
[2021-04-22 14:15:55.865] Èè?ênN
[2021-04-22 14:15:55.865] ^3¼dÑ
[2021-04-22 14:15:55.865] ÐV(âÎÈ]s}sõ³
[2021-04-22 14:15:55.865] ù>ÁkkgôàÜtåc4rrÞé?SÂÿÙ>H?:^©`
[2021-04-22 14:15:55.865] *']äOsp¸óÕß
[2021-04-22 14:15:55.865] 	`«W4>0~²M·ÝÜ;Kúå
[2021-04-22 14:15:55.865] 
[2021-04-22 14:15:55.865] ÖmŽrÃXG¡íÛPßV·d(Ë$àÔ~Ùv½0ËI'
[2021-04-22 14:15:55.865]  AÄ,
[2021-04-22 14:15:55.865] 9k??#M
[2021-04-22 14:15:55.865] B¡¼Ä:ôjÿMÈ(µ#R¿.L?¨½h!Æ~N?u¿¼$¹Æj
[2021-04-22 14:15:55.865] 
[2021-04-22 14:15:55.865] ¢R1ïú'Ðq?ÊX,ãQØx½%&à·@¢p:ß^±U?Ç÷	Xo· (¹kQVql¿j]l¹{¯ÈÂÏp²Ù--EOF--Pattern--
[2021-04-22 14:15:59.133] OK
[2021-04-22 14:15:59.133] 
[2021-04-22 14:15:59.133] +KFTP_IND: 1,2,512
[2021-04-22 14:16:03.379] at+kftprcv=1,,,"100KB.zip",,512,512
[2021-04-22 14:16:04.188] CONNECT
[2021-04-22 14:16:04.856] %vÀéØ[ÖAñFQäIp%¢±](ílà¥(ÈÀ(ÑÁ /wÑõçÒ~¿ÑpekCoW××?ÁÝ Ó0[g?~Ø%¨"û쮡wì¶-mÊ;Z-
[2021-04-22 14:16:04.857] Q.ðqÑ;? t**ÛÑSÍCÊÖ5(ãÌÃÅ°ñÙ á"l}" ?ù?eè-,uúôl?C}¯ä¹àgJ-ý}*("½0ºÊĽ[>ì­)­î.ûÒ\¯ÌßncLj§­]2Ç;~"T¦]c ¢zpYTk
[2021-04-22 14:16:04.857] 
[2021-04-22 14:16:04.857] "uÖL±ÓÚY#P±¯ÜØy"p§ÒI\Kèg%³A¤à{¯R#çl+áÊIu;l=é
[2021-04-22 14:16:04.857] 
[2021-04-22 14:16:04.857] m»6.þ4ªÏOHñ¦×±+{[þÇÑDÉÝ_lËɱA9Õt!1éJoz½££?üFÖ®yr¦¹.ÊG?E<À3°_µwH:©úáÆ4(ÑQDw*ÌUÎú0§kÛtÅb?÷¢Ýh*¼8æR|w2ã!?TÎ{ÙúÁ-¿_"ðNù< .ù:7«
[2021-04-22 14:16:04.857] Ùhm³V
[2021-04-22 14:16:04.857] ødòÝy??R"bâ
[2021-04-22 14:16:04.857] Ý^'T[
[2021-04-22 14:16:04.857] #\ó7xÁ4<üÖ@7úÏp!¥À--EOF--Pattern--
[2021-04-22 14:16:07.894] OK
[2021-04-22 14:16:07.894] 
[2021-04-22 14:16:07.894] +KFTP_IND: 1,2,512

1, Can you share me what firmware is your HL7800 running? Is it the latest FW?
If your HL7800 is not running with the latest FW, please upgrade it to the latest FW then retry. Because this case is checked successfully on my module with the latest FW HL7800.4.6.8.0.
(You can get the latest HL7800 FW via page: https://source.sierrawireless.com/resources/airprime/software/hl7800-firmware/hl78xx-firmware-4,-d-,6,-d-,8,-d-,0/#sthash.x1m2AScD.dpbs )
2, Please check whether your FTP server support “offset” and “resume transfer”? If yes, can you retry, then capture and provide me the Wireshark log?

Thanks,

Hi there.
we are using the latest firmware. 4.6.8.0, I just double checked it.

Right now we are using a test ftp server on the internet so no direct access to get a wireshark from it. We are looking at creating our own FTP server, which will be located behind a firewall. Until then our tests are limited to this public FTP.

When we execute our commands in firmware, we get no response when we try to get the second chunk.

When I try to execute the commands manually, I get the following output:

ati
HL7800

OK
ati3
HL7800.4.6.8.0

OK

at+kcnxcfg=1,“GPRS”,“apn.ioe”
OK
AT+KFTPCFG=1,“yyyyyyy.net”,“xxxxxx”,“zzzzzzz”,21
+KFTPCFG: 1

OK

+KCNX_IND: 1,1,0

+KFTP_IND: 1,1
AT+KFTPLS=1,“100KB.zip”
+KFTPLS: 100KB.zip 102400

OK

+KFTP_IND: 1,2
at+kftprcv=1,“100KB.zip”,0,512
CONNECT
–EOF–Pattern–
OK

+KFTP_IND: 1,2,512
at+kftprcv=1,"100KB.zip,512,512
CONNECT

NO CARRIER

+KFTP_ERROR: 1,550

(though I may or may not get this error)

Hi @Rique,

Can you send me your log with .txt format to make sure that you do not have syntax issue?
Because following the log you attached in above comment, I see some syntax issue in +KFTPRCV command.

Thanks,

I see the typo you were talking about and I changed it. Below are two FTP connections.
One is trying to get the file from a working FTP server that is ours and located behind a firewall. This server works with no problems with a typical windows/linux or Mac FTP client…but fails with the HL7800.

The second seems to work much better, it is on a public FTP server. I don’t know the specifics of this server…but we did get more chunks downloaded until some kind of error.

I should mention that between the “connect” and the “EOF Patter” we do not get anything. Your example shows you got data…ours is bank.

Both of these tests were done by hand (not via a program).

FIRST TEST----------------------------------------------------------------------------------------

ati3
HL7800.4.6.8.0

OK
at+kcnxcfg=1,“GPRS”,“myapn”
OK
AT+KFTPCFG=1,“our.ftp.server”,“anonymous”,“password”,21
+KFTPCFG: 1

OK

+KCNX_IND: 1,1,0

+KFTP_IND: 1,1
AT+KFTPLS=1,“100KB.zip”
+CME ERROR: 907

+KFTP_ERROR: 1,2

<<<<<First attempt to a working FTP server behind a firewall fails to do a directory for the file -why???>>>>

SECOND TEST------------------------------------------------------------------------------------

+KFTP_ERROR: 1,2
AT+KFTPCFG=1,“public.FTP.server”,“anonymous”,“password”,21
+KFTPCFG: 2

OK

+KFTP_IND: 2,1
AT+KFTPLS=2,“100KB.zip”
+KFTPLS: 100KB.zip 102400

OK

+KFTP_IND: 2,2
at+kftprcv=2,“100KB.zip”,0,512
CONNECT
–EOF–Pattern–
OK

+KFTP_IND: 2,2,512
at+kftprcv=2,“100KB.zip”,512,512
CONNECT
–EOF–Pattern–
OK

+KFTP_IND: 2,2,512
at+kftprcv=2,“100KB.zip”,1024,512
CONNECT
–EOF–Pattern–
NO CARRIER

+KFTP_ERROR: 2,3

+KCNX_IND: 1,0,0

I have just tried again with downloading file with size 100KB from FTP Server successfully on my HL7800 device again. Yon can refer the log as below:
ftplog.txt (3.1 KB)
So can you share me some information by answering below questions?

  1. Do you enable HW flow control? If not, please enable by sending command AT&K3 then try again.
  2. In your comment:

Please make sure the path of the file “100KB.zip” that you want to download is correct then try again.

  1. I also see that FTP connection failure is caused by connection timeout:

So please make sure the data connection of your module is stable. You can check SIM data and your module’s antenna then try again. And can you upload log with .txt format for me to check if your command is right?

  1. If all above ways is not successful and the FTP server is not confidential, can you please share with me the credential. I can give a try on this FTP server. (You can send via message to only me)

Thanks,

Hi @Rique,

I have tried downloading your 100KB.zip file on my HL7800 module with 2 cases as below:
1, From your FTP Server:
FromYourServer.txt (1.7 KB)
2, From my FTP Server:
FromMyServer.txt (1.6 KB)

According to all logs, I can observe that FTP server sent full data of above file (based on value of data length in +KFTP_IND and my Wireshark log I captured ). But module cannot display this file.
So I have tried and opening your 100KB.zip file on my PC:
error
This file is damaged and cannot be opened. I think this is the reason of your issue.

Please check this file or upload a new normal file (you can try with text file first) and try again.

Thanks,