A library for interacting with GSM/GPRS module. Based on sim900js.
npm install gsmjs
var gsm = new GSM();
gsm.connect(function(err) {
if(err) return console.log('Error connecting to GSM', err);
console.log('GSM connected');
gsm.status(function(err, resp, raw){
console.log('Status...' + raw[1] + ',' + raw[2]);
gsm.initialize(function(err, resp, raw){
// Do things here
});
});
});
`
$3
`
gsm.request('https://httpbin.org/ip', function(response) {
console.log('-> ' + response);
});
`
$3
`
gsm.request('https://httpbin.org/post',
{
method: 1,
data: JSON.stringify(data),
contentType: 'application/json'
}, function(response) {
console.log('-> ' + response);
});
``