Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SIM900 : Problem sending data to a ftp-Server with AT-commands;

Status
Not open for further replies.

SIM_debugger

Newbie level 2
Joined
Jan 14, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,335
Hello,
I try to send data from a SIM900 module to a remote ftp server with GPRS.
Therefore I use a C-Program with AT-commands which are sent to the module over UART-Connection. In the future I want to use a MC instead of a PC, but the testing is done with a PC.
Everything seem to work fine, but the datafile which should be generated does not appear at the Server.
Although the datafile seems not to be generated, it is possible to create a new directory and to change directories whith the corresponding ftp-commands.
Unfortunately I don´t have access to the Operating system of the ftp server and so I cannot check the logfile of the ftp-Server.
Maybe there is missing only a control chacter in one of the AT-commands, but I have no more idea what to test.
In the following I post the relevant C-Code (AT-command) and the message returned from the SIM900-module:
Does anyone have an idea ?


sprintf(AT_cmd, "AT+CIPMUX=1\r");
SIM900 response cleaned : >"AT+CIPMUX=1 OK "<

sprintf(AT_cmd, "AT+CIPMODE?\r");
SIM900 response cleaned : >"AT+CIPMODE? +CIPMODE: 0 OK "<

sprintf(AT_cmd, "AT+CGATT?\r");
SIM900 response cleaned : >"AT+CGATT? +CGATT: 1 OK "<

sprintf(AT_cmd, "AT+CSTT=\"%s\",\"%s\",\"%s\"\r", "internet.eplus.de", "eplus", "gprs");
SIM900 response cleaned : >"AT+CSTT="internet.eplus.de","eplus","gprs" OK "<

sprintf(AT_cmd, "AT+CIICR\r");
SIM900 response cleaned : >"AT+CIICR OK "<

sprintf(AT_cmd, "AT+CIFSR\r");
SIM900 response cleaned : >"AT+CIFSR 10.196.204.35 "<

sprintf(AT_cmd, "AT+CIPSTART=0,\"%s\",\"%s\",%d\r\n", "TCP", "xxx.xxx.xxx.xxx", 21);
SIM900 response cleaned : >"AT+CIPSTART=0,"TCP","xxx.xxx.xxx.xxx",21 OK 0, CONNECT OK +RECEIVE,0,27: 220 Microsoft FTP Service "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 >

sprintf(AT_cmd, "user XXXXX\r\n%c", 26); //
SIM900 response cleaned : >"user XXXXX 0, SEND OK +RECEIVE,0,34: 331 Password required for XXXXX. "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "pass YYYYY\r\n%c", 26);
SIM900 response cleaned : >"pass YYYYY 0, SEND OK +RECEIVE,0,23: 230-(BLADE:)XXXXX FTP +RECEIVE,0,27: 230 User XXXXX logged in. "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "PASV\r\n%c", 26);
SIM900 response cleaned : >"PASV 0, SEND OK +RECEIVE,0,48: 227 Entering Passive Mode (xxx,xxx,xxx,xxx,10,151). "<

sprintf(AT_cmd, "AT+CIPSTART=1,\"%s\",\"%s\",\"%ld\"\r\n", "TCP", str_IP, pasv_ftp_port);
SIM900 response cleaned : >"AT+CIPSTART=1,"TCP","xxx.xxx.xxx.xxx","2711" OK 1, CONNECT OK "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "cwd SIM900\r\n%c", 26);
SIM900 response cleaned : >"cwd SIM900 0, SEND OK +RECEIVE,0,29: 250 CWD command successful. "<

sprintf(AT_cmd, "AT+CIPSEND=0\r");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "TYPE A\r\n%c", 26);
SIM900 response cleaned : >"TYPE A 0, SEND OK +RECEIVE,0,20: 200 Type set to A. "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "MKD SIMDIR\r\n%c", 26);
SIM900 response cleaned : >"MKD SIMDIR 0, SEND OK +RECEIVE,0,33: 257 "SIMDIR" directory created. "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "STOR test01.txt\r\n%c", 26);
SIM900 response cleaned : >"STOR test01.txt 0, SEND OK +RECEIVE,0,54: 125 Data connection already open; Transfer starting. "<

sprintf(AT_cmd, "AT+CIPSEND=1\r\n");
SIM900 response cleaned : >"AT+CIPSEND=1 > "<

sprintf(AT_cmd, "inhalt01\r\n%c%c", 4, 26);
SIM900 response cleaned : >"hello inhalt01 1, SEND OK "<

sprintf(AT_cmd, "AT+CIPSEND=0\r\n");
SIM900 response cleaned : >"AT+CIPSEND=0 > "<

sprintf(AT_cmd, "QUIT\r\n%c", 26);
SIM900 response cleaned : >"QUIT 0, SEND OK "<

sprintf(AT_cmd, "AT+CIPCLOSE=0,0\r");
SIM900 response cleaned : >"AT+CIPCLOSE=0,0 0, CLOSE OK "<

sprintf(AT_cmd, "AT+CIPCLOSE=1,0\r");
SIM900 response cleaned : >"AT+CIPCLOSE=1,0 1, CLOSE OK "<

sprintf(AT_cmd, "AT+CIPSHUT\r");
SIM900 response cleaned : >"AT+CIPSHUT SHUT OK "<

---------- Post added at 23:24 ---------- Previous post was at 22:25 ----------

în short form : if the ftp-Server is instructed with the STOR-Command to create a new file, how the data-stream into this file can be stopped that the ftp-Server is able to recognize the end of the data-Steam ?
I thougth this is be done with ASCII 4 (EOF)


sprintf(AT_cmd, "STOR test01.txt\r\n%c", 26);
SIM900 response cleaned : >"STOR test01.txt 0, SEND OK +RECEIVE,0,54:125 Data connection already open; Transfer starting. "<sprintf

(AT_cmd, "inhalt01\r\n%c%c", 4, 26);
SIM900 response cleaned : >"inhalt01 1, SEND OK "<

---------- Post added at 23:28 ---------- Previous post was at 23:24 ----------

în short form : if the ftp-Server is instructed with the STOR-Command to create a new file, how the data-stream into this file can be stopped that the ftp-Server is able to recognize the end of the data-Steam ? I thougth this is be done with ASCII 4 (EOF)

sprintf(AT_cmd, "STOR test01.txt\r\n%c", 26);
SIM900 response cleaned : >"STOR test01.txt 0, SEND OK +RECEIVE,0,54:125 Data connection already open; Transfer starting. "<

sprintf(AT_cmd, "inhalt01\r\n%c%c", 4, 26);
SIM900 response cleaned : >"inhalt01 1, SEND OK "<
 

I found the reason for the problem :

The passive ftp-connection must be closed after transferring the Data of the file, BEFORE the Quit command is sent over ort 21

>"AT+CIPCLOSE=1,0 1, CLOSE OK +RECEIVE,0,24: 226 Transfer complete. "<

>"QUIT  0, SEND OK +RECEIVE,0,7: 221 "<
 

Hi..

I am dung my software job on Embedded field.
so now we are using simcom900d for an application.
so i know that by using at commands we can send a file using FTP.
so i know the procedure for get and put file.....but i am unable to get that results successfully .means so

I have 2 gprs modems so i have 2 network connections using simcom900d individually...

Please tell me me the procedure for setting of Remote server and Remote client. means already we know that Remote client is 1 tcp connected gprs .so how it download a file from server connected gprs modem ?so exatly where we put the file?in server can i write that command like...

at+ftpputpath="C:\Documents and Settings" like...

Please give me a reply....
Thanks in Advance..
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top