I am currently trying to use my TER-GX300S to download a big file via FTP. (>16kB, therefore not possible to just store it into one variable with FTPGET). My approach (with a public server) is:
loop until I find "ERROR":
char = AT#FTPRECV=3000
WriteToFile is a selfmade function using file I/O, which is working just fine, the rest is sent to the MDM Interface/read from the MDM Interface. When I do all these commands with e.g. HTerm, it works just fine and the module receives the file 2000-byte wise. (Though I am not quite sure, why not 3000-byte wise)
When I run the code, however, sometimes I get #FTPRECV=486, sometimes even #FTPRECV=0 within the MDM.receive stream. Also, the last lines of the file are cutoff. Please feel free to test it out with this ftp server yourself.
Is there any known issue that could cause such behaviour; Is there any timeout I need? (between the commands, I always use MOD.sleep(10) (atleast)