Go Down

Topic: SIM900 Make a reall voice call (Read 4154 times) previous topic - next topic

ehel

Hi!

Im using a SIM900 shield (GSM) and Arduino UNO. Everything works fine (SMS, Call, HTTP).
Or not really everything. I can make the shield call my mobile but i can't hear anything from the on-board head-jack for headphones. I have try different AT-commands but cant get it to work.
I'm not sure it's the AT-command thats wrong or something that I need to program on Arduino itself to make it work.
Do anyone have any working AT-command and code for make a real call with sounds?

Simplest one I found.Witch just make a call.
Code: [Select]
ATD...........;

A more complicated code are this
Code: [Select]



void setup()
{
  Serial.begin(19200);  //Default serial port setting for the GPRS modem is 19200bps 8-N-1
  Serial.print("\r");
  delay(1000);                    //Wait for a second while the modem sends an "OK"
  Serial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(1000);

  //Serial.print("AT+CSCA=\"+919032055002\"\r");  //Setting for the SMS Message center number, 
  //delay(1000);                                  //uncomment only if required and replace with
                                                  //the message center number obtained from
                                                  //your GSM service provider.
                                                  //Note that when specifying a tring of characters
                                                  // " is entered as \"

  Serial.print("AT+CMGS=\"+918446043032\"\r");    //Start accepting the text for the message
                                                  //to be sent to the number specified.
                                                  //Replace this number with the target mobile number.
  delay(1000);
  Serial.print("SIM900 and Arduino say Hi!\r");   //The text for the message
  delay(1000);
  Serial.print(26,BYTE);  //Equivalent to sending Ctrl+Z
}

void loop()
{
      //We just want to send the SMS only once, so there is nothing in this loop.
      //If we put the code for SMS here, it will be sent again and again and cost us a lot.
}


Making a call & Controlling GPIO and PWM pins

The sample source code below shows how one can make a call and control the GPRS Shield's General Purpose I/O pins as well as the PWM pins

//Source code sample showing how to make a call (use headphones and mic to talk),
//and how to control the General Purpose I/O pins and PWM

#include <NewSoftSerial.h>

NewSoftSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);               // the GPRS baud rate   
  delay(2000);
}

void loop()
{
  int count=0;

  mySerial.println("ATDxxxxxxxxx;"); // xxxxxxxxx is the number you want to dial, Noice the ";" in the end
  delay(2000);
     while(1)
     {
       mySerial.println("AT+SPWM=2,63,100");// set PWM 2 PIN
       delay(100); 
       mySerial.println("AT+SPWM=1,63,100");
       delay(100);       
       mySerial.println("AT+SGPIO=0,1,1,1");// set GPIO 1 PIN to 1
       delay(100);
       mySerial.println("AT+SGPIO=0,2,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,3,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,4,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,5,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,6,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,7,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,8,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,9,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,10,1,1");
       delay(100);       
       mySerial.println("AT+SGPIO=0,11,1,1");
       delay(100);
       mySerial.println("AT+SGPIO=0,12,1,1");

       delay(500);

       mySerial.println("AT+SPWM=1,63,0");
       delay(100); 
       mySerial.println("AT+SPWM=2,63,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,1,1,0"); // set GPIO 1 PIN to 0
       delay(100);
       mySerial.println("AT+SGPIO=0,2,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,3,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,4,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,5,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,6,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,7,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,8,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,9,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,10,1,0");
       delay(100);       
       mySerial.println("AT+SGPIO=0,11,1,0");
       delay(100);
       mySerial.println("AT+SGPIO=0,12,1,0");
       delay(500);

       count++;

       if(count==5)
       {
         mySerial.println("ATH"); //end the call.
         if(mySerial.available())
        {
           Serial.print((unsigned char)mySerial.read());

         } 
       } 
     } 

}



ylll

Hello!
I bought a Seeedstudio gprs shield and an Arduino Uno and I was trying to make a call but when I did according to the Wiki, I always got "serial port error". The thing is I am using Port 3 for Arduino but the hint never stopped. How did you make the call? Can you give me some websites or video link that I can take a look at?

Thanks!

mitchdunc


Hello!
I bought a Seeedstudio gprs shield and an Arduino Uno and I was trying to make a call but when I did according to the Wiki, I always got "serial port error". The thing is I am using Port 3 for Arduino but the hint never stopped. How did you make the call? Can you give me some websites or video link that I can take a look at?

Thanks!


I know that some units don't support data calls, and you'll need to use a voice call.

Data call:
ATDxxxxxxxxxx

Voice call:
ATDxxxxxxxxxx;

At least that's how it was on my Sony Ericsson Unit.

ehel

Thats correct there is a diferent between ATDxxxxxx   and ATDxxxxx; with a semicolon at the end. But when i make a call i use the ;
if i dont use it will not call att all.

Go Up