How to read incoming SMS?

This seems like a no-brainer, I am using an HL7588 and have read dozens of tutorials like this one: developershome.com/sms/howTo … C.asp#11.1 and they all point me back to AT+CMGL, which doesn’t seem to be doing anything. Here is a console log. Near the end you can see a MSG (+CMT: “4805554667”) I sent from my phone to the device show up unsolicited as it was received, but then it didn’t seem to be stored anywhere.

The only thing I ever get back when I do the AT+CMGL is “OK”.

AT
OK

at+CMGF=1
OK

OK
at+cmgs="4805554667"
> Outbound Test
> 
+CMGS: 193

OK

at+cmgl
OK

AT+COPS?
+COPS: 0,0,"Verizon",7

OK
AT+CMGR="193"
ERROR

AT+CMGR=193
+CMS ERROR: 321

AT+CMGR=1
OK
AT+CMGR=2
OK
AT+CMGR=3
OK

AT+CPMS?
+CPMS: "ME",0,100,"ME",0,100,"ME",0,100
OK

AT+CPMS=?
+CPMS: ("SM","ME"),("SM","ME"),("SM","ME")
OK

AT+CPMS=SM,SM,SM
+CPMS: 0,0,0,0,0,0
OK

AT+CPMS?
+CPMS: "SM",0,0,"SM",0,0,"SM",0,0
OK

at+CMGF=1
OK
AT+CMGL="ALL"
OK

at+CMGF=0
OK

AT+CMGL="ALL"
ERROR

AT+CMGL
OK

AT+CMGL=?
+CMGL: (0-4)
OK

AT+CMGL=0
OK

AT+CMGL
OK

at+CMGF=1
OK
AT+CMGL
OK

AT+CMGL=?
+CMGL: ("REC UNREAD","REC READ","STO UNSENT","STO SENT","ALL")
OK

AT+CMGL=ALL
OK
AT+CMGL="ALL"
OK

AT+CMGL="REC UNREAD"
OK

AT+CPMS=me
+CPMS: "ME",0,100,"ME",0,100,"ME",0,100
OK

+CMT: "4805554667","","17/11/15,18:42:11+00"
Incoming Test

AT+CSCS=?
+CSCS: ("GSM","IRA","8859-1","PCCP437","UCS2")
OK

AT+CSCS?
+CSCS: "IRA"
OK

AT+CSCS="GSM"
OK

AT+CMGL=ALL
OK

AT+CPMS?
+CPMS: "ME",0,100,"ME",0,100,"ME",0,100
OK

Using AT+CMGW=1 I was able to write a message into memory and retrieve it using AT+CMGL=“ALL”, but I could never get it to store incoming or outgoing messages.

I played with every combination of AT+CNMI I could find searching through Github projects (github.com/search?l=Arduino&p=3 … =%E2%9C%93) and got it to stop or start showing the incoming notification in the console in real time, but whatever the solution is to retrieve an SMS on command is, it evades me.

Hi,

AT+CMGR is the command to read the SMS.
You have to wait till you receive CMT/CMTI indication to arrive and then you can read the SMS. So to get the CMT/CMTI indications, you have to set CNMI command.

From you logs, it seems that you are providing the CMGR command before the CMT indication arrive. So only you are not able to read the SMS.

Below mentioned is the sample AT logs :
at+cmgf=1

at+cmgs=“xxxxxxxxxxxxx”

hello
+CMGS: 132

at+cnmi=2,1,0,0,0

+CMTI: “SM”,17
+CMTI: “SM”,18
at+cmgr=18
+CMGR: “REC UNREAD”,"+8613501557247",“15/07/15,11:24:59+32”
Hello

Thanks & Regards,
Rex