SIM900 AT Commands Fot FTP

INTRODUCTION:

The task assigned to me quite straight forward. But due to lack of experience and knowledge it became difficult for me. I learnt a lot. I decided to write a report. May be it will helpful for a beginner. 

REQUIRE TOOLS:

·         SIM900 GSM MODULE
·         SIM (GPRS ENABLED)
·         FTP Server (I used free FTP host provided by serversfree.com)
·         HyperTerminal

SETUP Hyper Terminal:

Figure 1: Hyper Terminal


Figure 2: FTP Host


Figure 3: File Manager


AT COMMANDS FOR DOWNLOADING A FILE:



AT 

OK 

AT+CSQ     

+CSQ: 16,0         

OK 
AT+CGATT?        
+CGATT: 1        

OK 
AT+CSTT      
OK 
AT+CIICR       
OK 
AT+CIFSR       
10.10.209.129            

AT+SAPBR=3,1,"CONTYPE","GPRS"                            
OK 
AT+SAPBR=3,1,"APN","ufone.internet"        //           write your APN                            
OK 
AT+SAPBR=1,1           
OK 
AT+FTPCID=1          
OK 
AT+FTPTYPE="A"             
OK 
AT+FTPSERV="amna.bugs3.com"            //write your FTP server domain              
OK 
AT+FTPUN="xxx"                    
OK 
AT+FTPPW="xxx"                  
OK 
AT+FTPGETNAME="download.txt"                           
OK
AT+FTPGETPATH="/public_html/"                //write the correct directory path.
OK
At+FTPGET=1                                                 //starts FTP session
OK

+FTPGET:1,1
AT+FTPGET=2,1024                                     // gets 1024 bytes of data
+FTPGET:2,5
Hello                                                             //getting text from the document
OK

+FTPGET:1,0                                                       //closes FTP session


AT COMMANDS FOR DOWNLOADING A FILE FRON A FTP SERVER:
AT+FTPPUTNAME="upload.txt"                         
OK 
AT+FTPPUTPATH           
ERROR    
AT+FTPPUTOPT="STOR"                  
OK 
AT+FTPPUTPATH="D:"                 
OK 
AT+FTPPUT=1          
OK

+FTPPUT:1,1,1360                  //FTP session is ready for upload. It can upload 1360 bytes at a time
AT+FTPPUT=2,11
+FTPPUT:2,11

OK

6 comments:

  1. Hey,

    is it possible that you could explain a xxx.jpg file upload which is bigger than 1360 bytes with the correct commands?

    Many thanks
    Bernhard

    ReplyDelete
    Replies
    1. It will upload 1360 bytes at a time. AT+FTPUT=2,11 shows 11bytes will be uploaded. I write 11 bytes because i have a .txt file of 11 bytes. If your file is bigger than you have to enter the following command multiple times.
      AT+FTPPUT=2,xxx (xxx=no. of bytes)

      Delete
  2. Hey dude, i found your guide pretty useful, still, i got a question.

    I did the uploading process, and the result was a file called "D:upload.txt" in the server, but it was empty. How can fill that txt file with the info i wish to upload?

    thanks in advance
    Abel

    ReplyDelete
    Replies
    1. after sending the AT+FTPPUT=2,11 command you have to wait until you receive

      +FTPPUT:2,11

      Then you must send 11 bytes, after sendind those 11, you need to wait the

      OK

      If you want to send more data you send again the command AT+FTPPUT=2,numofdata the numofdata is limited to what
      its displayed after starting the FTP session +FTPPUT:1,1,1360, in this case 1360 at once,


      After finish sending data, you must send the command to finish the FTP Session AT+FTPPUT=2,0,

      For more information read the datasheet:
      http://www.reyax.com/Module/GSM/SIM900D/AN_SIM900_FTP_HTTP_AT_COMMANDS_USER_GUIDE_beta_V1.00.pdf

      Delete
  3. I have seen your post on edaboard.com where +FTPPUT:1,77 error came.
    I too have this error how did you resolved it

    ReplyDelete
  4. Its been a long time, I posted it. Actually it was a part of my project. After that I didn't work on this. Anyhow, I will try to solve your problem.

    ReplyDelete

Popular Posts