Search code examples
gsmat-command

How to disable GSM Modem unsolicited SMS arrival message?


I would like to process sms messages from my GSM modem (SIM900, but have few others also) but without +CMTI notification.

Code would run in a look and execute various commands, and one of them would be to check if message arrived and then act upon that.

Currently if modem received sms it outpus +CMTI message which get somewhere in the buffer.

Would disabling of that be better approach or should I parse the structure?


Solution

  • There are pro's and con's with both ways of dealing with receiving and handling SMS messages.

    1) Storing on SIM card

    There are a couple of downsides with this option. You have to extract the SMS messages from the SIM card which costs time on the one hand. On the other hand it degrades the SIM card itself. Depending on how many SMS's you are receiving this could cause the SIM card to stop working aka no longer able to do read and writes.

    2) Handling unsolicited

    Here the downside is that you have to be permanently connected to the modem and collect the messages as they come. So if there are USB connection issues it could occur that you lose messages. There are ways of coping with this, for example by configuring the modem so that you manually acknowledge SMS messages received (AT+NACK). This means that the mobile operator network will resend the messages at a later point in time.

    When you have modems from different manufacturers then configuration is sometimes a little tricky regarding unsolicited messages. Watch out there if you choose this route. Via AT+CNMI (parameters are different depending on manufacturer/model) you can configure how the modem deals with unsolicited messages. This also involves how the modem handles messages when no "host" is connected to the modem etc... I really recommend finding the AT Command manuals for your modems and seeing what is possible there.

    To summarise I personally recommend the unsolicited approach as it's a lot more comfortable handling messages rather than accessing the SIM card to grab and delete received messages.