modem icon indicating copy to clipboard operation
modem copied to clipboard

Random behaviour fr receiving messages

Open alexislg2 opened this issue 9 years ago • 4 comments

Hey, First thanks for your cool package. I use it to send and receive SMS but sometimes, the app stop receiving SMS (no event is emited when a new sms arrives). I have to stop and restart the app in order to receive them? Have you ever experiences this behaviour ?

alexislg2 avatar Sep 05 '14 15:09 alexislg2

Use something like the following code to see if the modem port is opened and still operational:

function checkModem() {
  var c = modem.execute('AT', function() {
    console.log('AT Test response', arguments);
  });

  c.on('timeout', function() {
    console.log('AT Test timed out');
  });
}
setInverval(checkModem, 120000);

emilsedgh avatar Sep 06 '14 07:09 emilsedgh

Thanks! Have you ever experienced this problem? If so, do you know what is the cause of this? By the way, what can I do when I detect a timeout to reload the modem?

alexislg2 avatar Sep 06 '14 20:09 alexislg2

I found out why this happened. It's because the modem seems to 'forget' that we have registered for sms notifications I need to put this in a regular interval to fix this problem this.execute('AT+CNMI=2,1,0,2,0');

alexislg2 avatar Oct 02 '14 14:10 alexislg2

This is weird. Never had such issue. Glad to see your problem fixed :)

emilsedgh avatar Oct 02 '14 14:10 emilsedgh