Jump to content
43oh

Recommended Posts

I am using energia msp430 and gsm900a module. I want to send and receive sms & send sms from msp430 to and gsm900a to any mobile number is working fine but at time of receiving sms in serial monitor of energia is not showing any responses from to incoming msg . I am attaching my code also 

#include<msp430.h>
void setup()
{
  Serial.begin(9600);   // Setting the baud rate of GSM Module  
 // Serial.begin(4800);    // Setting the baud rate of Serial Monitor (Arduino)
  delay(1000);
}


void loop()
{
  if (Serial.available()>0)
   switch(Serial.read())
  {
    case 's':
      sendsms();
      break;
    case 'r':
      RecieveMessage();
      break;
  }

 if (Serial.available()>0)
   Serial.write(Serial.read());
}


void sendsms()
{
Serial.println("AT\r");
delay(1000);
Serial.println("AT+CMGF = 1\r");
delay(1000);
//Serial.println(" AT+CMGS =\"XXXXXXXXXX\"\r");
delay(1000);
Serial.println("HELLO WORLD");
delay(1000);
Serial.println((char)26);
delay(100);
}


 void RecieveMessage()
{
  Serial.println("AT+CMGF = 1\r");
  delay(1000);
  Serial.println("AT+CNMI=2,3,0,0,0\r"); // AT Command to receive a live SMS
  delay(1000);

 }
 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...