# Does KFTPCLOSE correctly close FTP connection?

**URL:** <https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776>\
**Category:** Legacy HL Series\
**Created:** [February 5, 2021, 11:57am UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776 "2021-02-05T11:57:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 11:57am UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/1 "2021-02-05T11:57:28Z")

</div>

Hi,  
It seems that calling AT+KFTPCLOSE in HL7692 doesn’t send QUIT command over FTP Connection, and the ftp-server keep connection “alive” until timeout.

AT+KFTPCFG=1,“x.y.z.q”,“vXXX”,“vXXXa”,“3340”,1  
+KFTPCFG: 1  
…recv or send something  
AT+KFTPCLOSE=1,0  
OK

Modem Information:  
AT+GMM  
HL7692  
AT+GMR  
RHL769x.2.26.180400.201802141030.x7120m\_1

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 5, 2021, 12:59pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/2 "2021-02-05T12:59:27Z")

</div>

do you see the control channel of FTP (on port 3340 in your case)is closed after AT+KFTPCLOSE?

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 2:01pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/4 "2021-02-05T14:01:13Z")

</div>

> [@mt\_0x](#):
>
> No it isn’t closed. I look at FTP server log and QUIT command is never received

No it isn’t closed. I look at FTP server log and QUIT command is never received

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 5, 2021, 2:51pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/5 "2021-02-05T14:51:36Z")

</div>

does latest FW 2.27 have problem?

[https://source.sierrawireless.com/resources/airprime/software/hl7692-firmware/#sthash.HepkauHF.dpbs](https://source.sierrawireless.com/resources/airprime/software/hl7692-firmware/#sthash.HepkauHF.dpbs)

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 2:54pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/6 "2021-02-05T14:54:14Z")

</div>

Sincerely I don’t know, my modules are now all soldered and I can’t easily upgrade

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 5, 2021, 2:55pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/7 "2021-02-05T14:55:15Z")

</div>

you don’t have USB port?

Can you also install wireshark in your FTP server to see if the TCP connection on port 3340 is closed after the command?

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 2:56pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/8 "2021-02-05T14:56:15Z")

</div>

No ☹  
Is there a changelog for 2.27?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 5, 2021, 2:56pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/9 "2021-02-05T14:56:59Z")

</div>

Can you also install wireshark in your FTP server to see if the TCP connection on port 3340 is closed after the command?

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 2:59pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/10 "2021-02-05T14:59:46Z")

</div>

Yes I can, tomorrow I will try

Thank you

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 4:52pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/11 "2021-02-05T16:52:56Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/a/a1b4a9a088628d7fac8661892e1f7fd3bad97009.png)  
Not only the connection is not closed sending QUIT command after AT+KFTPCLOSE, but  
the modem continue sending NOOP command every 2 minutes for 10 minutes.

After 10 minutes from successful transfer the QUIT command arrives to the FTP server

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 5, 2021, 5:10pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/12 "2021-02-05T17:10:30Z")

</div>

When did you type at+kftpclose?

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 5, 2021, 5:12pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/13 "2021-02-05T17:12:19Z")

</div>

After 37.0 second from the session beginning (just after the transfer complete)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 6, 2021, 1:06am UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/14 "2021-02-06T01:06:54Z")

</div>

how about using the following? Is it same behavior?

AT+KFTPCLOSE=1,1  
AT+ KFTPCFGDEL=1

If + KFTPCFGDEL is successfully, according to the AT command user guide, the connection should be closed.

---

<div class="post-metadata">

**Author:** ![mt\_0x](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mt\_0x](https://forum.sierrawireless.com/u/mt_0x)\
**Post date:** [February 8, 2021, 2:50pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/15 "2021-02-08T14:50:47Z")

</div>

Just tried, nothing changed. The connection remains open even after AT+ KFTPCFGDEL=1

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 8, 2021, 3:36pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/16 "2021-02-08T15:36:06Z")

</div>

how about AT+KCNXDOWN=1,1

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 10, 2021, 1:00pm UTC](https://forum.sierrawireless.com/t/does-kftpclose-correctly-close-ftp-connection/22776/17 "2021-02-10T13:00:21Z")

</div>

I can see the TCP connection is closed after +KFTPCLOSE.

AT+KCNXCFG=1,“GPRS”,“internet”  
OK  
AT+KFTPCFG=1,“xxx.xxx.xxx.xxx”,“username”,“password”,21,1  
+KFTPCFG: 1

OK

+KCNX\_IND: 1,4,1

+KCNX\_IND: 1,1,0

+KFTP\_IND: 1,1  
AT+KFTPRCV=1,"",“2222.txt”  
CONNECT  
2222–EOF–Pattern–  
OK

+KFTP\_IND: 1,2,4  
AT+KFTPCLOSE=1  
OK

+KCNX\_IND: 1,5,30

+KCNX\_IND: 1,0,0  
ati3  
RHL769x.2.24.173100.201709051100.x7120m\_1

OK  
ati9  
RHL769x.2.24.173100.201709051100.x7120m\_1  
HL7692  
HL769x.2.24  
x7120m  
FUSED  
2017-09-05 11:32:03  
r10943

OK

 ![image](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/1/199c33a928c0d16ba69ff94bd36034dee2b18216.png)
