Hello! I really need help in this! I bought SIM900 GPRS shield and try to connect my FTP server. If i use Putty or some other program my commands works perfectly, but if i try to use them in arduino i can't get correct response and everything seems to be messed out. What i am trying to do is connect ftp server then after every 10 seconds it should see what kind of message there is in file. Now if i look the log there is atleast half of the code missing (buffer maxed out?). I dont even know if commands go through.
This is my code:
#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8);
char inchar;
void setup()
{
Serial.begin(19200); // for serial monitor
SIM900.begin(19200); // for GSM shield
//SIM900power(); // turn on shield
delay(10000); // give time to log on to network.
setFTP();
SIM900.flush(); // to clear serial buffer
}
void setFTP()
{
// commands to connect GPRS and server.
SIM900.println("AT+CGMM");
SIM900.println("AT+CGMI");
SIM900.println("AT+CMEE=1");
SIM900.println("AT+CGATT=1");
SIM900.println("AT+CGACT=1,1");
SIM900.println("AT+CGPADDR=1");
SIM900.println("AT+SAPBR=3,1,\"APN\",\"INTERNET\"");
SIM900.println("AT+CREG?");
SIM900.println("AT+SAPBR=2,1");
SIM900.println("AT+SAPBR=1,1");
SIM900.println("AT+FTPCID=1");
SIM900.println("AT+FTPSERV=\"XXXX\"");
SIM900.println("AT+FTPUN=\"XXX\"");
SIM900.println("AT+FTPPW=\"XXX\"");
SIM900.println("AT+FTPGETNAME=\"filu.txt\"");
SIM900.println("AT+FTPGETPATH=\"/\"");
}
void readFTP()
{
SIM900.println("AT+FTPGET=1");
delay(70);
SIM900.println("AT+FTPGET=2,1024");
}
void loop()
{
while(SIM900.available() >0)
{
inchar=SIM900.read(); //Get the character from the cellular serial port.
Serial.print(inchar); //Print the incoming character to the terminal.
}
readFTP();
delay(10000);
}
This is my LOG. as you can see the commands are cut out and FTP error is 1.66:
AT+CGMM
AT+CGMI
AT+CMEE=1
AT+CGATT=1
AT+CACT=1,1
AT+CGPDDRAT+FTPGET=1OK
+FTPGET:1,66
AT+FTPGET=2,1024+CME ERRAT+FTPGET=1
OK
+FTPGET:1,66
AT+FTPGET=2,1024+CME ERRAT+FTPGET=1
OK
+FTPGET:1,66
AT+FTPGET=2,1024+CME ERR