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

Mon Jun 12 2017, 07:36 PM
madhusoodanan
how to receive string using 8051
ajay_bhargav
Thu Jun 08 2017, 05:48 PM
@Vinoth post in forum.
Wed Jun 07 2017, 06:40 AM
vinothkannan
how interface eprom in this code
Thu May 25 2017, 05:25 AM
Monir Hossain
Can i change the 7-Segment are common pin ? And how to?
Mon May 08 2017, 12:45 PM
ivan muvunyi
please can you send me wiring diagram for automatic control of 3 phase induction motor for production of maize flour
Wed May 03 2017, 08:39 PM
imran qureshi
hello friend
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
Fri Apr 28 2017, 03:47 PM
SANDEEP T S
I need pcb wizard 3.5 version kindly send valid link of yours
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

Downloads

Comments

richard1976
Sat Jun 24 2017, 05:48 PM
DruvaN
Wed Jun 21 2017, 11:44 AM
lalala
Tue Jun 20 2017, 11:05 PM
Siddh@
Tue Jun 20 2017, 07:47 AM
firdaus0hsem
Sat Jun 17 2017, 04:53 PM
amir9297
Fri Jun 16 2017, 05:44 AM
madhusoodhanan
Mon Jun 12 2017, 07:31 PM
Aminookano
Sun Jun 11 2017, 05:50 AM

Online

Guests: 90, Members: 0 ...

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

Members: 37847
Newest member: richard1976
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jun 26 2017, 08:42 PM
I have attached a demonstration file.It will echo ...
richard1976 Avatar
Posted By richard1976
Sat Jun 24 2017, 08:47 PM
Hi can you tell me how to send and recieve usart d...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jun 24 2017, 08:24 PM
HiUnfortunately there is too much code here to wor...
richard1976 Avatar
Posted By richard1976
Sat Jun 24 2017, 06:01 PM
hi i have written this programme and can send data...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jun 23 2017, 08:19 PM
>Should I need to check PWR_VLD bits every time on...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jun 23 2017, 07:42 PM
I would say yes, but data transfer will be slower ...
Utsavi Avatar
Posted By Utsavi
Thu Jun 22 2017, 12:14 PM
Hello ExperimenterUK, Thanks for your support. Fro...
DruvaN Avatar
Posted By DruvaN
Wed Jun 21 2017, 11:51 AM
Is it possible to Use 8051 bit-banging method to p...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 20 2017, 06:27 PM
You could start by looking at this tutorial on ke...
firdaus0hsem Avatar
Posted By firdaus0hsem
Sat Jun 17 2017, 04:58 PM
I have an issue regarding how to use 4x3 keypad to...