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.

Strange problem with gprs/smtp

Status
Not open for further replies.

prerak

Newbie level 4
Newbie level 4
Joined
Dec 16, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,320
I am using ARM LPC2138 with a SIM900 module. One serial port UART0 is used for hyper term and another to communicate with SIM900
I have developed my own serial protocol wrapping over sim900 commands.

Everything works fine, except for a strange issue.
I am using a command wrapper (e.g. ^6:<my string>~$) to send string over tcp ip. internally it uses AT+CIPSEND, waits for the ">" prompt and then sends the string
I am using the same method for number of cases - works fine. But as soon as I try to send "data" as string, it does not return prompt.

It is intriguing, because the prompt should be returned as a result of "AT+CIPSEND" and the string is sent only after that.
The controller has no way of knowing which string is going to follow, still it does not return prompt only for the string "data".

Any clues will be greatly appreciated!
Thanks,
Prerak
 

I don't know that this is the cause but could it have to do with whether your command wrapper adds a carriage return & line feed at the end of the string?

Or just a carriage return?
 

I don't know that this is the cause but could it have to do with whether your command wrapper adds a carriage return & line feed at the end of the string?

Or just a carriage return?

Thanks BradtheRad.
It seems to be that but I can't catch exactly what.
If I do a newline after data and then terminate the string, it seems to be ok.
However, my confusion is that the AT command and the message string are sent in two stages as follows
void sendTcp(char* line){
char buffer[256];
if(globals.tcpOk == 1){
sprintf(buffer, "AT+%s", STR_TCPSEND);
if(sendAndWait(buffer, '>', 5000) == 0){
printf("No prompt!\n");
} else {
sendToU1(line);
// and finally the closing char
buffer[0] = 26;
buffer[1] = 0;
//sendToU1(buffer);

//while(1){while(!(U1LSR & 0x1)); if(U1RBR == 'K'){break;}}
if(sendAndWait(buffer, 'K', 5000) == 0){
printf("Error sending ctrl Z\n");
}
}
}
}

I can understand if I don't get a reply back from the server, but I get a "No Prompt!" message indicating that I am not reaching ">" stage, and that too before actually sending data.
Thanks for your help,
Prerak
 

Thanks BradtheRad.
It seems to be that but I can't catch exactly what.
If I do a newline after data and then terminate the string, it seems to be ok.
However, my confusion is that the AT command and the message string are sent in two stages as follows
void sendTcp(char* line){
char buffer[256];
if(globals.tcpOk == 1){
sprintf(buffer, "AT+%s", STR_TCPSEND);
if(sendAndWait(buffer, '>', 5000) == 0){
printf("No prompt!\n");
} else {
sendToU1(line);
// and finally the closing char
buffer[0] = 26;
buffer[1] = 0;
//sendToU1(buffer);

//while(1){while(!(U1LSR & 0x1)); if(U1RBR == 'K'){break;}}
if(sendAndWait(buffer, 'K', 5000) == 0){
printf("Error sending ctrl Z\n");
}
}
}
}

I can understand if I don't get a reply back from the server, but I get a "No Prompt!" message indicating that I am not reaching ">" stage, and that too before actually sending data.
Thanks for your help,
Prerak

Ok - I have found the problem, but don't know how to resolve.
The problem is that "at" - even sent as part of data (as in say d"at"a) is considered a command and SIM900 tries to interpret it!
How to suppress this behavior?
Thanks,
Prerak
 

I don't know whether this is something that applies in your case, but I seem to remember there are command sequences that are supposed to begin with CHR$ 27 (Escape key).

It notifies the receiving device that it should regard what follows as a command, or else to ignore what would ordinarily be a command.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top