Ethernet Shield: web client connection failing

I got my ethernet shield the other day and I was able to get a web server up and running in minutes. When I went to try it out as a web client though, I just keep getting "connection failed." I'm simply running the webClient example script.

My IP for the shield seems to be right as the web server script did what it was suppose to, and I could connect via telnet and a browser.

Has anyone else had this issue? I'm not sure what else to play with other than the subnet and gateway, which didn't seem to help either.

Any suggestions would be super. Thanks in advance....

How do you have it connected? If the Arduino can't get to the net, the web client will not work.

It's hooked into my router. I actually got it working for a few minutes today, but I'm starting to wonder if it's a hardware issue. It started working when I switched the ethernet cable to a different one, and it worked for a few minutes, then stopped again. I then swapped it back to the original cable and it started working again, then stopped. Then didn't work again no matter what I did.

It's just acting a bit nutty now. Seems a little weird, no?

Well, at least you have seen it working.

I haven´t seen yet the ethernet shield working. I´ve tried with different routers, switches and connecting directly to my laptop with a cross-over cable but nothing.

I only can do "ping" to the shield and it answers.

When I try with some of the examples, for instance, telnet examplo, I can see the TX led blink four times and says "Cannot connect with IPADRESS in port 23..." .

I don´t know what to try.

did you manage to get the webClient example working in the end? I'm having similar trouble....

This is going to sound a bit ridiculous, but it fixed all my issues:

Simply add “Serial.println(client.connect());” before your if statement that checks if it’s connected.

Like this:

Serial.println(client.connect()); //add this line <-------------
if (client.connect()) {
client.println(“GET /search?q=arduino HTTP/1.0”);
} else {
Serial.println(“connection failed”);

I’m interested to know if it works for you too.

no that didn't work:(

What exactly isn't working for you? What are you trying to run?

I’ve a new open thread regarding the issue here: