Discussion in "Project Help" started by    Deepakvaishu    Jan 11, 2017.
Wed Jan 11 2017, 10:47 AM
#1
How to send the same message to multiple contacts which are stored in an array of phone numbers, using AT commands for SIM900A gsm modem using 8051 microcontroller.
Should I make a loop?
But then how to pass the variable (array elemenst to AT command)?
Thanks in advance
Fri Jan 13 2017, 05:59 AM
#2
You need to send AT command one by one to all the numbers in array. You can create a simple wrapper function to send sms where in you can pass mobile number and text to send. then call the function from a for loop.
 Deepakvaishu like this.
Fri Jan 13 2017, 11:58 AM
#3
suppose i have this array
char *phone_no[3 ]={"1234567890\" ," 9087654321\" ,"76676667676\"; //array of pointers

for(i=0;i<3;i++)
{
uart_string("AT+CMGF=1\r\n");
delay_ms(2000);
uart_string("AT+CMGS=\phone_no[i]\r\n");
delay_ms(2000);
uart_string("hello world\r\n");
delay_ms(2000);
uart_data(0X1A); //control+Z
delay_ms(2000);
}


will this work
Sat Jan 14 2017, 11:59 PM
#4
The site editor may have removed the 0 from \0.
Actually it should not be needed, so
char *phone_no[3 ]={"1234567890" ," 9087654321" ,"76676667676"}; //array of pointers
should work.


[ Edited Sun Jan 15 2017, 12:00 AM ]
Mon Jan 16 2017, 06:07 AM
#5
No ,its not the null character, its just the '\',
have have read on the google "How to send the msg using AT commands and microcntroller" then the results which I got were,

uart_string("AT+CMGS=\"9999999999\"\r\n"); .......In this format we should code ,,hence i have added '\' as the last character n the array of phone numbers..

IS this wrong??

plz guide me with the correct format for sending the message using AT commands and controller.

Mon Jan 16 2017, 08:31 AM
#6
you are right ..I should not include '\' at the end of the phone number...
I came to know that we have used \" to print " character since we want ,
AT+CMGS="phone number"; " should be printed and hence we have used \".
Wed Jan 18 2017, 01:12 AM
#7
Quotes can be tricky, but this should work.

char *phone_no[3 ]={"1234567890" ," 9087654321" ,"76676667676"}; //array of pointers

for(i=0;i<3;i++)
{
uart_string("AT+CMGF=1\r\n"); //probably not be needed each time
delay_ms(2000);
uart_string("AT+CMGS=\""); //open quotes
uart_string(phone_no[i]); //insert number
uart_string("\"\r\n"); //close quotes.. return
delay_ms(2000);
uart_string("hello world\r\n");
delay_ms(2000);
uart_data(0X1A); //control+Z
delay_ms(2000);
}

In a similar project I used \r not \r\n
I don't know if it makes a difference.


[ Edited Wed Jan 18 2017, 01:13 AM ]
 Deepakvaishu like this.
Wed Jan 18 2017, 06:28 AM
#8
Thank you....Now I can send the msg to multiple contacts...
But when i use a serial interrupt I can't send the message to any contact...
Is serial interrupt required for sending the message?

i am also using Rfid module here...
Once the rfid card is readed I have to send the message to the particular number..
Plz help...

Wed Jan 18 2017, 08:38 PM
#9


But when i use a serial interrupt I can't send the message to any contact...
Is serial interrupt required for sending the message?

Deepakvaishu


You don't need to use the serial interrupt to send.
Most simple programs don't.
Your version of "uart_string()" might , but it's unlikely.
What are you using the serial interrupt for ?


i am also using Rfid module here...
Once the rfid card is readed I have to send the message to the particular number..

Deepakvaishu


You will have to give a lot more detail of the problem.
Thu Jan 19 2017, 04:50 AM
#10
I am using serial interrupt for RFID card reader,whenever a RFID card is readed then we will get its ascii value (serial interrupt)....
Whenever the RFID card is readed then we should send the message to the specific number.

The problem which I am getting is that whenever I do the GSM and RFID(using serial interrupt code ) both separate , then they are working.

But when I combine both codes together for GSM and RFID ,both are not working..
Here using serial interrupt (for both transmiting(AT commands) and receiving (rfid card ascii value));

plz help.

Get Social

Information

Powered by e107 Forum System

Conversation

Sun Apr 30 2017, 05:49 AM
Lijin G Varghese
Can u send me the circuit diagram for Program to interface GSM Module with 8051 microcontroller (AT89C51) using PC and LCD
Sun Apr 30 2017, 05:48 AM
Lijin G Varghese
Program to interface GSM Module with 8051 microcontroller (AT89C51) using PC and LCD
Fri Apr 28 2017, 03:47 PM
SANDEEP T S
I need pcb wizard 3.5 version kindly send valid link of yours
Fri Apr 28 2017, 03:46 PM
SANDEEP T S
I need pcb wizard 3.5 version
ExperimenterUK
Mon Apr 17 2017, 11:56 PM
Sorry..We had a problem with registration.Confirmation emails were not sent.Please re-register
Thu Apr 13 2017, 07:29 PM
Piyush Aughad
I want circuit & program for radar detection using Microcontroller 8051
Tue Apr 11 2017, 03:27 AM
Shabbir Ahmed
Hi Ajay ....hope you and your family all will be fine are you working on andriod aplications if yes then plz reply me
Sun Apr 09 2017, 06:33 PM
ATHULYA NAIR
Dear Sir, I need to know what are the complexity for programming in 8051 Microcontroller for three phase inverter?
Sun Apr 09 2017, 06:32 PM
ATHULYA NAIR
Dear Sir,
Sun Apr 09 2017, 04:43 AM
Rohit chandra joshi
Sir I need ur help urgently.i am trying to make pc controlled led scrolling display using 8051.when i am trying to generate hex file of the code that is given by pratik suthar.it gives the error Target not created Limit:0800h I am using keil uvision4 software. Even i have tried to burn the given hex file that is atteched with the code but my led are not glowing. Pls help me sir .i struck in this problem from last month and till now i am not able to short out the problem. Pls suggest me to solve the problem.mail me at [email protected] Thanks

Downloads

Comments

anshulece
Fri Apr 28 2017, 03:43 PM
Masoooud
Tue Apr 25 2017, 06:57 PM
BOuissal
Mon Apr 24 2017, 02:46 PM
tranhunga
Mon Apr 24 2017, 01:11 AM
Suslik
Sun Apr 23 2017, 09:26 AM
soumk
Sun Apr 23 2017, 06:22 AM
Vavachi1996
Tue Apr 18 2017, 08:01 PM
yasmine
Tue Apr 18 2017, 03:10 PM

Online

Guests: 64, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37814
Newest member: anshulece
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon May 01 2017, 12:42 AM
Sorry, that doesn't sound "normal".I think a re-in...
Deepakvaishu Avatar
Posted By Deepakvaishu
Fri Apr 28 2017, 11:18 AM
Yes proteus is loaded ,with all projects.....Once ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Apr 28 2017, 05:06 AM
Does Proteus load at all ?Does it only crash on c...
Deepakvaishu Avatar
Posted By Deepakvaishu
Wed Apr 26 2017, 06:59 AM
hello...I am getting an error when I am trying to ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 18 2017, 10:52 PM
Thanks for the comment.Glad you got it working.
Deepakvaishu Avatar
Posted By Deepakvaishu
Tue Apr 18 2017, 06:19 AM
Thank you very much...Today I got the output for a...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Apr 06 2017, 05:38 PM
Is it initially assigned as '0', and then when the...
Deepakvaishu Avatar
Posted By Deepakvaishu
Thu Apr 06 2017, 07:55 AM
hello,Thanks for the attachment.I have gone throug...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Mar 25 2017, 09:49 PM
I have attached code showing one method you could ...
Deepakvaishu Avatar
Posted By Deepakvaishu
Sat Mar 25 2017, 07:59 AM
I am using Keil and 8051 microcontroller