npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quipu

v0.1.11

Published

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

Downloads

24

Readme

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:

  • uninitialized: quipu was just turned on, nothing's happening.
  • initialized: quipu has its sms and modem ports open. It is then capable of receiving/sending sms, and opening a 3G connection.
  • 3G_connected: quipu is now connected to internet via a 3G connection.
  • tunnelling: quipu has a ssh connection opened with some remote server.

States of quipu

Compressing messages

If you're using the SMS protocol, you may have some troubles sending some messages, because of the size (160 characters) or some characters, such as curly braces. The file parser.js provides and encode and decode functions that can help you, for example, passing 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);
        })      
});

Compatibility

This project has been developped and tested for the following 3G devices:

References

AT commands:

SMS format:

PPP: