etracer

Just because the lights flicker on the shield doesn't mean you have your configuration correct. This only shows that there's activity on the ethernet link. If you can ping the Ethernet Shield from your computer and get a response, then that indicates your settings are probably at least partially correct.

And the server portion of the code uses the client code when connections are established. So the improvements to the client do affect the server side as well.

etracer

Answer the questions I posted several replies ago and maybe someone can help. But if you just want to complain that it doesn't work and not participate then no one will be able to help.

As a refresher, here are the questions again:

What operating system are you using on your computer?

What is your computer's IP address?

What's your subnet or netmask?

What's your gateway address?

How are you connecting your Ethernet Shield to the network? Is it connected to a hub/switch, or is the cable connecting directly to your computer?

Which LED's light up solidly when you plug the network cable into the Ethernet Shield?

Do the TX and RX LED's show any activity?

Additionally:

What IP address are you assigning to the Ethernet Shield in your sketch?

What is the subnet address you're assigning in your sketch?

What is the gateway address you're assigning in your sketch?

If you ping the IP address assigned in the sketch from your computer, what do you get?

Please also include the example sketch you're trying to use (that will answer the first 3 additional questions). There's been so much code included in the various topics that it's unclear what code you're trying to run.

etracer

Well I set up my network the same as you listed and tested your sample telnet server code and it worked fine with both the original and improved Ethernet library. My test was even done on a MacBook Pro with OSX Leopard.

So either you have a defective ethernet shield (unlikely), or there's still some problem in your network.

Some more questions (including some you didn't answer last time around):

What LED's are lit solidly on the Ethernet shield when it's idle?

When you ping the address you assigned the Ethernet Shield from your MacBook, do you get a response? If so, copy the result in your reply.

jbastos

Similar with the problem of the client that hangs if more than 4 connections are open simultaneously, I have the same problem setting up a server that has several simultaneous requests.

The server sends RST packets to the extra connections, but forgets to close correctly the 4 connections leaving then half closed in the CLOSE_WAIT state. Therefore the server hangs forever with all sockets in use.

Mavromatis

Do you guys know how we can use the full 8k of RX buffer of the W5100 chip? Seems like we are set at 2048 for up to 4 socket connections. Can we go 4k on two sockets max instead? How can I make these changes?

Here are some more details in this post: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1282169385

lebelg

I am totally new to this but I have read tons of posts and can't seem to find a fix for my problem. Here's the story:

My team and me created an installation for a museum. A part of it consist of small stations where visitors can scan their ticket and push a button (A or B). This answer is send to a server via a php request.

To make this happen, we use an Arduino Duomilanove, an ethernet shield (rev 4, so without the sd card slot), a stripped barcode scanner and some buttons and stuf.

Here's our problem: Everything works fine for a while when we reset the board and the ethernet shield. But after a random amount of scans, out software gets stuck at "connecting" (check the code below). The problem is that it never revives after that. I posteds the code below, I am very sorry it's so much lines, but we put a lot of effort in making it easy to change the ip and server etc.

void usage() { Serial.println("Usage:"); Serial.println("q<number>@ Sets the questionId"); Serial.println("s<number>.<number>.<number>.<number>@ Set the ip address of the server the data should go to"); Serial.println("i<number>.<number>.<number>.<number>@ Set this unit's ip address"); Serial.println(); Serial.println("Commands can not be concatenated, one command at the time. Have fun!"); Serial.println();}

Thanks in advance for all your trouble!

Mavromatis

Awesome! Love what you are doing. Which version of the Arduino software are you using? Current is 21. I am still running 18 and have no issues. I've done a lot of work with the ethernet shield and libraries so I think I can help you out if I know what version you are using.

lebelg

Version is latest. 21. Really hope you can help! The code is written by an intern and when he stopped I dove into it. I made a lot of changes and already fixed some other issues, but now I am stuck. Especially beacuse it works fine for a random amount of time (somewhere between 5 minutes and an hour). I already did like 30 succesfull scans after a reset and than after 15 minutes it still worked like a charm. After an hour of no activity it suddenly got stuck at connecting...... It feels totally random...

Mavromatis

One more thing... I'll look at the code later, just wanted to make sure about a few things.

You have 4 sockets avail with the W5100 and stock code offers 2k buffer on each are you exhausting the buffer and the app is crashing? When it gets stuck on connecting it mean that either there is no available socket or you had a crash. You need to make sure you close/release the sockets otherwise it will "lock".