After combining the sender, receiver and both Twitter sketches (and making some adjustments), I now present to you... the final result.
The following sketch
- checks for tweets with a specific hashtag every 40 seconds. When it finds one, it makes the doorbell ring and posts the screen name of the tweep as a new tweet;
- posts a tweet when someone pushes the doorbell button.
To avoid posting a duplicate tweet (which isn't allowed by Twitter), the program appends a timestamp to each tweet.
Lees verder How to hack a doorbell and connect it to Twitter - Part 7: Adding it all together →
Besides detecting the signal with the "sniffer" sketch, this part took me the most time to figure out. It turns out that Twitter just recently decided that you can't use a HTTP GET command of the REST API v1.0 anymore. Developers must now use v1.1, which means you have to use OAuth even if you want to search for tweets. Since just recently, Twitter offers applications the ability to issue authenticated requests on behalf of the application itself (as opposed to on behalf of a specific user). This is called Application-only authentication, but the drawback of this is that you have to connect to the Twitter servers through SSL. Unfortunately, an Arduino isn't capable of doing this because it hasn't enough recources to do so.
Lees verder How to hack a doorbell and connect it to Twitter - Part 6: Using an Arduino to search on Twitter →
I use the following sketch to test if the doorbell speaker reacts on the signal I found. It turned out that it works better when I adjusted the timings a little bit. That's why you won't find 520 microseconds, but 417 microseconds in line 29 of the code.
Lees verder How to hack a doorbell and connect it to Twitter - Part 3: Using an Arduino to send a wireless RF signal →