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.

sending, receiving, comparing SMS through AT commands

Status
Not open for further replies.

tanyajajodia

Junior Member level 1
Joined
Mar 17, 2007
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,419
avr at commands

i need to compare the SMS received with predefined stored strings. the phone connected to an Atmel 8535, which reads that SMS through AT commands. was just confused over how to go about implementing it..

can i store the read message from the UDR directly into a string and also have the predefined message in string format. then can just comparing the two strings give the correct result??

also when was trying to send a message from the MC. the program i was trying is as follows:


Code:
#include<90s8535.h>
#include<stdio.h>
#include<delay.h>

unsigned char str1[] = "AT";
unsigned char str2[] = "AT+CMGS=25";
unsigned char str3[] = "079119890202456401000B819078004371F400040C486F772061726520796F753F";

void main(void)
{
	UBRR=0x33;
	UCR=0x18;     
      	
        puts(str1);     //AT
       	putchar(0x0D);  //Enter
        putchar(0x0A);  //Line feed
        delay_ms(3000);
       	puts(str2);     //AT+CMGS=25
        putchar(0x0D);
        putchar(0x0A);
        delay_ms(3000);  
        puts(str3);    //Message in PDU format
       	putchar(0x1A);   //Control-z
             
}

is this code correct? do i need to add in anything? or is anything not really required?
really need to get thru this... would be of great help. thanx...
 

strlen string codevision

Code:
#include<90s8535.h>
#include<stdio.h>
#include<delay.h>

unsigned char str2[] = "AT+CMGS=25";
unsigned char str3[] = "079119890202456401000B819078004371F400040C486F772061726520796F753F";

void main(void)
{
   UBRR=0x33;
   UCR=0x18;     
         
        puts(str2);     //AT+CMGS=25
        putchar(0x0D);
        delay_ms(3000); 
        puts(str3);    //Message in PDU format
        putchar(0x1A);   //Control-z
        putchar(0x0D);          
}
Make sure your PDU string (str3[]) is absolutely correct!
This is your PDU message after decode, is it right?
SMSC#+919820205446
Sender:09870034174
TP_PID:00
TP_DCS:04
TP_DCS-popis:Uncompressed Text
class:0
Alphabet:8bit

ow are you?
Length:72

Please mention the type of your cell phone.
 
  • Like
Reactions: orod

    orod

    Points: 2
    Helpful Answer Positive Rating
avr at command

the decoded pdu is:


SMSC#+919820205446
Receipient:09870034174
Validity:Not Present
TP_PID:00
TP_DCS:04
TP_DCS-popis:Uncompressed Text
No class
Alphabet:8bit

How are you?
Length:12


am using a sony ericsson T230 phone.




you have removed the Line Feed commands after the Enter commands.. isn't it required to get the prompt from the phone?

and in actual syntax of AT commands we do not press enter after control-z... but here you have?


however, will try the code and see if get results.
 

919820205446

SMSC#+919820205446
Receipient:09870034174
Validity:Not Present
TP_PID:00
TP_DCS:04
TP_DCS-popis:Uncompressed Text
No class
Alphabet:8bit

How are you?
Length:12
the PDU string for above message is :
Code:
079119890202456411000B929078004371F40000AA0CC8F71D14969741F977FD07
not
Code:
079119890202456401000B819078004371F400040C486F772061726520796F753F
check it with Codare SMS PDU converter

you have removed the Line Feed commands after the Enter commands.. isn't it required to get the prompt from the phone?
Carriage Return (0x0D) is enough
and in actual syntax of AT commands we do not press enter after control-z... but here you have?
All AT command is endded with Carriage Return (0x0D)
 

sms pdu converter

the above code didnt work.

i guess there is some problem in the system, cos when we send a Dial command, the phone displays random parts of the number to be called, finally not being able to make a call.

But the phone dials properly when connected to the hyperterminal.

so can u figure out where the problem could lie? our microcontroller, our connection, our phone?
we're really stuck... plz help out here....
 

codevision at command for sms

i guess there is some problem in the system, cos when we send a Dial command, the phone displays random parts of the number to be called, finally not being able to make a call.
But the phone dials properly when connected to the hyperterminal.
Are you using CVAVR for develop your system? There two kind of string output function on CVAVR :
Code:
void puts(char *str);
void putsf(char flash *str);
the first is for string variable (reside on RAM) and other one for string constant (reside on FLASH). At your case I think you have to use putsf() instead of puts().
Please try it.

Check your C Compiler stdio library documentation
 

inituart() codevision

hi.
i m developing a remote home control system using sms . i m using 8051. can someone tell me how to use text mode sms format
 

sms through at commands

you can see AT set instuction. it's ok
 

ate0 command

hey budhy,

we sorted out the problem, it was on our pcb connections. so when we tested our program on another pcb, it worked just fine.

the above code is proper, we dont need putsf.
also the enter after the control z isnt required.

thanx 4 ur help...
 

pdu sms decode codevision

What kind of AVR C Compilewr do you used?
 

at commands in avr codevision

we are using a codevision c compiler.
 

at command ate0

can anyone plz help me out in the way to capture the response given by the phone as a result of the AT commands given to it.

for e.g when i send in a "AT".... i want to capture the response "OK"... possibly in a string.

i need to compare the responses with predefined strings to proceed further with my project.... thanx.
 

8051 sms

tanyajajodia mail me :
hi budhy,
yet again we are facing problems in the smooth functioning for our project.
we wanted to capture the response given by the phone as a result of the AT commands given to it. we are using atmel 8535 and sony ericsson T230.

for e.g when i send in a "AT".... i want to capture the response "OK"... possibly in a string.

i need to compare the responses with predefined strings to proceed further with my project....

can you plz enlighten us with some solution...

you have always been a great source of help for us.... thanx again....

When we send a character to cellphone, the cellphone will echo back that character to us. ie : when you send ATD 628165417560; the cellphone will echo back that string to us.
This feature make a problem when you capture cellphone response!
Send ATE0 (echo off) command to eliminate it!

Here is the CodeVision code to demonstrate what do you want:
Code:
#include <90s8535.h>
#include <stdio.h>
#include <string.h>

char numb[] ="628165417560";
char messg[]="Hello Indonesia";

signed char sendSMS(char *number, char *message){
char response[10];
     putsf("ATE0\r");      // disable echo
     gets(response,10);    // waiting for "OK"
     putsf("AT+CMGS=\"");  // send number
     puts(number);
     putsf("\"\r");        // " and 0x0D
     gets(response,10);    // waiting for ">"
     puts(message);        // send message
     putchar(0x1A);        // ended with ctrl-Z
     gets(response,10);    // waiting for "OK"
     return strcmpf(response,"OK");
}

void initUART(void){
     ...
     ...
}

void main(void){
     initUART();
     // repeat send message, until OK
     while (!sendSMS(numb,messg)); 
}
 

cvavr read sms

Code:
#asm
.equ __lcd_port=0x15 ;PORTD
#endasm

#include<90s8535.h>
#include<stdio.h>
#include<delay.h>  
#include <lcd.h>

unsigned char str1[] = "ATE0";
unsigned char str2[] = "ATD 09870034174;";
char ch[20];

void main(void)
{      
	lcd_init(16); 
	lcd_gotoxy(0,0);
	UBRR=0x33;
	UCR=0x18;     
      	
        puts(str1);                 
        putchar(0x0D); 
            
       	puts(str2);   
       	putchar(0x0D);      
       	gets(ch,20);
        delay_ms(500);
       	lcd_puts(ch);
	delay_ms(5000);
	lcd_clear();  
  	
while(1)
	;
}
We tried using the above program to capture the response from the mobile, but in vain.
Earlier when we had run this program, our AT command string used to get displayed on the lcd. But now, it doesnt even do that.... can anybody clear it out?

Added after 1 minutes:

if we put anything as
Code:
lcd_putsf("Hello");

then it gets displayed, however there should be no gets() function before it.... quite weird!!
 

how to read all sms in at+command

hey budhy,
we tried using the ATE0 command as well,,,, but ATE0 itself gets displayed on the LCD!!!!
 

sendatcommand ate0

hello friends how are you i am also doing this project on connection of mobile with microcontroller i have a 6310 . the at commands work well withh hyperterminal but when i send these commands from the microcontroller there ,it doesnt work. i mean the mobile just echos the command send to it when i have the gnd removed and only tx and rx connected . but when i connect the gnd it doesnt even echo .
i dont even know which pins to connect i mean i have just connected the tx and rx to the 8051 the rest are just open . do i have to connect the rest of the pins in some manner please help
 

at commands avr

Hi

Iam trying to send /read SMS in PDU format,

If I send a message in PDU Format ,I got replay as “ERROR” with what ever message sent,

iam storing whole hex valus in the string,like following (char buf[]="0791xxxxxxxxxxxxxxxx"),

and my doubt is at the time of sending the message how much message size i have to give in the CMGS CMD
AT+CMGS= ?
whether it is strlen(buff) or number of octols?

thanking u with anticipation

[
 

nokia 6310i at commands sms

ok i have a dlr -3p cable which has a rs-232 db-9 female connector
it works well on hyperterminal
now the db-9 connecotor i have taken two wires from the rx and tx of the 8051 thru the max 232 and then in the tx and rx of the db-9 (of the dlr-3p)
it should work but when i connect the gnd to pin 5 of the db-9 the controller starts to funtion abnormally plz if anyone has interfaced the 8051 with dlr-3p-- nokia 6310 send me the diagram ,i am sure the programming is not the problem the problem is which of the pins of the db-9 is to be connected to what , thats what i cant figure it , i am sure it has also something to do with rts right? plz answer
 

at command avr

murty_ind said:
and my doubt is at the time of sending the message how much message size i have to give in the CMGS CMD
AT+CMGS= ?
whether it is strlen(buff) or number of octols?
[

it is the number of octals.... u can find the number of octals by using a pdu convertor....
http://rednaxela.net/pdu.php

Added after 2 minutes:

miss_monica said:
, i am sure it has also something to do with rts right? plz answer

you should have the cable from the phone side in "Null Modem"...
ie. short the RTS to CTS and DTR to DSR/CD... all on the phone side..
 

at command sms avr

Hi
I am successfully sending PDU Format SMS.

But my problem is How to read those SMS?

If I give the CMD “AT+CMGS=4”(for reading all SMS)
It is not displaying any messages.
Is there any procedure to read the SMS?


Thanking u with anticipation
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top