Just an update to say that I've added a new module for SMS text messaging, to be found here: http://www.espruino.com/ATSMS
This works on most Espruino devices, and should work on most different types of GSM modem - but let me know if not!
For instance for Puck.js, I used D1 and D2:
// Connect to serial device
Serial1.setup(115200, { rx: D1, tx : D2 });
var ATSMS = require("ATSMS");
var sms = new ATSMS(Serial1);
//Use sms.at.debug(); here if you want debug messages
sms.init(function(err) {
if (err) throw err;
console.log("Initialised!");
sms.list("ALL", function(err,list) {
if (err) throw err;
if (list.length)
console.log(list);
else
console.log("No Messages");
});
// and to send a message:
//sms.send('+441234567890','Hello world!', callback)
});
sms.on('message', function() {
console.log("Got a message!");
});
Note that using the serial port on Puck.js causes it to keep the oscillator on so it can receive serial data. This uses a bunch of power, so it'd be worth trying to power your Puck.js from the 3.3v regulator on your GSM module (which they usually have).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi!
Just an update to say that I've added a new module for SMS text messaging, to be found here: http://www.espruino.com/ATSMS
This works on most Espruino devices, and should work on most different types of GSM modem - but let me know if not!
For instance for Puck.js, I used D1 and D2:
Note that using the serial port on Puck.js causes it to keep the oscillator on so it can receive serial data. This uses a bunch of power, so it'd be worth trying to power your Puck.js from the 3.3v regulator on your GSM module (which they usually have).