This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to handle 2 sms received at a time in gsm module

I am using 89s52 microcontroller to interfacing with GSM module 'SIMCOM300'.
The logic which i develope is as bellow:

1) 1st i execute all commands i.e AT, AT+CMGF=1, AT+CSMS=0, AT+CPMS="SM", AT+CNMI
2) AFTER this controller will do its other operation
3) when new msg received sci receive interrupt will store '+CMTI: "SM", <index> response from gsm in buffer.
4] after this i take the index from buffer & read the corresponding msg content.
5) again the receive interrupt will occure & the whole data rcv from gsm is store in another buffer.
6) so with this i am getting the senders mobile n0.,time of sending, & actual data.
7) Depending on the actual data microcontroller will perform the action.

actual problem:
1) i am use '+' sign to check new msg indication, if '+' sign occur then next data will automatically save in buffer. but while doing this if another sms received then gsm module gives response of that message.
i want this new response to store in buffer but the previous message response already fulfil the condition

so give me the solution to handle two sms received at a time by gsm module.....

Parents
  • Note that +CMTI is an unsolicied message - a message the modem can send to you without you first having polled the modem by sending a command to the modem.

    But the modem will only send unsolicited messages when the serial interface is idle. If you already have an ongoing transfer of SMS data, then the modem will have to wait with next unsolicited message since no two text lines can intermix.

    Next thing - if you are slow to retrieve one SMS, then the modem gets a chance to receive more SMS messages. But how much memory do you think <index> consumes? You don't need to store the full string. You can keep a small ring-buffer of indices until you get time to retrieve the actual SMS data.

    Next thing is taht even if you fail to process the +CMTI string, you can still query the module for available SMS messages.

Reply
  • Note that +CMTI is an unsolicied message - a message the modem can send to you without you first having polled the modem by sending a command to the modem.

    But the modem will only send unsolicited messages when the serial interface is idle. If you already have an ongoing transfer of SMS data, then the modem will have to wait with next unsolicited message since no two text lines can intermix.

    Next thing - if you are slow to retrieve one SMS, then the modem gets a chance to receive more SMS messages. But how much memory do you think <index> consumes? You don't need to store the full string. You can keep a small ring-buffer of indices until you get time to retrieve the actual SMS data.

    Next thing is taht even if you fail to process the +CMTI string, you can still query the module for available SMS messages.

Children