title: GSM modem used to receive SMS hangs for no apparent reason
body: <p>I wrote a C# app that queries a GSM modem via the serial port twice a second. Querying is performed via the</p>
  
  <pre><code>AT+CMGL="ALL"
  </code></pre>
  
  <p>command, and the modem replies with the list of messages or a simple OK if there are no messages available in the message store.</p>
  
  <p>Now, the problem is that if the program runs for a couple of hours or so, after successfully querying the modem for more than 12000 times (with no incoming messages meanwhile), when a message does arrive, the GSM modem hangs and no response comes in response to the AT+CMGL="ALL" command.</p>
  
  <p>I even tried to kill the program and access the modem via PuTTYTel over its serial port, I get the same behavior. The only way to make the modem work again is to physically remove it from the USB port and plug it back in. After I do this "cold reset", a subsequent AT+CMGL="ALL" command retrieves the newly arrived SMS.</p>
  
  <p>This issue has spent two precious weeks of my life after I initially thought it was some event synchronisation problem. There is really nowhere to go from here. Has anybody encountered such a weird behavior so far? Is there something I am doing wrong?</p>
  
  <p>Regards,
  Valer</p>