Use ethernet shield in both server and client mode

Hello,
I'm planning on getting an Arduino and using it as a (simple) webserver.
But I would like to know a few things before I get the hardware and I'm hoping to find the answers here.
Is it possible to:

  • stack an arduino, an ethernet shield (w5100) and an lcd display shield together?
  • Use the ethernet library in both server- and client-mode?

I want to use the configuration to have the arduino update a webserver with some (analog and binary) data from the pins of the arduino with post commands.
But all examples I could find all used programmed IP addresses (and MAC addresses). I want it to be able to act as a webserver with which I'm able to 'configure' the static IP address and perhaps some other configuration stuff. But I cannot find anywhere the option to set the server up (for configuration) and also upload the data to the webserver (on the internet). I also couldn't find the possibillity to 'dynamically' configure and IP address instead of have it programmed directly in code.

any ideas anyone?

Is it possible to:

  • stack an arduino, an ethernet shield (w5100) and an lcd display shield together?

Depends on the type of header pins on the LCD shield. The ethernet jack is quite tall, so any shield that needs to go above it will need long header pins.

Putting the ethernet shield on top would solve the problem of the tall ethernet jack interfering with a shield above it, but that would make it hard to read the LCD.

  • Use the ethernet library in both server- and client-mode?

Yes. You are limited in the number of connections that can be supported, so acting as a client and a server may result in denied connections occasionally.

Not really sure why you want to do this. If the Arduino is to be serving up information, what will it being doing as a client?

Not really sure why you want to do this. If the Arduino is to be serving up information, what will it being doing as a client?

Possibly sending a notification if the data being monitored/served exceeds a set value or if a desired event is detected.

thanks for the replies.
I want the Arduino to act as a tcp client because it has to upload data to an external webserver.
And it should be a server so it's possible to configure the Arduino via the network.
Perhaps this is a bit of a complicated setup, but I definitely don't want to hard code the IP address.
So I thought it should be possible to use the server part to let me configure it remotely via a browser.

I didn't find anything about that either on the internet.
Can you guys tell me if it's possible to make the IP address configurable?
If not via the webserver, perhaps via the lcd (with buttons) shield?
All code I found on the internet about using the ethernet shield involved a hardcoded IP address.
Shouldn't it be possible to make this configurable?

Perhaps this is a bit of a complicated setup, but I definitely don't want to hard code the IP address.
So I thought it should be possible to use the server part to let me configure it remotely via a browser.

How is the web browser going to talk to the Arduino if it doesn't know the Arduino's IP address? Every device connected to a network has a fixed IP address, at least for the duration of the connection. The device may be assigned a dynamic address when it connects, but that requires running DHCP somewhere, to generate the dynamic IP address.

No, the Arduino should have a dedicated IP address, but I want it to be configurable (preferable via the webserver)

The point is that all examples I looked at all had a dedicated (as in hardcoded) IP addresses.
I want to be able to change the IP address if the arduino is to be used in another network without having to reprogram it completely.
This is like most other network apliances like printservers, routers, etc. They all have a simple webserver that can be used to set the configuration.
I understood that the arduino has some eeprom space that can be used. It should be possible then to use this to store the IP address in to use.
That way it should be possible to store a new IP address in there via the webserver on the Arduino via a simple form (with 4 fields for the ip addres and perhaps 4 fields for the netmask, 4 fields for the router and 4 fields for the server to connect to for the sensor data to upload...'
But I´m beginning to think this is too much for the Arduino to handle... Or not?

The point is that all examples I looked at all had a dedicated (as in hardcoded) IP addresses.

That's because the default Ethernet library does not provide a way to set the IP address except in the constructor. There has been at least one thread that described the changes that needed to be made to the library to add a method to change the IP address.