Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SIM900B: Errors Read SMS

Status
Not open for further replies.

diepvu1805

Member level 2
Joined
Jun 20, 2011
Messages
46
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,595
hi all,
I am using SIM900B.
I meet some issue when read SMS
I read SMS as follow:
Step 1: Send AT: "AT+CMGL=\"REC UNREAD\"\r"
Step 2: delay 1000ms;
Step 3: Read buffer SMS.
And here's the result:
+CMGL: 1,"REC UNREAD","+841998848534","","12/04/12,14:19:01+28"
111ok

OK
It's true.

But sometimes, When read SMS, I received the result as follow:
+CMGL: 1,"REC UNREAD","+841998848534","","12/04/12,14:19:01+28"
OK
or
+CMGL: 1,"REC UNREAD","+841998848534","","12/04/12,

OK

The result's lose SMS's content.
I can't explain that.
I think that the problem is the delay(step 2). The delay isn't enough.
pls, help me!
Thank,

---------- Post added at 16:09 ---------- Previous post was at 15:12 ----------

I am using baudrate: 115200
 

For which purpose you are using GSM modem? Why dont you choose Baud Rate 9600? Can you tell the Project topic?
 

Thank,
I use GSM modem to receive/send SMS alarm in my application. I want to use Baud Rate 115200. Baud Rate 9600 not enough fast.
 

You just include this command with initializing commands. May be tihs will be the problem.
 

Thank,
I think, i found the problem. Because I'm using interrupt for UART1(interface with GSM modem) and Timer. When receive data from GSM modem, I didn't stop Timer.
 

Why?
I must to wait for until the read data complete??
 

I did the same way, ie without using the serial interrupt, it is possible to receive and send messages. Happy coding:)
 

Beware of using delay. Avoid delay at any cost. It will work fine as you expected sometime and sometimes not. If you are doing only for college project or for hobby then you can go with delay. But, in real time product, delay method will give you more problem. You can use USART Interrupt and "Ring buffer" (***) to store the GSM Modem/Module output. Then you don't need to use delay and your Module/Modem will give 100% correct result.

See this thread: https://www.edaboard.com/threads/210322/
 
Last edited:

But if the response is not needed, then why i cannot use the delay? Why i have to store the response?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top