Arduino WiFi shield with Duemilanove?


I'm currently working on a project which involves a LynxMotion AL5B robotic arm. To control it I'm using a BotBoarduino and an Arduino Ethernet Shield. I control the servos of the robot arm with a Web Server and a client made in Visual Studio. Everything works fine and my robot moves as I want it to. I made it so you can request if you want HTML, XML or JSon returned to you depending on what you request.

But that is not what my problem is. Now when I have a working Ethernet Web server which I can control the robot with, I want to make it wireless using an Arduino WiFi shield. I can connect to my network, and the Web server example code works when I browse to the ip address it gets. But when I upload my own code to the BotBoarduio and browse to the ip address, it start a download for some file.

I know that the code is working, because I tested it with an Arduino Uno r3 and it worked exactly as I want. With it working I mean that I can browse to the ip address and it returns correct HTML, XML, and JSon for the different things I put in the URL after the ip. I can't swich the BotBoarduino with the Uno because the Uno doesn't have connections for the five servos I'm using.

I believe that the BotBoarduino is like an older version of an Uno since it doesn't have the SCL, SDA and IOREF pins. For the WiFi to work with the BotBoarduino I have a jumper attached between IOREF and 3,3v and I have read that you might have to add jumpers between SCL and A5, SDA and A4 and maybe D7 and D3, but I don't know which and If any of them to use.

I really don't know what to do after sitting on Google for the past couple of days searching for a solution, but it seems that no one uses the BotBoarduino. All answers are highly appreciated.

The robot arm I'm using:

The BotBoarduino:

Update, is the WiFi shield compatible with an Arduino Duemilanove since the BotBoarduino is a mix of a BotBoard 2 and an Arduino Duemilanove.

Ok, so now I have sat on Google for the past day and haven’t come up with anything. I put some debug prints in my code to see where it fails and it seems that, from the web server example, if(client) always returns false and never enters the code.

And still this only happens when I use the Arduino WiFi shield with the Duemilanove. Like I said before everything works fine with an Uno and the Web Server example itself works fine on the Duemilanove. The code I’m working with is pretty long so bare with me. This is the code that works wit the Uno but not Duemilanove:

#include <SPI.h>
#include <WiFi.h>
#include <Servo.h>

char ssid[] = "networkName";      // your network SSID (name) 
char pass[] = "password";   // your network password
int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

WiFiServer server(80);

// Servo definitions
Servo Elb;
Servo Shldr;
Servo Wrist;
Servo Base;
Servo Gripper;
Servo servoArray[5];     // Array for storing the servos

void setup() 
  // Store the servos in the array
  servoArray[0] = Base;
  servoArray[1] = Shldr;
  servoArray[2] = Elb;
  servoArray[3] = Wrist;
  servoArray[4] = Gripper;

  stop(); // Start the servos detached so they wont fly around when getting power

  //Initialize serial and wait for port to open:
  while (!Serial) 
    ; // wait for serial port to connect.
  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present"); 
    // don't continue:
  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to SSID: ");
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
  // you're connected now, so print out the status:

void moveServo(Servo s, int endPos)
  int currentPos =;    // read current position of servo
  int differance = endPos - currentPos;   // check how much differance is between the two positions
  // Depending on if you want to decrease och increase the angele either add or subtract angles, one at a time
  for(int i = 0; i < abs(differance); i++)
    if(endPos > currentPos)
    delay(45);        // Control the speed of the servos  

void start()
  // x.attach(y) attaches the x servo to the y pin on the board

  // x.write(y) moves the x servo to a chosen angle y

void stop()
  // x.detach(y) detaches the x servo from the y pin on the board

void loop() 
  // listen for incoming clients
  WiFiClient client = server.available();
  Serial.println(client);  // Debug
  if (client) 
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    String request = String();
    Serial.println(client.connected());  // Debug
    while (client.connected()) 
      Serial.println(client.available());  //Debug
      if (client.available()) 
        char c =;     // Read one byte 
        request += String(c);             // Add it to the complete string
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) 
          int textTypeHTML = request.indexOf("text/html");  // Only one of the three int:s will have a value
          int textTypeXML = request.indexOf("text/xml");    // The other two will be -1 since only one text type 
          int textTypeJson = request.indexOf("text/json");  // is accepted at a time
          // Request format 'GET /Servo/2/... HTTP/1.1'
          int firstSpace = request.indexOf(" ");
          int secondSpace = request.indexOf(" ", firstSpace + 1);
          request = request.substring(firstSpace + 2, secondSpace);    // Substring of the servo you chose and chosen position etc
          String message = request;
          String result[7];   // Array to store everything from the url
          int slashPos;
          // Like a split function, locate the first slash of a string and save the string between that slash and the nex one in an array
            for(int i = 0; i <= 6; i++)
              slashPos = message.indexOf("/");      // Position of the current slash
              if(slashPos != -1)                // When there still are slashes
                  String tmp = message.substring(0,slashPos);      // Store current word between slashes
                  result[i] = tmp;
                  message = message.substring(slashPos + 1, message.length());    // Update string without stored word
              {  // if no more slashes
                if(message.length() > 0)    // If there are text after the last slash store it as well
                  result[i] = message;   
          while(slashPos >=0);
          int servoNum;
          int servoPos;

          // Print out current position of all servos
          for(int i = 0; i < 5; i++)
          // Decide wich content type was asked for
          int outputLanguage = 0; //HTML default
          if(textTypeJson != -1)
            outputLanguage = 1;
          if(textTypeXML != -1)
            outputLanguage = 2;  
          // Debug showing wich content type was accepted  

          String contentType[] = {"Content-Type: text/html","Content-Type: text/json","Content-Type: application/xml"};
          String close = "Connection: close";

          int chosenServo = result[1].toInt();
          int chosenPos = result[2].toInt();


          if(outputLanguage == 0) // HTML
            Do stuff if you asked for HTML


          else if(outputLanguage == 1)  // JSon
           Do stuff if you asked for JSon


          else if(outputLanguage == 2)  // XML
            Do stuff if you asked for HTML

          if(outputLanguage == 0)
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
    // give the web browser time to receive the data
    // close the connection:
    Serial.println("client disonnected");

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.println(" dBm");

Hi, I’m trying to set up a webserver using an ethernet shield with the BotBoarduino. The webserver woked just fine on my Arduino Uno, but it acts wierd on the Botboarduino. COuld you share the details of the Ethernet shield you were using? The motors go into a “whining” state whenever any ethernet connection related program is downloaded onto the board.

Please let me know if you ran into something similar!