Trouble w/ getting an Uno R3 w/ wifi shield to tweet on twitter. Please Help!

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

I'd tackle the problem step by step:
a) first build the code to just connect to Wifi

  • just make a simple sketch to establish that connection first
  • use the examples of the Arduino Wifi
  • use this ? : WiFi - Arduino Reference

Once you have the connection established it is easier to focus on the Twitter part.

@edit: Went through you code again. Seems you already have the wifi connection. otherwise you would not get the last message. May I suggest to change the message "connecting..." to "sending message to Twitter" ?

Hey nicoverduin,
Thanks for the input. The problem turned out to be the firmware for the wifi shield. Once that was taken care of the script worked with no problems. Getting the firmware updated with a mac was a bit tuff. If anyone reading this is in a similar situation, I would recommend checking out How to update the official Arduino Wifi Shield by Jens Chr Brynildsen. I would not have been able to get it done without his page, and the writeup by Mossimo at http://arduino.cc/en/Hacking/WiFiShieldFirmwareUpgrading. But be aware that those pages may be little dated. I don't think one still has to go to github to get the updates, as they come with the Arduino 1.0.5 IDE