Arduino Ethernet sending over sketch via FTDI friend

Hey all i am trying to send over my code to my Arduino Ethernet board via the Adafruit FTDI friend. I am using the 1.0.4 version of the IDE and have the following settings:

Tools → Board → Arduino Ethernet
Tools → Serial Port → COM 3

The sketch is sent over to the board without problems or errors… however i am unable to see the IP of the board when i check my “attached devices” in my routers settings menu.

Here is a snip of the code i used:

  byte ip[] = { 192, 168, 9, 199 };   //Manual setup only
  byte gateway[] = { 192, 168, 9, 1 }; //Manual setup only
  byte subnet[] = { 255, 255, 255, 0 }; //Manual setup only

  // if need to change the MAC address (Very Rare)
  byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

  EthernetServer server = EthernetServer(199); //port 199

void setup(){
  Serial.begin(9600);

  //Pins 10,11,12 & 13 are used by the ethernet shield

  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);

  //Ethernet.begin(mac);
  Ethernet.begin(mac, ip, gateway, subnet); //for manual setup

  server.begin();
  Serial.println(Ethernet.localIP());

}

Here is a screen shot of the router settings:

And this is my arduino ethernet hookup:

What could i be missing?

This will cause trouble. These parameters are incorrect. This has the subnet as the gateway.

 Ethernet.begin(mac, ip, gateway, subnet); //for manual setup
 // it should be
 Ethernet.begin(mac, ip, gateway, gateway, subnet); //for manual setup

With the gateway set to 255.255.255.0, it won't contact your router for anything unless it uses dns. The first gateway parameter is the dns server.

This seems to come up every now and then. It appears the problem is the documentation site example is wrong. http://arduino.cc/en/Reference/ServerBegin

Incorrectly showing:

  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);

The header file for ethernet.h shows:

void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, 
                        IPAddress gateway, IPAddress subnet);

Correctly, it should be stated as:

  // initialize the ethernet device
  Ethernet.begin(mac, ip, dns, gateway, subnet);

Clarification: a DNS server is not a gateway, it is a server.

Clarification: a DNS server is not a gateway, it is a server.

My gateway router is my dns server. But even if it wasn't, I use that as a placeholder if I do not plan on using dns.

Yes, fair enough, I agree. Just wanted to clarify it in case someone needs to use a separate dns server. I guess it could be stated that if no dns is used then substitute the gateway address in place.

In any case the website has an incorrect example.