Go Down

Topic: Use DTMF (Read 6387 times) previous topic - next topic

Giorgio

Hello,
Is possible to receive DTMF command trough the new GSM SHIELD R3 with Quectel M10 ?
I can't find documentation about.
Thanks
kind regards
Giorgio

MathiasVDA

I can see AT commands that deal with DTMF and tone generation so I guess it's possible using AT commands.

http://arduino.cc/en/uploads/Main/Quectel_M10_AT_commands.pdf

Giorgio

I simply need to receive a call, and decode DTMF code, can you please explain me what I can do this with AT commands?

thanks
Giorgio

MathiasVDA

Sorry I can only point you to the right place, you'll have to do the rest because I have no experience with receiving calls and dealing with tones.

davidgoth

GSM library doesn't support DTMF functions of modem. You can use AT commands directly:

- AT+VTS to generate DTMF tone.
- AT+QLDTMF to generate local DTMF tone.
- AT+QTONEDET to detect DTMF tones.
- AT+QTONEP to set DTMF output.

Giorgio

Hello,
can please someone explain me how to use this at command directly in a sketch?

thanks
Giorgio

davidgoth

You can input commands directly through serial monitor with this sketch:

Code: [Select]

#include <SoftwareSerial.h>
#include <string.h>

char incoming_char = 0;
SoftwareSerial cell(2,3);

void setup()
{
  // Initialize serial ports for communication.
  Serial.begin(9600);

  // Reset
  Serial.println("Start Reset");
  pinMode(7, OUTPUT);
  digitalWrite(7, HIGH);
  delay(12000);
  digitalWrite(7, LOW);
  delay(1000);
  Serial.println("End Reset"); 

  cell.begin(9600);

  Serial.println("Enter your AT commands (with CR & NL)...");
  /*cell.println("AT+CFUN=4");
  delay(500);
  cell.println("AT+CFUN=4");
  delay(500);
  cell.println("AT+CFUN=4");
  delay(500);
  */
}

void loop()
{
  if(cell.available() > 0)
  {
    incoming_char = cell.read();
    if((incoming_char >= ' ') && (incoming_char<='z'))
      Serial.print(incoming_char);
    else
    {
      Serial.print("%");
      Serial.print((int) incoming_char);
      Serial.print("%");
      if(incoming_char == 10)
        Serial.println();
    }
  }

  if(Serial.available() > 0)
  {
    incoming_char = Serial.read();
    cell.print(incoming_char);
  }
}


Giorgio

I need to detect a DTMF during a call.. what I need to do please?
Thanks
Giorgio

davidgoth

For example, you can send commands from a sketch with:

Code: [Select]

theTTModemCore.genericCommand_rqc("AT+QDTONEDET=1", true); // Send command
_delay_ms(1000); // Wait for response
theTTModemCore.genericParse_rsp(resp); // parse response looking for a OK

// If OK
if(resp)
{
// Do a call and search for a modem response like "+QTONEDET: ..."
}


To check if a QTONEDET event happens, you have to development your own parser reading data from the buffer with:
Code: [Select]

char c = theGSM3ShieldV1ModemCore.theBuffer().read()

Giorgio

Hello,
thanks for help.
I can't understand:
why you use "theTTModemCore" and "theGSM3ShieldV1ModemCore"?
What is _delay_ms?
Where I need to declare "resp"?

many thanks
Giorgio

davidgoth


Hello,
thanks for help.
I can't understand:
why you use "theTTModemCore" and "theGSM3ShieldV1ModemCore"?
What is _delay_ms?
Where I need to declare "resp"?

many thanks
Giorgio


Sorry. I would say theGSM3ShieldV1ModemCore. Replace _delay_ms with delay() function of Arduino (_delay_ms is an AVR funct
ion included in <util/delay.h>). Resp is a boolean variable to keep if parser executed succesfully.



Go Up