Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quipu

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quipu

This modules provides SMS and 3G functionnalities in node.js.

  • 0.1.8
  • npm
  • Socket score

Version published
Weekly downloads
26
increased by2500%
Maintainers
1
Weekly downloads
 
Created
Source

Quipu

This modules provides SMS and 3G functionnalities in node.js.

From Wikipedia article: "A quipu usually consisted of colored, spun, and plied thread or strings made from cotton or camelid fiber. For the Inca, the system aided in collecting data and keeping records, ranging from monitoring tax obligations, properly collecting census records, calendrical information, and military organization."

Getting started

After creating a file called myPINcode.js containing module.exports = xxxx; your pin code, you can use the library as follows:

var quipu = require("./index.js");

// initilize the device
var yourNumber = "336........";
var devices = {
    modem: "/dev/ttyUSB0",
    sms: "/dev/ttyUSB2"
};

quipu.handle("initialize", devices);

// sending a SMS
quipu.sendSMS("Hello from quipu.", yourNumber);

// receiving SMS
quipu.on("smsReceived", function(sms){
    console.log(sms);       
});

// spawning a 3G connexion and closing it after 30 seconds
quipu.handle("open3G");

setTimeout(function(){
    quipu.handle("close3G");
}, 30000)


// open a reverse ssh tunnel towards "kerrigan" (must be set in your ~/.ssh/config)
quipu.handle("openTunnel", 2222, 9632, "kerrigan");

setTimeout(function(){
    quipu.handle("closeTunnel");
}, 30000)

Behind the scene, there is a final state machine (FSM) with the following states:

States of quipu

Compressing messages

160 characters is not a lot and you have useful characters like curly braces that ar not well handeled by sms protocol. So parser.js provides and encode and decode functions that can help you pass json objects through the air:

// to send encoded, as sms don't like curly braces and other stuff
var parser = require("./parser.js")

parser.encode(devices)
    .then(function(msg){
        quipu.sendSMS(msg, yourNumber);
    })
    .catch(function(err){
        console.log(err);
    });
// and to decode use 
quipu.on("smsReceived", function(sms){
    parser.decode(sms.body)
        .then(function(object){
            console.log(object);
        })      
});

References

AT commands:

SMS format:

PPP:

FAQs

Package last updated on 22 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc