Repurposing an Amazon Dash Button - written by on 2018-01-21

Repurposing an Amazon Dash Button

The most known, cheapest and best IoT button, repurposed.

Amazon's Dash Buttons are quite incredible. For just $5 you can modernize such a common task as shopping. With a single press, you can order from dishwasher to toilet paper, instantly and effortlessly. These buttons connect via WiFi to Amazon servers, and when they're done, they shut themselves off.

Taking advantage of this, we can easily repurpose them for all of our IoT needs, in a cheap way. The process is as follows:

  • When the button is pressed, it connects to the WiFi access point
  • We detect that connection
  • We act accordingly

Simple, isn't it? Let's get it working

First we have to configure the button. For this we'll follow Amazon's instructions, but when prompted to choose a product to order, just quit the app, so no product will be ordered.

We'll also need the button's MAC address. With this code, every device connecting to the network will be displayed. Just run it and click the Dash Button a few times.

from scapy.all import *

def arp_display(packet):
  if packet[ARP].op == 1:
    print('ARP Probe detected: ' + packet[ARP].hwsrc)

sniff(prn = arp_display, filter = 'arp', store = 0, count = 0)
Dash

We've got the MAC address. Great! Now, slightly modifying the code, like this:

from scapy.all import *

def arp_display(packet):
  if packet[ARP].op == 1:
    if packet[ARP].hwsrc == '50:f5:da:df:0b:80': # change this
      print('Button has been pressed!')

sniff(prn = arp_display, filter = 'arp', store = 0, count = 0)

Will make the code only react to the Button's address.

Dash 2

With this, now it's just a matter of tailoring the script to suit your personal needs. From sending an email to controlling another IoT appliance, the possibilities are endless.



No comments yet


Leave a comment