Naznee
Newbie level 6
I am using A7670C GSM breakout board with esp32.
Connections
When I sent the AT command to GSM module. I don't get output on serial monitor of Arduino IDE.
The message is sent to a particular number successfully but I didn't receive the message from mobile.
This is my code
Other AT commands also don't give me any ok message on serial monitor or any message on serial monitor. I have tried software serial but it doesn't work.
Connections
- RX-TX
- TX-RX
- GND-GND
When I sent the AT command to GSM module. I don't get output on serial monitor of Arduino IDE.
The message is sent to a particular number successfully but I didn't receive the message from mobile.
This is my code
Code:
#include <HardwareSerial.h>
HardwareSerial mySerial(2);
void setup() {
mySerial.begin(115200); // Setting the baud rate of GSM Module
Serial.begin(115200); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
SendMessage();
RecieveMessage(); }
void loop() {
if (Serial.available()>0)
Serial.write(Serial.read());
switch(Serial.read())
{
case 's':
SendMessage();
break;
case 'r':
RecieveMessage();
break;
}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}
void SendMessage() {
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+91XXXXXXXXXX\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("I am SMS from GSM Module");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000); }
void RecieveMessage() {
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
delay(1000); }
Other AT commands also don't give me any ok message on serial monitor or any message on serial monitor. I have tried software serial but it doesn't work.
Attachments
Last edited by a moderator: