twitter_button
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | twitter_button [2013/08/13 12:13] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | The Twitter Button is Back in Business! | ||
+ | (Expect updated code soon) | ||
+ | Note: Twitter changed its authentication system to reject basic http auth... | ||
+ | This < | ||
+ | ===== Summary | ||
+ | The " | ||
+ | The project has since been expanded to include an RFID reader to identify keyholders in addition to the button. | ||
+ | |||
+ | ===== Status ===== | ||
+ | **Active Use!** | ||
+ | The button is up and mounted next to the door! | ||
+ | Current twitter button status can be viewed on the [[When Are You There?]] page :) | ||
+ | |||
+ | ===== Objectives | ||
+ | Completed: | ||
+ | * Light up button while "NSL is open" | ||
+ | * Tweet status | ||
+ | * Status change by button-press | ||
+ | * Read and Identify RFID card | ||
+ | * Status change by RFID read | ||
+ | * Specific status change based on RFID card used | ||
+ | * Twitter session [[no|longer]] expires after 10 min. | ||
+ | * Twitter wont let you " | ||
+ | |||
+ | In Progress: | ||
+ | * Configure for keyholder RFID cards... So far I have a handful of cards set up, let me know if I've missed you... | ||
+ | * Package into Box | ||
+ | * Sleep | ||
+ | |||
+ | Current Issues: | ||
+ | * Twitter has a limit on posts per hour... not nice for testing | ||
+ | * Fit everything into the box, need to play more tetris. (I think that everything fits now) | ||
+ | * Make holes in box for power/ | ||
+ | |||
+ | Future Plans: | ||
+ | * Authenticate RFID with a Python app on server. | ||
+ | |||
+ | ===== Code - Basic Concept | ||
+ | '' | ||
+ | < | ||
+ | - include < | ||
+ | |||
+ | byte mac[[]] = { 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed }; | ||
+ | byte ip[[]] = { 10, 0, 5, 247 }; | ||
+ | byte gateway[[]] = { 10, 0, 0, 1 };\t\t\t// neccessary to get access to the internet via your router | ||
+ | byte subnet[[]] = { 255, 0, 0, 0 }; | ||
+ | byte server[[]] = { 128, 121, 146, 100 }; | ||
+ | |||
+ | Client client(server, | ||
+ | |||
+ | void setup() | ||
+ | { | ||
+ | < | ||
+ | Ethernet.begin(mac, | ||
+ | Serial.begin(9600); | ||
+ | delay(1000); | ||
+ | Serial.println(`connecting...`); | ||
+ | if (client.connect()) { | ||
+ | Serial.println(`connected`); | ||
+ | client.println(`POST http:// | ||
+ | client.println(`Host: | ||
+ | client.println(`Authorization: | ||
+ | | ||
+ | \t\t\t\t\t\t\t\t\t\t\t\t// | ||
+ | < | ||
+ | client.println(`Content-type: | ||
+ | client.println(`Content-length: | ||
+ | client.println(`Connection: | ||
+ | client.println(); | ||
+ | client.print(`status=Yahoo, | ||
+ | } else { | ||
+ | Serial.println(`connection failed`); | ||
+ | }</ | ||
+ | } | ||
+ | |||
+ | void loop() | ||
+ | { | ||
+ | < | ||
+ | if (client.available()) { | ||
+ | char c = client.read(); | ||
+ | Serial.print(c); | ||
+ | } | ||
+ | if (!client.connected()) { | ||
+ | Serial.println(); | ||
+ | Serial.println(`disconnecting.`); | ||
+ | client.stop(); | ||
+ | for(;; | ||
+ | \t; | ||
+ | < | ||
+ | }</ | ||
+ | } | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | ===== Contact | ||
+ | Any inquiries/ | ||
twitter_button.txt · Last modified: 2013/08/13 12:13 by 127.0.0.1