Do you know if the module is using 4G or 3G in this mode (ksrat=7)?
I am connected to 4G when KSRAT=7. In fact I have forced 4G with ksrat=5.
I don’t think there are any limitations because if i manually send the AT commands (using busybox microcom) it works BUT only when I send smaller amounts of data (<1000 bytes).
Could this be a timing issue? Are there any timing considerations I need to keep in mind when sending >500Kb of data 5Kb at a time? Or when I send the EOF Pattern? Let me explain with sudo code:
//open the session and get the ID
session_id = AT+KFTPCFG=1 , “ftp.bla.com” , "User" , “pw” ,21,0,1
//start sending this file over FTP
AT+KFTPSND=“session_id”,“Logs”,"+Filename+",0
//setup to read in the file we want to send
FileInputStream fin = new FileInputStream(f2);
byte array b = new byte[5000];
//loop until we reach the end of the file
while ((bytesRead = fin.read(b)) != -1) {
mFileOutputStream.write(b, 0, bytesRead);
Thread.sleep(100);
up_count += bytesRead;
}
Thread.sleep(1000);
//send the EOF pattern
mFileOutputStream.write("--EOF--PATTERN--".getBytes());
This fails every time I run it connected to LTE, but it works fine when my module is connected to 3G.
I have tried playing with the size of the buffer (from 1Kb to 16Kb), how long I sleep before sending another buffer (anywhere from 0 to 2 seconds), and how long I sleep before sending the EOF Pattern after the file is sent.
Could you please try to send much larger amounts of data? Maybe put 4 or 5Kb of data in your clipboard and CTRL+V it 10 times once you have a connection open, then try to send the EOF Pattern.
I also tried to keep the data transfer small and use the append option if +KFTPSND but I could not get this to work because the file would get over-written each time. It is like the ‘append’ option is being ignored.
I am about to give up on FTP as a method of uploading large amounts of data and move on to HTTP Post.
Thanks for your help!