I am working with the SIM908 GPS/GPRS module. I can make connections to an FTP and download small files without any trouble (given that they are smaller than 60 bytes for example).
I want to download a big file of 1024 bytes and I want to do it in 32 bytes sessions. The AT commands I send are as follows...
ATCOM_FTP_SET_BEARER
ATCOM_FTP_SET_SERVER
ATCOM_FTP_SET_PORT
ATCOM_FTP_SET_USER
ATCOM_FTP_SET_PASSWORD
ATCOM_FTP_SET_SETUP_DOWNLOAD_NAME
ATCOM_FTP_SET_DOWNLOAD_PATH
Then 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 a "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.
http://www.4shared.com/archive/A49KthrTce/SIM908_AT_Command_Manual_V102.html
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 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.