Git Product home page Git Product logo

amazon-dash's Introduction

https://raw.githubusercontent.com/Nekmo/amazon-dash/master/amazon-dash.png


Latest PyPI version Python versions Code Climate Requirements Status
.. index::

Python Amazon Dash

Hack your Amazon Dash to run what you want. Without welders. For the entire family.

  1. Install Amazon Dash:
sudo pip install amazon-dash
  1. Use discovery mode to know the mac of your Dash (Run the program, and then press the button):
sudo amazon-dash discovery
  1. Create a config file (amazon-dash.yml):
# amazon-dash.yml
# ---------------
settings:
  delay: 10
devices:
  0C:47:C9:98:4A:12:
    name: Hero
    user: nekmo
    cmd: spotify
  44:65:0D:48:FA:88:
    name: Pompadour
    user: nekmo
    cmd: kwrite
  1. Run the daemon:
sudo amazon-dash[ --config amazon-dash.yml] run

By default, amazon-dash will use the amazon-dash.yml file in the current directory with sudo amazon-dash run. However, you can set the path to the file (for example, /etc/amazon-dash.yml) with --config. Please note that --config must be before run.

Contents

Avoid making a purchase by pressing the button

This program detects when your button connects to the network to execute actions, but does not prevent the ordering.

There are 3 ways to avoid making a purchase when you press the button.

Easy mode: Do not choose the product to buy when setting up

When you first set your button, you are asked which product you want to buy when you press the button. If you do not choose an option, the button will work, but an order will not be created.

However, in order to take advantage of the free balance ($5/€5/£5), it is necessary to choose a product. The solution is after ordering, deactivate the button, reconfigure it, and not choosing the product the second time.

However, you will receive an alert in the Amazon application every time you press the button asking you to finish the configuration. You can turn off notifications, delete the application, or use another Amazon account.

Using an advanced router

If you have an advanced router (DD-Wrt, Open-WRT, Tomato, RouterOS...), you can block Internet output from the buttons. This is the preferred option. It is necessary to block the Internet output. Using DNS locks will not work. The button uses its own DNS server IP, ignoring router DNS.

Raspberry PI solution

You can use the Raspberry PI as a router if you have 2 network cards. The method is similar to the previous one, but being a Linux system you can use iptables.

Run at startup

This example is for systems with Systemd. The files of the services are in this link. If your system is not supported, feel free to do a pull request.

  1. Copy amazon-dash.service to /etc/systemd/system/.
  2. Create your config file in /etc/amazon-dash.yml.
  3. Enable your service with sudo systemctl enable amazon-dash.
  4. Start your service with sudo systemctl start amazon-dash.

Examples

Here are some examples of how to use your Amazon Dash button:

Troubleshooting

Requirements and installation

All dependencies are commonly used on a Linux system, but some may not be installed on your system. The dependencies are:

  • Python 2.7 or 3.4+.
  • Python-pip (pip).
  • Tcpdump.
  • Sudo

Why root is required

This program needs permission to open raw sockets on your system. You can set this permission using setcap, but you must be very careful about who can run the program. Raw sockets permission could allow scaling permissions on the system:

setcap cap_net_raw=eip ./scripts/amazon-dash
setcap cap_net_raw=eip /usr/bin/pythonX.X
setcap cap_net_raw=eip /usr/bin/tcpdump

http://stackoverflow.com/questions/36215201/python-scapy-sniff-without-root

References

amazon-dash's People

Contributors

nekmo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.