Problem with sending sms by sim900

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

I can send sms by sim900 but when sms arrive in my cellphone I see hex of that data.

for exmaple when I send "TEST" I got this:

%u5445%u5354%u0d0a

anybody knows where is my problem :( ?

this is my code:

bool SendSms(char* MobileNumber,char* Msg)
{
		SendCommandToGPRS(CMGFCode,true);
		GetRespGPRS("AT+CMGF","OK",1);

		SendCommandToGPRS(CSCSCode,true);
		if(GetRespGPRS("AT+CSCS","OK",2))
		{
			SendCommandToGPRS(CMGSCode,true);
			SendCommandToGPRS(FMobileNumCode,true);
			SendCommandToGPRS(MobileNumber,false);
			SendCommandToGPRS("\"\r\n",false);
			if(GetRespGPRS("AT+CMGS",">",5))
			{

				SendCommandToGPRS(Msg,false);
				SendCommandToGPRS("\r\n",false);
				SendCharToGPRS(0x1A);
				GetRespGPRS("+CMGS:","OK",5);
				return true;
			}
		}
	return false;	
}
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

0x54 = T
0x45 = E
0x53 = S
0x54 = T
0x0D = Carriage Return
0x0A = Linefeed

 

In consideration of others, please RTFM!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

quote="jpmargis"]0x54 = T
0x45 = E
0x53 = S
0x54 = T
0x0D = Carriage Return
0x0A = Linefeed

I know that as I told you before:

Quote:

when sms arrive in my cellphone I see hex of that data

this is a question why i got sms in hex form?! and what are percent U in that string?!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi dears,

 

i want to send sms with sim900. i wrote the code with interrupt in codevisionavr  but it didnt work . do you know what my problem is?

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

while (1)
{        
    send_sms(3,29.6,65.8);   
}

void send_sms(int d,float t,float h)
{
 lcd_clear();
    
    lcd_gotoxy(0,0);
    lcd_putsf("send_sms");
    
    delay_ms(2000); 
     
     lcd_clear();
     lcd_putsf("sending...");    
     PORTC.2=1;   
     printf("AT%c",enter);
    // lcd_puts(st);
     delay_ms(3000);
     printf("AT+CMGF=1%c",enter) ;
     delay_ms(3000);
     printf("AT+CMGS=%c09127424071%c%c",dq,dq,enter) ;
     delay_ms(3000);
     printf("%d t=%f h=%f %c%c",d,t,h,enter,ctrlz) ;
     delay_ms(5000);
     PORTC.2=0;
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your first problem is hijacking an old and unrelated thread.

 

And you don't give much to go on with, "it didnt work" - do you?

 

http://www.catb.org/esr/faqs/sma...

 

http://www.catb.org/esr/faqs/sma...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Deleted 5 duplicate posts.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly