This script will execute around 2-3 seconds after the click vs the nodejs alternative that are called when the button flashes red (about 10 seconds after being clicked). It is also extremely light weight as most linux distros have the packages installed already vs nodejs which is a huge library.
When you receive your brand spanking new Dash Button set it up using the Amazon app, which is available for iOS and Android:
- On the app go to Your Account -> Set up a new device.
- Select Dash Button and follow the multiple instructions until you are prompted to select a product - ! Do not select a product !.
Finding the MAC address of the Dash Button
We need to first get a list of OUIs (Organizationally Unique Identifier) for amazon products.
Now you should:
Run this as root
$ while :; do arp-scan --localnet -O ieee-oui.txt | grep 'Amazon'; done
Click the Dash Button.
ctrl-cto exit loop.
rm ieee-oui.txtto delete the list.
You can use either
amazon-bash.shis for use when you do not have a wifi dongle.
amazon-bash-wifi.shis for when you do (the latter has a lot faster reaction speed). This method also requires that you install
Within the scripts you need to update the
MAC variable to the one we found earlier.
And also you need to update the
onClick function to include what you want to happen on the click. Some ideas:
Also a reminder that if you want this script to run permanently:
- Make the script executable
chmod +x /path/to/amazon-bash-wifi.sh
- Add @reboot /path/to/amazon-bash-wifi.sh to your crontab
purchase of a Dash Button
I bought a Dash Button for £4.99 not knowing that you were limited to the product the sticker shows (I bought it judging on the best available logo, which turned out to be Ariel). As I am a student I cannot actually afford the luxury of Ariel washing capsules but on the other hand as I am a Computer Science Student I could have done with Listerine