Introduction: Wireless Doorbell - (Raspberry PI & Amazon Dash)

What does it do? (see video)

When the button is pressed, Raspberry discovers new device logging on the wireless network. This way- it can recognise the button being pressed and pass the information about this fact to your mobile (or a device of your choice)

In this project you will see how to change the Amazon Dash into a wireless doorbell.
(Video tutorial link in the last step)

Things you'll need for this project:


Amazon Dash Button - Amazon offers WIFI buttons in USA which can be set up to skip the Amazon functionality, and make it work as a wireless button or a switch.

Tasker - Android app, which allows you to automate everyday tasks, we will be using this framework to display notification on the mobile

AutoRemote - Tasker plugin which allows communitcation between mobile and raspberry

Raspberry Pi - micro computer which will scan network for WIFI button presses - has to be connected to the network (via WIFI or LAN)

Step 1: Setting Up WIFI Button

Connect the button to WIFI

  1. Press the button for 5 sec to enter the device into a WIFI broadcast mode.
  2. Open your mobile (or any wifi device) and look for the Amazon Configure Me
  3. Once connected to the device open a web browser and navigate to 192.168.0.1
  4. Select your network and enter your password
  5. Your button now is ready to rock

Step 2: Setting Up Raspberry PI

Looking up the MAC of your buttons

Please make sure you have following libraries installed:

sudo apt-get install tcpdump

sudo apt-get install arp-scan

sudo pip3 install scapy-python3

Use Doorbell.py script to find out MAC for your button - see comments in the script.

Script has been updated and modified for Python 3

Setting up the scrip responsible for intercepting button presses

We will need to modify the doorbell.py script, open it and replace YOUR BUTTON MAC GOES HERE with the MAC saved from the step above. Look for YOUR AR KEY GOES HERE - this is where the Autoremote keys will be pasted. I will show you how to obtain the keys in the next step.

If you have the new buttons JK29LP - please see this post for the correct python3 script:
http://www.notenoughtech.com/raspberry-pi/new-amazon-dash-buttons/

Step 3: AutoRemote and Tasker

AutoRemote

Open AR on your mobile and go to your personal URL (something like http://goo.gl/xXxXx). The address bar will contain the key we need for the doorbell.py - it will start with:

http://autoremotejoaomgcd.appspot.com/?key=YOUR_KE...

Copy the key (all after the = symbol) and replace the YOUR AR KEY GOES HERE in the script.

Tasker

We are going to create a profile. Our condition is an EVENT-plugin- Autoremote and set the filter to AmazonGreen (or whatever message you have used in doorbell.py)

Create a Task that will display notification. Open Alert - Notify and type your information. This message will be displayed on your screen.

Profile is provided as a project file.

Step 4: End Tips

Your Raspberry is ready to intercept the button presses. It allows for one press every 6-10 sec, and multiple buttons can be pressed as well. As long as script is running - you can receive the notifications (consider running it at start)

Script should display below warning when operating:

WARNING: No route found for IPv6 destination :: (no default route?)

You can peel of the default label using a sharp tool and glue it other way around or use it as stencil to generate your own. (see picture)

If you want to run this script at startup use rc.local method, put sleep 10before the line with your script to allow the execution.


Full video tutorial on my YouTube channel:
Wireless Doorbell

Comments

author
quintaar (author)2016-03-30

Thank you all who voted for me!
Thanks to your kindness I was able to win 2nd prize in the contest! - You are awesome! I'm new to the website and I hope this will encourage you to share the great stuff you make!
Good luck!

author
quintaar (author)2016-03-16

Instructable updated, errors removed and script updated to python 3
See description.

Thanks for likes and votes

author
fred41 (author)2017-01-14

Hi I have this error :

pi@raspberrypi:~ $ python doorbell.py
Traceback (most recent call last):
File "doorbell.py", line 8, in <module>
import urllib.request
ImportError: No module named request

Do you have any idea to solve it?

Thanks

author
quintaar (author)fred412017-01-15

Hey, do you have an old or new button? Check this post out - it should help you:
http://www.notenoughtech.com/raspberry-pi/new-amazon-dash-buttons/

author
fred41 (author)quintaar2017-01-16

Hi
Yes I have the new model : JK29PL
I already tried the modified version, same error.
Maybe I'm doying something wrong, here are the scripts I tried, if you could have a look :

https://dl.dropboxusercontent.com/u/16549393/Doorbells.zip

Thanks a lot.

author
quintaar (author)fred412017-01-16

are you running this via python or python3 ? the message you get means the python is unable to find the correct library - which should be served with python3 already.

author
ThomasL99 (author)2016-04-26

I used this article over a month ago to create my own 'hack' for it as a notification system. I am experiencing issues, though. It is used quite a lot so I am thinking because these buttons are not meant to be used so often they are failing quicker.

I have a system that has 6 buttons and when you click one I created a small one page app using node.js to detect the arp request and then flash a div on the screen (all on an rPi) you tap the touch screen on the flashing box to close it.

The problem is with the buttons one of them died completely, it does not do anything anymore, no light or anything.

Other times the rPi fails to detect the packets. I am using an rPi 3 with the built on wifi adapter so it's more reliable than the USB one. It would work great for 2-3 days then fail and need a reboot (with no real good reason) and then work for a couple more days and one or two buttons would fail. Now, it is not working at all.

I am wondering if anyone else had problems like this ?

author
quintaar (author)ThomasL992016-04-27

I found the best performance to be when RPI is wired to the router. Make sure you get good reception for your buttons, remember that only because your mobile/pc is in range doesn't mean that button is able to broadcast, the one that died - you can try to replace the battery. Dash specs say they aim for 1000 pushes per button battery wise.
I had to restart the script few times (usualy after few days) but im not sure what is the issue behind this one, rebooting your RPI daily with autoloading script seem to be the way to go

author
ThomasL99 (author)quintaar2016-04-27

Well, they all would work great for a couple days, so I know the range is not the problem. This last time we had the problem it didnt work at all and I brought the button to the front room which is near the router also and it still didnt work.

I am likely going to revamp the system entirely and integrate the same function that the button provides into something else using the rPi.

I thought it worked so well but we're just having issue after issue, it's unfortunate that this didn't work out.

author
quintaar (author)ThomasL992016-04-27

the only solution I can think of would be flic.io but with the steep price tag, it may be a little too much to ask for

author
wold630 (author)2016-02-12

Very nice! Curious about the Bounty and Tide logos on the buttons?

author
MartinK3 (author)wold6302016-04-01

I'm planning on using one to use as a notifier for our washing machine as it doesn't have a buzzer built in so my Tide branded one is perfect for that!

author
quintaar (author)MartinK32016-04-01

Are you trying to mod the button into the washing machine? -I would like to see this in action:) cool idea. If this is the case a lot of devices could be IoT enabled this way:)

author
quintaar (author)wold6302016-02-12

These are default stickers. Can be removed. Amazon dash comes with several brands stickers meant to make it easier to order products. In my guide they have obviously no influence :) although I could eat a bounty bar now:!

author
timeman2 (author)2016-03-31

This is such a great ible! I'm making one right now. My wife just asked if it would be possible to add an electric door lock to the equation; any thoughts or suggestions? I'm a retired electronics guy but I'm a noob at coding!

author
quintaar (author)timeman22016-03-31

I can't see why not. It would be a matter of powering a electro magnet on/off when button is pressed so a relay could take care of this and a hall sensor could assure that you get a feedback once door is open or closed

author
ThomasL99 (author)2016-03-22

Python3 version works great! :D I had to modify it because I am not using appspot, but it works very well for my purposes. Thank you again!

author
quintaar (author)ThomasL992016-03-23

Awesome. Enjoy :)

author
aboogieman (author)2016-02-17

I got (the first of) my buttons today. So that was pretty quick.

I'm off to start using one! For... something. :)

author
quintaar (author)aboogieman2016-03-16

All issues fixed with the new script (python 3) see description and file attached

Regards

author
quintaar (author)aboogieman2016-02-18

awesome! First to click I MADE IT?! :D

author
aboogieman (author)quintaar2016-02-19

So far I'm having trouble, or else missing something. I have two encrypted Wi-Fi networks in my house, one for guests and one for us. So maybe that has something to do with it?

The symptom is that I can connect to the button's "web page" and I can enter the Wi-Fi password, but as soon as I submit, the LED on the button turns red.

Any ideas? Has anyone ran into this? (I have not contacted support. I thought I'd ask here first.)

author
quintaar (author)aboogieman2016-02-19

button should flash white few times then turn red. I think it turns green on successful order from amazon.

author
aboogieman (author)quintaar2016-02-19

Thanks, Quintaar! Maybe it's flashing the white. I'm guessing that it is, and I've been too focused on whether the form submission was accepted. (It does not report any errors, but I'm not sure it ever does, based on the wording of it.)

However, I've tried your script and I cannot get it to see the button. Tried it before, during and after initializing the button. So far nada.

I'm definitely going to give it another go. I've noticed some noise from some power combinations, even though I've used only power supplies for the RPi. The problems come when using power from a battery pack that is charging. That small amount of interference is enough to prevent my sensor from detecting. (I might be able to fix this with a strategically-placed cap or two. I think I may experiment with this before the buttons. Both sound fun! :D )

author
mdmesser001 (author)2016-02-19

Well, I got it working! My phone notifies me when the button gets pushed! Problem is, if I close my terminal window, the script stops. How do I keep the script running?

author
quintaar (author)mdmesser0012016-03-16

All issues fixed with the new script (python 3) see description and file attached

Regards

author
quintaar (author)mdmesser0012016-02-20

Also hit that I MADE It button and show the most creative ideas you come up with on using the button :)

author
quintaar (author)mdmesser0012016-02-20

Script has to be running constantly to be able to pick up the moment button registers on the device. Open it as a python script and this way you don't need an extra terminal window.

author
ThomasL99 (author)2016-03-11

I love this walkthrough. It is great and I am modifying it for my specific purpose. The key thing is getting the notification from the dash via the python script. I am going to light a led when a certain button is pushed and have a reset button for the LED to turn it back off.

I am having a problem. It is extremely inconsistent with the ARP packets detection on the script.

I had to use foxfi on my phone, put ONLY the dash and the rpi on the network to get the detection to be semi decent (I also used foxfi to get the mac addresses of the dashes since it displays who is connected to the network with their mac address. I have it looping the sniff and after 30-40 seconds i clicked the buttons and they were both detected, the bounty one detected twice. I click them again right after and nothing.

Anything I should look out for ? I need high reliability for my project to work.

Thank you,

Thomas

author
quintaar (author)ThomasL992016-03-16

All issues fixed with the new script (python 3) see description and file attached
Regards

author
quintaar (author)ThomasL992016-03-11

I'm working on Py3 solution to this - although I have no issues with button presses - the auto start has big issues due to errors for me. limitation of the button is that you should not expect the button to respond more often than 6-10 sec.
How often you need to press the button?
Do you expect low latency of notification?

author
ThomasL99 (author)quintaar2016-03-11

Apparently the rPi being on wifi and detecting the ARP packets do not mix well (for me anyway). I hooked up a lan cable to the rPi and voila it detects them 100%. :D

This is a much easier resolution than I others I was thinking of like having to use an rpi or arduino per switch. Basically recreating what the amazon dash does.

author
quintaar (author)ThomasL992016-03-11

have a look on this:
https://www.instructables.com/id/Wake-on-LAN-Any-Co...

Look into the interfaces step for the network policy config, and see if this fixes your issues with button presses detection

author
ThomasL99 (author)quintaar2016-03-11

It likely would not need to be very frequent. It's a notification system from other rooms.

Even after several minutes of running the script i click the buttons and it still does not detect it. I need it to be reliable enough for a click every few minutes

author
quintaar (author)ThomasL992016-03-11

You should not have this issue, I didnt have other problems than startup, I wonder what would be the difference. Do you have the same issue with the script responsible for detecting the button MAC?

author
ThomasL99 made it! (author)2016-03-12

I don't use IFTTT or anything. I expanded upon that script to detect the mac addresses and am lighting an LED based on the button press then when you click a button it turns it off.

I made this video

I have the code on my github

https://github.com/tvl83/rpi-dash-notifier

I know I need to find a better way to do this. I am brand new to Python so I am not familiar with using classes and stuff in python. Right now I have to execute both scripts. One monitors the network and turns on the LED when it's detected and the other is for the buttons that turns off the LED when you click the button. There is duplicate code and the fact you have to run two scripts is kind of sloppy, I know. I'll refine it as I move forward. :D

0312161030.jpg
author
quintaar (author)ThomasL992016-03-12

Joining the code shouldn't be that hard (I'm new to python as well) and you can do this but import script action then use the functions within your new script. That's should do it. Btw did you overcome the errors that were given on the start of the file?

author
ThomasL99 (author)quintaar2016-03-12

Well, sometimes I do have to run the script multiple times cause it says it can't find the [arp] layer. I just rerun it then it is stable. I had it running all night (no activity of course) and in the morning I pushed the buttons and it works still.

One other issue is that the sniff method from scapy runs and does not allow any other code to execute. I had it in one script already and I couldn't turn off the lights cause it was always sniffing.

To solve the auto-start errors perhaps a bash script that somehow detects if the pid is still running and if not re-run it will work. I have not created bash scripts before but i think if you execute a command you can get the pid and then do a check for that pid.

author
quintaar (author)ThomasL992016-03-12

I'll be working on Py3 versions so I hope i will find the solution to both issues. :) I will update the files here once this is working better. I'm not 100% happy with the lack of auto start for the script

author
mdmesser001 (author)2016-02-18

Can someone point me to instructions on using the WIFIsearch.py script?

author
quintaar (author)mdmesser0012016-02-19

open script on your raspberry and run it. When you press the button, you will see the MAC address for this button popping out! save the address and add it to the doorbell.py script

author
mdmesser001 (author)quintaar2016-02-19

I'm getting an error on my pi: socket.error: [Errno 1] Operation not permitted

author
quintaar (author)mdmesser0012016-02-19

You can also change the last line to:

print sniff(prn=arp_display, filter="arp", store=0, count=10)

and run the file again

author
mdmesser001 (author)quintaar2016-02-19

I got it working! Got mac addresses for all my Dash buttons! Now I just gotta get the next steps done. THANKS AGAIN for your help!

author
quintaar (author)mdmesser0012016-02-19

are permission on file set to allow execution? Also update the pi and following:

sudo apt-get install python-scapy

sudo apt-get install tcpdump
sudo apt-get install arp-scan

Then reboot the pi

author
mdmesser001 (author)quintaar2016-02-19

Thanks very much! Will do this tonight after work. Sure appreciate the guidance.

author
quintaar (author)mdmesser0012016-02-19

You can also change the last line to:

print sniff(prn=arp_display, filter="arp", store=0, count=10)

and run the file again

author
quintaar (author)2016-02-14

As far as I'm aware this was the USA only, (which sucks) but if you have some good friends in USA - shipping to UK of 2 buttons was $7.50 :)

author
aboogieman (author)quintaar2016-02-14

You just opened up my market share, you know? If shipping was $7.5 + $10 worth of buttons, I could sell for $20 and make $2.5 to split with whomever I buy them from. Hmm... I wonder.

I'm just kidding... mostly. Anyone outside the USA interested in paying shipping + finders fees? :)

author
quintaar (author)aboogieman2016-02-14

Dont forget that amazon refunds $5 on the first purchase through the button as well making it essentially free :)

About This Instructable

17,015views

137favorites

License:

Bio: I am passionate about technology, cycling and art. This would explain why my bike has more computing power than your average office. I'm an ... More »
More by quintaar:Amazon Dash Security Sensor Build a ESP8266 Flash Adapter!Raspberry Pi As Wake on LAN Server
Add instructable to: