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

GSM module is not working #28

Open
vishvas-prajapati opened this issue Oct 6, 2015 · 5 comments
Open

GSM module is not working #28

vishvas-prajapati opened this issue Oct 6, 2015 · 5 comments

Comments

@vishvas-prajapati
Copy link

var device = '/dev/ttyUSB0';
var message = {
text : 'Hello',
receiver: '+91xxxx',
encoding: '7bit'
};

modem.open(device, function(){
console.log('OPEN!!');
});

/*

  • Send SMS
    */
    modem.sms(message, function(err, res){
    console.log('SMS', err, res);
    });

OUTPUT:

node gsm_modem.js
OPEN!!

It can't send sms. 'delivery' method is also not working.

@emilsedgh
Copy link
Owner

After opening the modem, you have to call the sms function.

modem.open(device, function(){
modem.sms(message, callback);
});

@vishvas-prajapati
Copy link
Author

var modem = require('modem').Modem();
/*

  • Variables
    */
    var device = "/dev/ttyUSB0";
    var message = {
    text : "Hello",
    receiver: "+91xxxxxxxxxx",
    encoding: "7bit"
    };

/*

  • Connection String
    */
    modem.open(device, function(){
    console.log('OPEN!!');

    /*

    • Send SMS
      */
      modem.sms(message, function(err, res){
      console.log('SMS', err, res);
      });

    /*

    • Delivery SMS
      */
      modem.on('delivery', function(res){
      console.log('Delivery', res);
      });

    modem.on('ring', function(res){
    console.log(res);
    });
    });

Output:
node gsm_modem.js
OPEN!!

But Methods are not working. can you please help me here?
Should I do any configure at other? Send sms is working in minicom terminal.

@thomas-alrek
Copy link

I have the exact same problem.
I have a GSM900 modem connected through an Arduino.
The Arduino only forwards the serial port to and from the GSM900 to my computer via USB serial.
I am able to communicate with the modem using minicom, and the npm package "serialport".
However, using "modem", it doesn't work.

var util = require("util");
var modem = require('modem').Modem();

var device = '/dev/ttyACM0';

modem.open(device, function(){
          util.log("Modem ready");
          var msg = {
                    text: "test",
                    receiver: "00000000",
                    encoding: "7bit"
          };

          modem.sms(msg, function(err, references){
                    util.log(err);
                    util.log(references);
          });
)

The "open" callback seems to work, I get the "Modem ready" message logged, but the "sms" callback never fires, no error or anything.

@emilsedgh
Copy link
Owner

Have you guys tried other ports?
Some modems open up 3 different ports and only one of them responds to events.

For example my modem opens up /dev/ttyUSB0, /dev/ttyUSB1 and /dev/ttyUSB2 and only one of them works (/dev/ttyUSB2 in my case)

@flurbius
Copy link

This may sound dumb but my modem is what huawei call a wifi wingle that connects to 4G and serves wifi to provide internet access. it has an sms function which as far as I can tell is only available by loading the config page in my browser.

What Id like to know is can I use this package to connect to my modem?
if so what would the device string look like?

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

4 participants