Arduino Ethernet Shield V1.1

I have an arduino ethernet shield V1.1
I can’t get it to connect. I have tried the examples provided.
I was Trying to get to to connect to mail server it compiles but no luck here is the code

#include <Ethernet.h>

#define LEDPIN 9 // LED connected to this pin
#define TTL 10000 // time to live : time before a command is considered to be lost

byte mac[] = {0x54,0x55,0x58,0x10,0x00,0x24};

// IP settings
byte ip[] = {192, 168, 2, 15 };
byte gateway[] = {172, 30, 34, 254 };
byte subnet[] = { 255, 255, 255, 0 };

byte webmail[] = {74,125,227,17}; //
char user[] = "yourname"; // your user name
char pass[]="yourpass"; // your password
int i,length,command_id;
unsigned long time,iteration;
boolean message_flag;
char c;
char matchseq[] = "UNSEEN"; // char seq that indicates new messages
int matchseqlength;

Client client(webmail, 143);

int asknwait(int count, char* command, ...) // this function sends the command in char command to the server and waits for an answer

  Serial.print(" ");

  client.print(" ");

  // handles severals char arg
  va_list l_Arg;
  va_start(l_Arg, count);

  while( count ) {
    command =  va_arg(l_Arg, char*);


  time = millis()+TTL;
  Serial.println("Wait... ");
  while(!client.available()){ // waiting for an answer from the server
    if (time < millis())
      Serial.print("Time out. Close the connection.");
      Serial.println(" Reset the connection");
      return -1;

  return 0;


void setup()
  // global variable initialization
  iteration = 0;
  int j,k;


  matchseqlength = sizeof(matchseq)/sizeof(char)-1;

void loop()

  Serial.print("Iteration : ");

  // is client connected ?
  if (!client.connected()) {
    Ethernet.begin(mac, ip, gateway, subnet);
    if (client.connect()) {
    else {
      Serial.println("Connection failed. Next try in 5 s.");
      goto start;


  if(asknwait(4,"LOGIN ",user," ",pass)) goto start;
  if(asknwait(1,"SELECT INBOX")) goto start;
  int j=0;
    if (c==matchseq[j]) {
    else {
    if (j==matchseqlength) break;

  Serial.print("Fin iteration ");

thank you all

Hi Slim,

I also have the ethernet shield v1.1. Unfortunately it uses a different ship than the more recent board so it cannot work with the standard ethernet library. You need to get a dedicated lilbrary that you can find there:

Good luck!

By the way, I have a problem with the same board: I need to obtain an IP via DHCP and there is no library for that with the v1.1 board. Does anyone has a script for it?