Go Down

Topic: WebClient - connecting... connected disconnecting. (Read 88 times) previous topic - next topic

ke_mechial

I just got an ethernet shield and wanted to try webclient example from library.

(WebServer works smoothly by the way)

When I opened Serial Monitor output was like this.
connecting...

connected

 disconnecting.

It has no problem connecting to google.com but somehow can't retrieve data.

SurferTim

Are you using a domain name as the server? If so, you need to evaluate the client.connect() return value differently. The only success return value is 1. The connect function will also return true if the domain name resolution fails (negative return value).
Code: [Select]
// replace this...
 if (client.connect(server, 80)) {

// ...with this
 if (client.connect(server, 80) == 1) {

keegho

I have the same issue here. client.connect is returning -1 "Time_out". I really don't know what is wrong.
DHCP is working and WebServer example is working. But WebClient code is not.

Anybody can help please....

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy