problem w/ Arduino to Desktop using x-over cable

the setup is that my ubuntu desktop connected to the arduino ethernet shield directly via a crossover cable. there are problems with establishing communications as i can’t even ping the arduino platform. the application works if i connect the arduino device to a switch instead (with modifications to the IP address, eg, from 192.202.202.202 to 192.168.202.202) using a normal ethernet cable. when i do “arp -a”:

$ arp -a
? (192.202.202.203) at on eth0

$ ping 192.202.202.203
PING 192.202.202.203 (192.202.202.203) 56(84) bytes of data.
From 192.202.202.202 icmp_seq=1 Destination Host Unreachable

the problem doesn’t seem to be my desktop as i tried this with another desktop and the connection is ok. the code is simple enough:

#include <Ethernet.h>

byte mac[] = { 
  0xAA, 0xAA, 0xBB, 0xBB, 0xBB, 0xCC };
byte ip[] = { 
  192, 202, 202, 203 };
byte gateway[] = { 
  192, 202, 202, 202 };
byte subnet[] = { 
  255, 255, 255, 0 };

char rawMessage[100];


int i = 0;

Server server(5566);

void setup() {
  Ethernet.begin(mac, ip, gateway, subnet);
  Serial.begin(9600);
  server.begin();
}

void loop() {

  Client client = server.available();
  int i = 0;
  char tempByte;


  while(client == 0) {
    delay(1000);
    client = server.available();
  }


  while (1) {
    tempByte = client.read();
    if(tempByte != -1) {    
      rawMessage[i++] = tempByte;
    }
  }
  
  Serial.print(rawMessage);
  delay(1000);
}

i suspect i need to do something extra on the arduino platform for me to work. any ideas? thanks !^!

the problem doesn't seem to be my desktop as i tried this with another desktop and the connection is ok.

That suggests to me that the problem IS your desktop. If it works when connected to another machine, the problem is not in the Arduino, the ethernet shield, or the code on the Arduino.

I agree. This would lead me to think that the NIC on the desktop is not enabled or not configured correctly.

opps. what i meant is, i tried between desktop-to-desktop using the crossover cable and it worked. so at least i know that my cable is not spolit and the desktop is configured correctly (thats what i assume... )

did anyone try this before? a rough search on the forums and google seem to tell me that people think it definitely can be done (and should be easy) but i did not see an application that implements this (desktop-to-arduino connected directly using a crossover cable)..

I figured it out!!! Now I don't have to drag a router around with me anymore :) :) :)

Communication between an Ubuntu computer and an Arduino using an ethernet cross-over cable:

I found this on http://www.ehow.com/how_7193141_set-up-ubuntu-crossover-cable.html

Basically, you have to create a new wired connection with a fixed IP address where the first three digits are the same as the Arduino's, for example: Ubuntu: 192.168.2.24 Arduino: 192.168.2.100

Then connect using the network manager and enjoy the green TX/RX LED's flashing on the ethernet shield!

I would have thought that the below might be an issue, trying to reach a device thru a gateway device that may not exist using a direct cable connection.

byte ip[] = {
  192, 202, 202, 203 };
byte gateway[] = {
  192, 202, 202, 202 };

Sorry, forgot to mention that I commented those out:

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,0, 177 };
//byte gateway[] = { 192,168,0, 1 };
//byte subnet[] = { 255, 255, 255, 0 };

and

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