Hello guys,
I am trying to receive SMS with my Arduino UNO connected with an A6 GSM module (this one). Unfortunetly I am not able to receive the text even though my arduino recognizes the incoming message by printing the phone number and the date of the arrival. After the Initializing-step I sended an SMS to the module. Here is the code I tested lastly:
#include <SoftwareSerial.h>
static const int RXPin = 10, TXPin = 11;
SoftwareSerial mySerial(RXPin, TXPin);// The serial connection to the GPS device
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//Begin serial communication with Arduino and A6
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CNMI=1,2,0,0,0"); // Decides how newly arrived mySerial messages should be handled
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
The Serial Monitor output I get (My phone number is replaced by "xxx"):
Initializing...
AT
OK
AT+CMGF=1
OK
AT+CNMI=1,2,0,0,0
OK
+CIEV: "MESSAGE",1
+CMT: "+49xxxxxxxxxxx",,"2018/11/24,12:
^STN: 38
^CINIT: 4, 8192, 38
As you can see I receive the message at 2018/11/24 at 12 o'clock. The minutes and the message is missing so I am not able to do any postprocesssing with the message.
My wiring:
Arduino A6 GSM
GND GND
digital 10 U_TXD
digital 11 U_RXD
I powered the A6 GSM by an 2A 5V power supply via the USB connector
I hope someone has some helpful advices for me.
Thanks in advance
Best regards,
David