Go Down

Topic: Webclient W5100 shield works only on port 80? [SOLVED] (Read 839 times) previous topic - next topic

jhhbe

May 01, 2012, 09:25 pm Last Edit: May 04, 2012, 12:34 pm by jhhbe Reason: 1
hi,

I connected the shield to a different ethernet port and it worked - I have an old router providing some extra ports and it probably does a bit more than a simple switch. The laptop were everything worked was on wireless.

A lot of time wasted on this one - it was mostly mine so that's ok - anyway thanks for reading/helping!

Jhh

- - - - -

hi,

I've tried the Webclient example with the ethernet library and it retrieves the google homepage (though the ip address in the sketch is outdated). When I try a server on the local network on port 80 that works as well but when I try to access a server on my local network on port 81 it does not work.

When I try this one:

Code: [Select]

#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
byte server[] = { 64, 233, 187, 99 }; // Google

Client client(server, 80);



it is complaining that I need to use: EthernetClient client; so not too many versions I can try.

Am I a missing a new/updated library? Code snippets for http clients working on other ports than 80 are most welcome...

Thanks!

Jhh

johnwasser

Are you using Arduino 1.0?  Are you using Files->Examples->Ethernet->WebClient?

When you changed the IP address to the server on your local network did you also change the line:
Code: [Select]
  if (client.connect(server, 80)) {
to
Code: [Select]
  if (client.connect(server, 81)) {
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

jhhbe


Are you using Arduino 1.0?  Are you using Files->Examples->Ethernet->WebClient?


Yes, that is the one I'm using - sorry if that was not clear.


When you changed the IP address to the server on your local network did you also change the line:
Code: [Select]
  if (client.connect(server, 80)) {
to
Code: [Select]
  if (client.connect(server, 81)) {


That is what I did - first I tried the google example (outside ip, port 80) - then a server on port 80 on the host on the internal network and then on the same host on port 81 (internal ip, port 80 and then internal ip port 81). The first two combinations worked but the last one does not.

There is some serial logging - and it says connected after the "if (client.connect(server, 81))" line but when I look in the log of the webserver (the one on port 81) I don't see anything at all?

Thanks!
jhh

johnwasser

Does it work from a web browser when you use "http://address:81/"?
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

jhhbe


Does it work from a web browser when you use "http://address:81/"?

Yes, I'm using that one every day and it still works fine. I now downloaded (the outdated) version 23 of the Arduino ide and I get the same result: port 80 requests work, port 81 does not work. Then I tried a web service on port 8080 of the sam busy machine and also that one failed - that one requires a password so not too surprised it would fail but I did not get any response at all (not even asking for a password).

jhh


johnwasser

Makes no sense to me.

Have you tried changing "GET /search?q=arduino HTTP/1.0"?
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

jhhbe


Have you tried changing "GET /search?q=arduino HTTP/1.0"?


I've changed 3 things in the sketch - ip of the server, port of the server and the get statement - the shield gets an ip from dhcp. I've tried "GET / HTTP/1.0" but also "GET /elog HTTP/1.0" and "GET /rover.asp HTTP/1.0" which all point to existing locations on the server. When I was using port 80 and forgot to change the GET sentence I got a 404 page. When I ask for a non-existing page in IE on the port 81 server I see a line in the log file for an invalid request but I don't get to that point with the Arduino - there is nothing in the log.

This is a W5100 shield which does not have a mac sticker on it - I have another arduino/ethernet shield combo with a mac sticker (so I assume they are different batches) which acts as an IR transmitter listening to http requests for sending out an infrared signal. I'll try that hardware tonight to see if it does anything different (getting a bit desperate now).

Thanks for helping out!
Jhh

jhhbe

update: tried on another W5100 shield and obtained identical results.

Jhh

Go Up