IDE problem??

hi,
I write because i can’t see my arduino on lan…
the problem born while i change the ide version passing by arduino 022 to arduino 1.0…
here can you see my sketch

byte mac = { 0x–, 0x–, 0x–, 0x–, 0x–, 0x-- };
byte ip = { 192, 168, 1, 128 };
byte gateway = { 192, 168, 1, 1 };
byte subnet = {255, 255, 255, 0};

Server server(80);
void setup(){
Ethernet.begin(mac, ip, subnet, gateway);

void loop(){
Client client = server.available();
if (client) {
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
readString.concat(c);
if (c == ‘\n’ && currentLineIsBlank){
valore = analogRead(A0);
Serial.println(valore);
// INIZIO DICHIARAZIONE PAGINA HTML
client.println(“HTTP/1.1 200 OK”);
client.println(“Content-Type: text/html”);
client.println();
client.println("");
client.println("");

and more…
now with the 1.0 version i’ve upload the base sketch named webserver, but i don’t see it on lan…
can someone help me?
thanks

The Ethernet.begin() function has changed in V1.0. The gateway and subnet are reversed, and a dns ip is required.

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

Edit: The web server example in V1.0 had some bugs. Mine would not work "out of the box". http://arduino.cc/forum/index.php/topic,86729.0.html

If you are using Windows, the change in w5100.h will probably not be necessary. That appears to be a Linux problem. Just use the web server code.

thanks for your reply.
i try

#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <util.h>
#include <TinkerKit.h>
#include <SPI.h>

TKLed rosso(O1), verde(O2); //defines pin number for each colour
byte mac = { 0x–, 0x–, 0x–, 0x–, 0x–, 0x-- };
byte ip = { 192, 168, 1, 10 };
byte gateway = { 192, 168, 1, 1 };
byte subnet = {255, 255, 255, 0};
byte dns = { 192, 168, 1, 1 };//like gateway
EthernetServer server(80);

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

void loop(){
verde.off();
rosso.off();
EthernetClient client = server.available();
if (client) {
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (c == ‘\n’ && currentLineIsBlank){
// declare html page
client.println(“HTTP/1.1 200 OK”);
client.println(“Content-Type: text/html”);
client.println();
client.println("");
client.println("");
client.println("Sensore 01 : ");//


}
}
}
}
if(analogRead(I0)==0){
rosso.off();
verde.on();
}
else{
rosso.on();
verde.off();
}
delay(1000);
}
i’va an error:

sk17a:15: error: ‘byte dns ’ redeclared as different kind of symbol
C:…|arduino-1.0\libraries\Ethernet/Dhcp.h:57: error: previous declaration of ’ dns’

how must declare the dns???

i try change this part of code:

IPAddress ip(192,168,1, 10); IPAddress gateway(192,168,1, 1); IPAddress subnet(255, 255, 255, 0); IPAddress dns(192,168,1, 1); EthernetServer server(80);

void setup(){ Ethernet.begin(mac,ip,dns,gateway,subnet);

but the error is the same...

Sorry. My bad. Even that example has some bugs. :blush:
I see you changed the ips, but the web server code still has some bugs.
This example has the new data types for the ip addresses, and all the other bug fixes I can think of.

/*
A simple web server using an Arduino Wiznet Ethernet shield. 
For Arduino IDE V1.0 only. Previous IDE versions require mods to this code.

Original code created 18 Dec 2009
 by David A. Mellis
 modified 4 Sep 2010
 by Tom Igoe
 modified 18 Jan 2012
 by Tim Dicus 
*/

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip( 192,168,1,10 );
IPAddress gateway( 192,168,1,1 );
IPAddress subnet( 255,255,255,0 );
IPAddress dns( 192,168,1,1 );

// Initialize the Ethernet server library
// with the IP address and port you want to use 
// (port 80 is default for HTTP):
EthernetServer server(80);

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

  // set SPI SS pins on w5100 and SD
  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  // start the SD interface here if you want.
  // Add the SD.h library above
  // SD.begin(4);

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip, dns, gateway, subnet);
  // disable w5100 SPI so SD SPI can work with it
  digitalWrite(10,HIGH);
  delay(2000);
  server.begin();

  Serial.println("setup finished");
}

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("Client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      while(client.available()) {
        char c = client.read();
        // 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) {
          Serial.println("Sending response");
          // send a standard http response header
          client.println("HTTP/1.0 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<HTML><BODY>TEST OK!</BODY></HTML>");
          client.stop();
        }
        else 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;
        }
      }
    }
    Serial.println("Disconnected");
  }
}

My apology in advance for any typos in the conversion.

Edit: I added the V1.0 warning. This works with V1.0 only.
I also added the SD.begin() function commented out so you can see where to use it.