migsantiago
Newbie level 3
- Joined
- Jan 29, 2010
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,305
Hello
I was wondering if somebody knew how to download an FTP file in parts... let's say, the file is 1024 bytes in size... I download only 32 bytes from it and then I disconnect the FTP. I come back and then I reconnect the FTP and I start to download from the position 32.
The problem is that there is no way on the SIM908 to disconnect from the FTP server... a timeout has to happen to do so.
I ask the module to connect:
AT+FTPGET=1
It replies:
OK
+FTPGET:1,1
And then I ask it to read 32 bytes from the 1024 bytes file:
AT+FTPGET=2,32
It replies:
+FTPGET:2,32
12345678901234567890123456789012
OK
The problem is that if I ask only for some bytes from the file, the current FTP operation remains active, the SIM908 is still connected to the FTP and it sends the following lines for a while...
+FTPGET:1,1
+FTPGET:1,1
+FTPGET:1,1
+FTPGET:1,1
After those, the FTP connection times out...
+FTPGET:1,64
I haven't been able to find an "FTP GET CLOSE" command so that I can resume the connection later. I tried sending the following commands but they are replied with an ERROR...
AT+FTPGET=2,0
ERROR
AT+FTPGET=1,0
ERROR
AT+FTPGET=1,1
ERROR
AT+FTPGET=2
ERROR
AT+FTPGET=0
ERROR
There is a command which helps to restore a connection AT+FTPREST=x, where x is the index from we want to start reading the file when it's opened again, but my problem is that I cannot close the previous connection.
I am using the SIM908 AT Command manual v1.02. Refer to the attachment below.
I cannot download the full 1024 bytes file since I need to do other stuff with the FTP, I am multitasking other FTP functions.
Do you know how to close an active FTP download?
Thanks.
PS I am using a PIC microcontroller with C to read/send the commands, but I can test them with a terminal as well.
I was wondering if somebody knew how to download an FTP file in parts... let's say, the file is 1024 bytes in size... I download only 32 bytes from it and then I disconnect the FTP. I come back and then I reconnect the FTP and I start to download from the position 32.
The problem is that there is no way on the SIM908 to disconnect from the FTP server... a timeout has to happen to do so.
I ask the module to connect:
AT+FTPGET=1
It replies:
OK
+FTPGET:1,1
And then I ask it to read 32 bytes from the 1024 bytes file:
AT+FTPGET=2,32
It replies:
+FTPGET:2,32
12345678901234567890123456789012
OK
The problem is that if I ask only for some bytes from the file, the current FTP operation remains active, the SIM908 is still connected to the FTP and it sends the following lines for a while...
+FTPGET:1,1
+FTPGET:1,1
+FTPGET:1,1
+FTPGET:1,1
After those, the FTP connection times out...
+FTPGET:1,64
I haven't been able to find an "FTP GET CLOSE" command so that I can resume the connection later. I tried sending the following commands but they are replied with an ERROR...
AT+FTPGET=2,0
ERROR
AT+FTPGET=1,0
ERROR
AT+FTPGET=1,1
ERROR
AT+FTPGET=2
ERROR
AT+FTPGET=0
ERROR
There is a command which helps to restore a connection AT+FTPREST=x, where x is the index from we want to start reading the file when it's opened again, but my problem is that I cannot close the previous connection.
I am using the SIM908 AT Command manual v1.02. Refer to the attachment below.
I cannot download the full 1024 bytes file since I need to do other stuff with the FTP, I am multitasking other FTP functions.
Do you know how to close an active FTP download?
Thanks.
PS I am using a PIC microcontroller with C to read/send the commands, but I can test them with a terminal as well.