Hello! I'm working on a project with an ESP32 and a SIM7600. I'm testing the SIM7600 using AT commands written through the serial monitor. Everything works well until I try to decode DTMF tones. When I answer a call on the SIM7600 and press numbers on my cell phone, many digits appear duplicated, almost like a bounce. For example, I press "2587" and receive the DTMF decoder's URCs with the following numbers: "2 2 5 8 8 7 7." Some numbers come through correctly, while others are duplicated.
EDIT: The bouncing only occurs when I use the speakerphone. If I don't use the speakerphone, tone decoding is perfect. One would think it might be the tones bleeding through my cell phone's microphone, in addition to those emitted through the communication line, but when I press the keys, the tones aren't even audible.
Is this normal? Is it common to have to perform some kind of software debouncing on the ESP32 when trying to decode DTMF tones?
The AT command sending/receiving code is quite basic and works perfectly with all other AT commands.
Any suggestions?
void setup() {
Serial.begin(115200);
Serial2.begin(115200);
Serial.println("Set up OK");
delay(1000);
}
void loop() {
if (Serial.available()) {
String comandoAT = Serial.readStringUntil('\n');
comandoAT.trim(); // Elimina espacios en blanco y caracteres de nueva línea al final
String comandoATConRetorno = comandoAT + "\r\n"; // Agrega retorno de carro
Serial2.print(comandoATConRetorno);
Serial.print("Enviado a Serial2: ");
Serial.println(comandoAT);
//delay(100); // Pequeña pausa para dar tiempo a la respuesta
}
if (Serial2.available()) {
String respuesta = Serial2.readString();
Serial.print("Respuesta Serial2 (RAW):\n");
Serial.print(respuesta);
}
//delay(100); // Pequeña pausa para dar tiempo a la respuesta
}
No. The problem is almost certainly one or more errors in the code you forgot to post. Check the timing of the tone/intertone pause transmission and detection.
I don't have access to the code or the schematic right now (but I only have the ESP32 connected with an LED, RX, TX, and the SIM7600 with two capacitors; it's a basic connection). I'll add this information tomorrow, though.
Regarding DTMF usage: The SIM7600 can natively generate and decode DTMF. Tones are sent with AT+VTS, and AT+VTD is used to set the duration of the emitted tone (only the emitted tone(s), nothing is mentioned about reception). As for DTMF tone reception, there is no AT command to change any configuration (according to the SIM7500 and SIM7600 AT Command Manual V3.0).
IMPORTANT: I've been doing more tests, and it turns out that when I call the SIM7600 with my cell phone and dial numbers (send DTMF tones), I don't receive any bouncing, regardless of how long I press the keys or the time between presses—it works perfectly. The problem arises when I use the speakerphone; that's when I get the bouncing. Even yesterday, with the speakerphone activated, pressing the keys didn't produce any audible tones on my phone, but the SIM7600 still received them (some of them duplicated).
void setup() {
Serial.begin(115200);
Serial2.begin(115200);
Serial.println("Set up OK");
delay(1000);
}
void loop() {
if (Serial.available()) {
String comandoAT = Serial.readStringUntil('\n');
comandoAT.trim(); // Elimina espacios en blanco y caracteres de nueva línea al final
String comandoATConRetorno = comandoAT + "\r\n"; // Agrega retorno de carro
Serial2.print(comandoATConRetorno);
Serial.print("Enviado a Serial2: ");
Serial.println(comandoAT);
//delay(100); // Pequeña pausa para dar tiempo a la respuesta
}
if (Serial2.available()) {
String respuesta = Serial2.readString();
Serial.print("Respuesta Serial2 (RAW):\n");
Serial.print(respuesta);
}
//delay(100); // Pequeña pausa para dar tiempo a la respuesta
}
Can you listen to what the audio input is at the SIM7600?
What is the specification for silence between digits so they would be recognized as additional digits, not the same one still pressed?
That it works perfectly with the one input, you aren't looking at a code problem. You coukd so,ve it by necessitating an arbitrary lengthy silence between digits, so filter out what you would then be calling continuous holding of one, this might make it feel sluggish.
Or you might have a noise or signal condition issue.
I've been running tests and I've found the solution. If you look at my circuit, the microphone was too close to the SIM7600 module. This was causing noise in the communication, some kind of echo or interference. I disconnected the microphone and the problem disappeared. I'll have to connect the microphone at a safe distance when designing the PCB to prevent this effect from recurring. Later, I'll do more tests to determine the distance at which it's safe to place the microphone.
Thank you very much to everyone who offered their input