I am testing AT commands on A9G using Xiao ESP32-C3. I wanted to make a call as well as to send SMS. I can call, no problem with that (using ATD+"your number") but my problem is that, I cannot send sms it only shows > in the serial monitor but I cant type anything after that. And it suddenly shows COMMAND NO RESPONSE!
Here's the code I am using
#include "WiFi.h"
void setup() {
Serial.begin(115200); // For Serial Monitor
Serial1.begin(115200, SERIAL_8N1, D0, D1); // For A9G Board
// Making Radio OFF for power saving
WiFi.mode(WIFI_OFF); // WiFi OFF
btStop(); // Bluetooth OFF
}
void loop() {
if (Serial1.available()) // read from A9G and send to Arduino Serial Monitor
Serial.write(Serial1.read());
if (Serial.available()) // Keep reading from Arduino Serial Monitor and send to A9G
Serial1.write(Serial.read());
}
I send this following AT commands in order
AT+CMGF=1
AT+CNMI=2,2,0,0,0
AT+CMGS=+"your number"
message to be sent: Hello! This message is from A9G on Xiao ESP32
I also tried it this way but I wasn't able to see the response
#include "WiFi.h"
void setup() {
Serial.begin(115200); // For Serial Monitor
Serial1.begin(115200, SERIAL_8N1, D0, D1); // For A9G Board
// Making Radio OFF for power saving
WiFi.mode(WIFI_OFF); // WiFi OFF
btStop(); // Bluetooth OFF
}
void loop() {
Serial1.println("AT+CMGF=1"); // Set GSM Module in Text Mode
delay(1000);
Serial1.println("AT+CNMI=2,2,0,0,0"); // New SMS MeSerial1age Indications
delay(1000);
Serial1.println("AT+GPS=1"); // Enable GPS
delay(1000);
Serial1.println("AT+CMGS=\"+1234567890\"\r"); // Replace +1234567890 with your number
delay(1000);
Serial1.println("Hello! This message is from A9G on Xiao ESP32");
delay(5000);
// Serial1.println((char)26); // ASCII code of CTRL+Z
Serial1.write(0x1A);
delay(1000);
}
I tried the combination of the code and this is what I got
ps. I already replaced the number where to send the SMS
Thank you for the help in advance!