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.

FTP using SIM908 to a server

Status
Not open for further replies.

Amalinda

Banned
Full Member level 1
Joined
Sep 25, 2012
Messages
104
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
0
would there be anyone with the knowledge how to send a text file via FTP to a server using AT Commands by a SIM908?
my APN : PPWAP
Provider : Dialog Sri Lanka
I use UART to communicate with the SIM908 and my microcontroler is MSP430
 

Have you seen this link? https://www.cooking-hacks.com/docum...s-geoposition-sim908-arduino-raspberry-pi#ftp

Try to write a code using the code mentioned there. It is 2:20 AM here. I will post a C code tomorrow.

Which Compiler are you using for MSP430?

Mention the function prototypes you use to send String data to UART and also the functions to clear a buffer (array). Also mention if your compiler has strstr(), strcpy(), strcat() functions.
 
thank you Milan for your reply and the link. There were so man with different sequences of AT commands I couldn't determine which one to follow. Most of them gave errors. But I try this one too and update on the forum.

I am using CCS to compile my code (the newest version)
to send AT commands I have created a C function my self.
function prototype is :
Void SendAT ("AT\n\r")
it is called as follows:
SendAT("AT+CGPS=1\n\r");

to clear an array: (not implemented yet but I can implement is as follows)
void ClearArray (arrayname);

yes, after including the string.h. library my CCS will have all string processing functions.
please let me know if there is any more information you need.




Is there more than one way to use AT commands to FTP to a server?

Could you please explain what is happening when a certain set of AT commands are called? it would help me understand everything thoroughly without just using the functions. That is my intention. I am interested in knowing the steps taken with the help of AT commands to send the file using FTP.

----
p.s. Do you think there is a better reliable way to send GPS cordinates from my MSP430G2553 to the server?

the problem is that I dont have root access to the server at Hostgator. so I cannot write a program and run at the server end to capture the TCP/IP data (which I am not familiar too)

I believe FTP is more reliable to GET or POST methods.

If you think there is a better way to send data to the server please let me know.

thank you.
 
Last edited:
https://www.ccsinfo.com/forum/viewtopic.php?p=168648

In the link I provided in my previous post there is FTP section. In that it contains 2 codes, one for Arduino and another for Raspberry Pi. Use the Arduino code. You have to convert the Arduino related code.


Try to make a code using the AT command sequence mentioned in the code (link in post #4) and use the template code given below. I will write a code for you but I need a 2 or 3 days time.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const char gprsBuffer[200];
const char response[] = "OK";
 
const char cmd_at[] = "AT\r\n";
 
char temp[30];
 
void Interrupt(){
     
     
     if(//Test if UART Interrupt flag is set here){
          gprsBuffer[i++] = UART2_Read();
          gprsBuffer[i] = '\0';
 
          //Clear UART Interrupt flag here
     }
}
 
// copy const to ram string
char * CopyConst2Ram(char *dest, const char *src){
  char * d ;
  d = dest;
  for(;*dest++ = *src++;)
    ;
  return d;
}
 
//Use loop like below for each AT command you send
//Replace the Delay_ms() function with milli sec delay function provided by your compiler
//Provide proper delay for each AT command as required
 
while(strstr(gprsBuffer, CopyConst2Ram(temp, response) == 0){
               UART_Write_Text(cmd_at);
               Delay_ms(2000);
               i = 0;
}
 
//clear gprsbuffer[] here
 
//another loop here to send another AT command.
//If needed make a function which includes the above loop and clear buffer code and call it to send different AT commands
//You should also pass delay value to function so that delay can be changed as needed for different AT commands




Provide me an ISR code to receive UART data and also provide me a Timer interrupt code which interrupts every 500 ms or 1 sec. Also provide me the names of Timerx enable bit, Timerx interrupt flag bit, UART interrupt enable bit, UART interrupt flag bit. I need them to write a code.



I have made a function for mikroC code and I have used it for GSM and GPRS projects. If you provide the above mentioned data then I will make a function for you.

My function prototype is like this.


Code C - [expand]
1
void GSM_Send_AT_Cmd(void (*myUARTxfp)(char *), char *buff, int lenBuff, const char *atResponse, const char *atCmd, const char *aterr, char *Const2RamBuff, int lenConst2RamBuff, unsigned int sec, unsigned int *ptr2i, unsigned int *ptr2AttemptFlag,  unsigned int *ptr2timeCnt, unsigned int *ptr2time)

 
Last edited:
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top