Randomly receiving error while sending SMS (+CMS ERROR: 2162)

Hello!

We've been re-reading our old books on GSM. When talking with the base station the modem accesses first a common channel using an aloha-like protocol. It uses this channel to request a stable channel. But two requests may collide on the air at the same time. In that case both messages and the base station understands nothing. When the modems don't receive any answer from base they wait for a random and re-send the message. They repeat this process until they get an answer from base station, but there is a limit of retries. When the limit is reached the modem gives you an error message, v.g. 2162.

So, the deep meaning is that you're area is quite crowded with GSM devices (over 25% of total capacity)

You can try two things:
1st: simply capture the error at sketch level and try again.
2nd, configure your modem so it retries more times

  • Open the SoftwareSerialExample
  • Modify it so it runs at 9600 bps
  • Execute it on your Arduino.
  • Run the Serial Monitor, 9600 bps, NL&CR
  • Press (for 1'') the shield Power button until the status led lights up
  • Now you can type commands to the modem. Type AT (CR) twice. See that the modem answers OK.
  • Type AT+CRLP?
  • You'll get something like +CRLP: 61,61,128,6,0,3
  • The fourth parameter is the number of retries. You can modify that parameter, for example to 10, executing:
    AT+CRLP=61,61,128,10,0,3
    OK
  • check the new settings with AT+CRLP? again
  • Execute AT&W so the configuration is saved

We can not verify easily the effectivity of this solution, as our cell is not crowded. So it'd great if you can check if the above sequence improves your effectivity. In any case this modification will only reduce your failure ratio, but will not make the failures disappear.