Please forgive me if this is a dumb question, but I have been googling this problem for hours and haven't made much, if any, progress. How does one go about getting an Uno R3 with a wifi shield to tweet on twitter? I'm very new to arduino and could use some advice form anyone who had done this. It seems to be a popular use of the platform, but I am not having any luck. I found a guy on instructables at http://www.instructables.com/id/How-to-tweet-from-an-Arduino-using-the-wifi-sheild/ and tried to follow his work as close as possible. The code he wrote was for use with a WPA network and I am using a WEP network. I tried modifying the code just taking lines form the ConnectWithWEP script. This is what I got:
#include <SPI.h> // needed in Arduino 0019 or later
#include <WiFi.h>
#include <Twitter.h>
char ssid[] = "MYNETWORK"; // your network SSID (name)
char key[] = "MYKEY"; // your network key
int keyIndex = 0; // your network key Index number
int status = WL_IDLE_STATUS; // the Wifi radio's status
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("tokenfromhttp://arduino-tweet.appspot.com/");
// Message to post
char msg[] = "Arduino Tweet Test";
void setup()
{
delay(1000);
WiFi.begin(ssid, keyIndex, key);
// or you can use DHCP for automatic IP address configuration.
// WiFi.begin(mac);
delay(10000);
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while(true);
}
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to WEP network, SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, keyIndex, key);
// wait 10 seconds for connection:
delay(10000);
}
Serial.println("connecting ...");
if (twitter.post(msg)) {
// Specify &Serial to output received response to Serial.
// If no output is required, you can just omit the argument, e.g.
// int status = twitter.wait();
int status = twitter.wait();
if (status == 200) {
Serial.println("OK.");
} else {
Serial.print("failed : code ");
Serial.println(status);
}
} else {
Serial.println("connection failed.");
}
}
void loop()
{
}
This didn't work it said:
Attempting to connect to WEP network, SSID: MYNETWORK
connecting ...
connection failed.
A number of places online indicated that Arduino had compatibility issues with twitter after Twitter rolled out its API 1.1. Christiaan de Die le Clercq aka Techwolf12 said "Update the twitter API in arduino, if not the project won't work. Working on it soon!"at adafruit.com. I don't know exactly what he meant and am unsure if that is what is holding me up.
However, Riccardo ?rtolupi tweeted "finally tweeting via an @arduino #WiFiShield!" 17 hours ago. Hopefully he gets back to me.
I would really appreciate it if anyone can tell me what to do