SMS sim900 MikroC

You can post your problem related to PIC Microcontroller Projects here. We will try our best to help you out.
Post Reply
Brown
Posts:8
Joined:Fri Mar 03, 2017 1:10 pm
SMS sim900 MikroC

Post by Brown » Fri Mar 03, 2017 1:16 pm

Hello everyone,

I'm trying to send a SMS using easypic7 and sim900 gsm module,

1- how to send ctrl+z through mikroelektronika usart terminal for testing,

2- this code not working, even though i receive in the end OK from the sim900, but no sms received from the other phone

/////////////////////
UART2_Write_Text(" AT\r\n");
UART2_Write(10);
UART2_Write(13);
Delay_ms(1000);

UART2_Write_Text(" AT+CPIN = xxxx\r\n");
UART2_Write(10);
UART2_Write(13);
Delay_ms(1000);

UART2_Write_Text(" AT+CMGF = 1\r\n");
UART2_Write(10);
UART2_Write(13);
Delay_ms(1000);

UART2_Write_Text(" AT+CMGS=\"+41774004311\"\r\n");
delay_ms(500);
UART2_Write(10);
UART2_Write(13);
UART2_Write_text(" ba7abek Hasan test0\r\n");
UART2_Write(26); // Send CTRL + Z as end character

if (UART2_Data_Ready() == 1) {
// if data is received
UART2_Read_Text(rx2buff, "OK", 20); // reads text until 'OK' is found
UART1_Write_Text("msg SENT\r\n"); }
////////////////////////////

I write two times new line, is it ok, or not,
did any1 used it succefully AT command to send a SMS,

Greetings, Thanks in advance,

Junaid_Shahid
Posts:110
Joined:Tue Feb 14, 2017 9:00 am

Re: SMS sim900 MikroC

Post by Junaid_Shahid » Fri Mar 03, 2017 1:23 pm

Brown wrote:
Fri Mar 03, 2017 1:16 pm
Hello everyone,

I'm trying to send a SMS using easypic7 and sim900 gsm module,

1- how to send ctrl+z through mikroelektronika usart terminal for testing,

2- this code not working, even though i receive in the end OK from the sim900, but no sms received from the other phone

/////////////////////
UART2_Write_Text(" AT\r\n");
UART2_Write(10);
UART2_Write(13);
Delay_ms(1000);

UART2_Write_Text(" AT+CPIN = xxxx\r\n");
UART2_Write(10);
UART2_Write(13);
Delay_ms(1000);

UART2_Write_Text(" AT+CMGF = 1\r\n");
UART2_Write(10);
UART2_Write(13);
Delay_ms(1000);

UART2_Write_Text(" AT+CMGS=\"+41774004311\"\r\n");
delay_ms(500);
UART2_Write(10);
UART2_Write(13);
UART2_Write_text(" ba7abek Hasan test0\r\n");
UART2_Write(26); // Send CTRL + Z as end character

if (UART2_Data_Ready() == 1) {
// if data is received
UART2_Read_Text(rx2buff, "OK", 20); // reads text until 'OK' is found
UART1_Write_Text("msg SENT\r\n"); }
////////////////////////////

I write two times new line, is it ok, or not,
did any1 used it succefully AT command to send a SMS,

Greetings, Thanks in advance,
your concerned post:
RECEIVE SMS WITH SIM900 & PIC

Post Reply