Pages: [1]   Go Down
Author Topic: Noting comes up in serial monitor while using GSM SIM 900  (Read 505 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I started using this code and everything worked perfectly , but nothing comes up in the serial monitor. Why is this?

#include <SoftwareSerial.h>
#include <String.h>
 
SoftwareSerial mySerial(2,3);
 
void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);    // the GPRS baud rate
  delay(500);
   mySerial.println("ATD + +9197xxxxxxxx;");//dial the number
  delay(100);
}
 
 void loop()
 {
 }
Logged

Leeds, England, (dis)UK
Offline Offline
God Member
*****
Karma: 16
Posts: 708
Quick, chuck it in the bin before the boss finds out...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Because you aren't sending anything to the serial monitor perhaps? There are no Serial.print() statements.
Logged

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Made it to work...

#include <SoftwareSerial.h>
#include <String.h>
 
SoftwareSerial mySerial(2,3);
 
void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);    // the GPRS baud rate
  delay(500);
}
 
void loop()
{
  //after start up the program, you can using terminal to connect the serial of gprs shield,
  //if you input 't' in the terminal, the program will execute SendTextMessage(), it will show how to send a sms message,
  //if input 'd' in the terminal, it will execute DialVoiceCall(), etc.
 
  if (Serial.available())
    switch(Serial.read())
   {
     case 't':
       SendTextMessage();
       break;
     case 'd':
       DialVoiceCall();
       break;
     
   }
  if (mySerial.available())
    Serial.write(mySerial.read());

}
 
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
  mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(100);
  mySerial.println("AT + CMGS = \"+919xxxxxxxxx\"");//send sms message, be careful need to add a country code before the cellphone number
  delay(100);
  mySerial.println("How are you ?");//the content of the message
  delay(100);
  mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
  delay(100);
  mySerial.println();
}
 
///DialVoiceCall
///this function is to dial a voice call
void DialVoiceCall()
{
  mySerial.println("ATD + +919xxxxxxxxxx;");//dial the number
  delay(100);
  mySerial.println();
}
 
Logged

Pages: [1]   Go Up
Jump to: