Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random behaviour fr receiving messages #5

Open
alexislg2 opened this issue Sep 5, 2014 · 4 comments
Open

Random behaviour fr receiving messages #5

alexislg2 opened this issue Sep 5, 2014 · 4 comments

Comments

@alexislg2
Copy link
Contributor

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 ?

@emilsedgh
Copy link
Owner

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);

@alexislg2
Copy link
Contributor Author

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
Copy link
Contributor Author

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');

@emilsedgh
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants