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

node-dash-button

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-dash-button

a module for integrating amazon dash button presses into a node project

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-46.67%
Maintainers
1
Weekly downloads
 
Created
Source

Blank Dash

node-dash-button

gitter

Place it. Hack it. Press it. Get it.

This module was inspired by this fantastic article by Edward Bensen.

It is a simple library that will allow you to utilize a dash button to emit an event. I am using the same strategy of watching for dash generated ARP requests as the article above.

Contents


Installation Instructions

The following should work for ubuntu, the main thing for any os is getting the libpcap dependancy.

# dependancy on libpcap for reading packets
$ sudo apt-get install libpcap-dev
$ npm install node-dash-button 
First Time Dash Setup

Follow Amazon's instructions to configure your button to send messages when you push them but not actually order anything. When you get a Dash button, Amazon gives you a list of setup instructions to get going. Just follow this list of instructions, but don’t complete the final step (#3 I think) Do not select a product, just exit the app.

Find a Dash

To find a dash on your network, run the following from the node-dash-button directory in node_modules:

# you may need to use sudo due to libpcap running in permiscuous mode
$ cd node_modules/node-dash-button
$ node bin/findbutton

It will watch for new arp requests on your network. There may be several arp requests, so press it a few times to make sure. Copy the hardware address as shown below

hw address

Example Usage:

For a single dash

//warning this may trigger multiple times for one press
//...usually triggers twice based on testing for each press
dash_button = require('node-dash-button');
var dash = dash_button("8f:3f:20:33:54:44"); //address from step above
dash.on("detected", function (){
	console.log("omg found");
});

For multiple dashes:

dash_button = require('node-dash-button');
var dash = dash_button(["8f:3f:20:33:54:44","2e:3f:20:33:54:22"]); //address from step above
dash.on("detected", function (dash_id){
    if (dash_id === "8f:3f:20:33:54:44"){
        console.log("omg found");
    } else if (dash_id === "2e:3f:20:33:54:22"){
        console.log("found the other!");
    }
});
Example Projects:

I collected a few examples I found on github of how people are using this module, some projects are more mature than others

  • PizzaDash uses a node dash to order Domino's pizza. The Verge, Gizmodo and Grubstreet did short writeups on the PizzaDash project].
  • dashgong uses the node dash to send a message to slack
  • dash-listener performs various home automation tasks like adjusting lights and interacting with a music player
  • Nest-Dash toggles the Nest setting from away to home via Amazon Dash Button
  • dash-hipchat-doorbell quick and dirty node app that intercepts traffic from an amazon dash button and creates a hipchat notification (think doorbell)
  • netflixandchill button to netflix and chill, dims the lights (no interface with netflix yet)
  • dash-rickroll title explains it all
To do
  • figure out how not to use root and fix CI
Contributions

Accepting pull requests!

License

The MIT License (MIT)

Copyright (c) 2015 Alex Hortin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 14 Oct 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