Wireless Doorbell “Piece of junk” —GeorgeC “Simply does NOT perform” —jtreader “Avoid this product” —Julian “Worthless Door bell” —decodenise “Worked one hot second after installed” —NotWorking “Over priced paper weight” — Straightline22
Prototype Circuit ● Using a single GPIO pin ● Over an 4N35 optocoupler ● Setting the GPIO pin output to HIGH “presses” the button ● Button sends a RF signal to the doorbell to ring it
But, if this were to be real doorbell… ● Visitors cannot connect through USB and type commands ● Would be silly to add a new button to tell Omega to tell the old button to ring the doorbell
IoT to the rescue! ● The natural path is to trigger the button via WiFi ● But, the Omega is behind a NAT on my WiFi at home ● Decided to run a client and not a server on the Omega
Doorbell Ringer ● Python script, running as a daemon via /etc/init.d ● Uses Twitter API ● Watches live user stream of @DoorbellRinger ● Rings the bell when it sees “#ringit”
Need a local trigger that is not a physical button ● Thought about using QR codes ● Visitor scans a QR code, is taken to a URL that tweets on behalf of the visitor ● Already had an OLED display for my Omega ● The same good friend recommended that I use TOTP for token generation -- what Google Authenticator uses
Doorbell Nudger ● Node.js server running on Heroku ● Generating TOTP tokens every 30 seconds ● Shows QR code image + token value + timer ● QR code encodes a callback URL ● Callback tweets as @DoorbellNudger ● Curious hack to avoid adding an API: piggyback token value as a cookie in the image response
Going the extra mile… ● Vagrant box with OpenWRT image for local development ● Travis CI runs Python tests, ● Calls webhook on Heroku when tests pass, ● Which in turn results in a tweet from @DoorbellNudger with #update ● Which in turn prompts the Python service on Omega to self-update from GitHub
Play! ● Apply skills that you use for “serious” work to “silly” projects to hone your skills ● Problem solving is fun, so invent new problems ● You don’t need a serious/real project to start experimenting with new stuff - just do silly things ● End-to-end, planned execution practice ● Pleasure of getting multiple moving parts working together ● Conversation starter (or ender) ● Fun
New things that I’ve learned/done about in this project Optocouplers, OpenWRT (ubus, opkg, uci), Twitter API, TOTP, QR codes, Python (virtualenv, unittest), Travis CI webhooks, /etc/init.d scripts, Onion relay expansion, using USB storage as rootfs, animating a countdown pie chart in , plus more I’m probably forgetting to appreciate.