Problem with ethernet configuration

Hi.
I am running Arduino 0022 with arduino Ethernet shield on windows 7

And i am trying to run the program below and i am getting this error:
"as of Arduino 0019, the Ethernet Library depends on SP1 library"
as a newbie i am having a small problem getting this to run can someone help me with this problem or point me in the right direction.

Thanks Chilliman

// Arduino_live_gauge
// =======================================================================================
// This sketch takes puts the information on A5 out through the ethernet connection when
// there is a connection on port 23. There is a corresponding script that connects, then
// displays the information in a gauge via PHP and Open Flash Gauges
// (NameBright - Coming Soon).
//
// Written By: Dan Wagoner - www.nerdybynature.com
// Date: 07/26/2009

#include <Ethernet.h>
#include <stdio.h>
#include <string.h>

// define ethernet properties
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 10 };
byte gateway[] = {192,168,1,1 };
byte subnet[] = { 255, 255, 255, 0};
Server server = Server(23); // listen on port 23

void setup()
{
pinMode( 5, INPUT );
Serial.begin(9600);
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();
delay(1000);
}

void loop(){
Client client = server.available();
if (client){
client.print(analogRead(5));
Serial.println(analogRead(5));
delay(200);
client.stop();
Ethernet.begin(mac, ip, gateway, subnet);
}
}
:slight_smile:

it needs:

#include <SPI.h>

at the beginning

i got all of these errors :

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:7:24: error: sockutil.h: No such file or directory

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp: In member function 'void Dhcp::send_DHCP_MESSAGE(uint8)':

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:113: error: 'htonl' was not declared in this scope

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:119: error: 'htons' was not declared in this scope

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp: In member function 'char Dhcp::parseDHCPResponse()':

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:284: error: 'htonl' was not declared in this scope

help!!!!!!!!

chilliman

your error messages:

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:7:24: error: sockutil.h: No such file or directory

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp: In member function 'void Dhcp::send_DHCP_MESSAGE(uint8)':

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:113: error: 'htonl' was not declared in this scope

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:119: error: 'htons' was not declared in this scope

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp: In member function 'char Dhcp::parseDHCPResponse()':

C:\arduino\arduino-0018\libraries\Ethernet\Dhcp.cpp:284: error: 'htonl' was not declared in this scope

if you look at errors , you'll find that you are not using arduino 22
there is a problem with your configuration
i tried your code on my arduino 22 config and i was able to compile it.

Looks like your error messages are referring to version 0018 - a clean install might help you.

I will try that and let you know the result
thanks
:slight_smile:

it works great thanks