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

Fri Sep 29 2017, 02:45 AM
Maaz
i am doing the same project on verilog please contact me [email protected]
Wed Sep 20 2017, 12:36 AM
Ted
In a missing pulse detector using a 555 timer connected as a monostable vibrator with a PNP transistor,how does the positve input pulse turn on the PNP transistor?
Sun Sep 03 2017, 02:29 PM
martymarty
How do I connect an <NOKIA 1100 LCD > to an atmega328P ?
poojab51296
Sun Aug 20 2017, 10:23 AM
i am intending to interface sd card with STM32F4 and want to write a file in sd card using SPI protocol but using HAL only. Can anyone help me PLEASE!!!!
poojab51296
Sun Aug 20 2017, 10:22 AM
hello
rawat742
Fri Aug 18 2017, 11:37 AM
hi @ angel patel i will attach a file i hope it will be helpfull for you
ExperimenterUK
Mon Aug 14 2017, 09:57 PM
@ angel patel... just log in and post your problem
Mon Aug 14 2017, 01:45 PM
angel patel
hey any one help to make the led scrolling display
desuza6
Sat Jul 29 2017, 07:09 AM
I see the code for step motor h l 298 to rotate 45 degree, but all delay time, if I want to input sensor to h the pulses to stepmotor
rammichael
Thu Jul 27 2017, 12:05 PM
okay fine

Downloads

Comments

lohithaSrinivas
Mon Oct 23 2017, 06:51 AM
aalootazyloo
Sat Oct 21 2017, 08:07 AM
bvdb
Wed Oct 18 2017, 01:45 AM
TinkeringJoe
Sun Oct 15 2017, 02:23 AM
Tubai96
Thu Oct 12 2017, 05:30 PM
roberttku
Thu Oct 12 2017, 08:02 AM
Bdavid.sam
Mon Oct 09 2017, 02:23 PM
SUNSHINE
Thu Oct 05 2017, 03:54 AM

Online

Guests: 67, Members: 0 ...

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

Members: 37904
Newest member: lohithaSrinivas
Forum Activity
bvdb Avatar
Posted By bvdb
Wed Oct 18 2017, 01:50 AM
I purchased the RKitL51 8051 C compiler from Raiso...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Oct 16 2017, 11:44 PM
That looks complicated.Is 8051_BLK a standard 80...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 15 2017, 07:29 PM
According to this, gmail should support POP3.https...
Help Avatar
Posted By Help
Sun Oct 15 2017, 03:21 AM
AT+POP3READ=? +POP3READ: (1-1460) OK AT+POP3READ=...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Oct 14 2017, 08:06 PM
What happens if you ask for the full email ieAT+PO...
Help Avatar
Posted By Help
Sat Oct 14 2017, 02:28 AM
Dear all, AT // OK // 3.1 Bearer profile // Conf...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Oct 12 2017, 01:04 AM
I don't think the 0804 works as it should in Prote...
Bdavid.sam Avatar
Posted By Bdavid.sam
Wed Oct 11 2017, 01:54 AM
Are you simulating in Orcad ?Please post your cod...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Oct 10 2017, 09:43 PM
Are you simulating in Orcad ?Please post your cod...
Bdavid.sam Avatar
Posted By Bdavid.sam
Mon Oct 09 2017, 02:38 PM
Hello, This might be a beginner’s mistake but I a...