W5100 internet problem

me eather i dont know…
i chage pcb board microcontroller, i recheck the software… always works localy but never if the request goes to internet and i try lot of ips…

in this situation seems to connect but i dont det data, on recive buffer

Coccoliso

i foud a solution but i wand your opinion

as i tell in the begining i have 2 servers the one is localy and the other is over internet and not phisical conection to my current lan network!

both servers use 8083 port!

in every try i made never conect to internet server, but always to my lockal…
so i try to use difrent servers google… etc… but i forgot that my pcb dont suport DNS yes so some ip of google (e.g. 173.194.113.38) that i test on most cases redirects you to a webpage path… dont accept conection the ip, and the board dont conect…

i discover this when i use the server of my friend… and contects… then i undertand that my internet server miss to connect because have high ping some times… and delay… because is over 3G network and is remotly

but to be sure i must configure the w5100 to waits or retry when the server have low responce…
but i dont know whow is configured this… can you helpme on this so to be sure that this was my problem?

thanks

In reality it is not so … when attempting a connection to google with a fixed address the server forwards the request to anyone else but always returns also the caller’s information (port and IP) and the server will respond in the correct times.
The DNS just need to get an IP from a name and then use that.

As I said here http://wizwiki.net/forum/viewtopic.php?f=13&t=2119&start=10#p7001 I analyzed the traffic and as you will see in the case of 192.168.1.22 the communication port is set while in the case of 192.168.1.102 port is strangely 0 and the server will respond on that port that is not set.
In connection you have two ports, one of the socket and other the destination… It seems that you have lost the port setting that forwards the request (socket port) and it was for that reason that I wondered if now everything was working again with a local server connection.

PS: It 'a little off topic but the connection port of the socket must be increased automatically if you want to avoid the time-out in case of reconnection.

yes the the lockal server always conects, in any try i tested!!

finaly i have add on the w5100init()
SPI_Write(RTR, ((100 & 0xFF00) >> 8 ));
SPI_Write(RTR + 1,(100 & 0x00FF));

SPI_Write(RCR,0x19);
(you told me for this )
and
SPI_Write(S0_TTL,0xFF);

but the ttl =0xff do the job… i made 300 conect disconect to my friends server that have the server to VDSL and the network is good and i lost one connection only…

then i try to some internet servers, i lost 10 -15 conections on the 300

but… i cant connect to any google ip…

and i cant connect to my server that is over 3G router and the pings too high

i dont know why i cand connect to google ips, i try the 2 173.194.113.55 and 173.194.112.130

is any way to connect to my server that have bad network… with my pc when i request one test web page… delay 3-4sec but opens…

my question is… i cure the disease or i just treat the symptom, :stuck_out_tongue:

thanks

wow i found one google ip that conects… this ip is on an example to arduino ethernet client
arduino.cc/en/Reference/EthernetClient

the ip 64.233.187.99 conects 200 trys loss 2 trys,

if we found why the other google ips dont connect and this connects then we find the reason for all this trouble… im adding a file with 2 wireshark one the google ip that conects and one with the google ip not connect

google_2_ips_packet.rar (20.8 KB)

Sorry but I do not find in your source settings for the source port registers : S0_PORT0 / S0_PORT1 - 0x0404 / 0x0405

An improvement to the source is the elimination of the delay ( for CR_OPEN and CR_CONNECT ) and the verification of the register S0_CR directly

SPI_Write(S0_CR,CR_OPEN); 
delay_ms(100);  // else test for "S0_CR<>0"

Then once you have passed this test tou must verify that S0_SR been SOCK_INIT and if it is not you have to close the socket, change the source port to waste time in the timeout and try to re-open it.
With the socket opened set IP and destination port … then try to connect (please remove delay and test the register)

SPI_Write(S0_CR,CR_CONNECT);
delay_ms(300);   // else test for "S0_CR<>0" 

At this point put a loop checking S0_SR in SOCK_ESTABLISHED with within the verification of a possible timeout on S0_IR, if you leave out for this reason is to be redone starting from the open.

I say this because I have noticed that not always connect outside the LAN is to be less powerful … indeed once they fix addresses only the first connection attempt is slow and once traced the path the net becomes fast.
The connection may not be at first attempt then you have to rest directly to the state of the socket and also avoid making the output on the LCD … first check the connection then calmly displays the status.

Make sure that the MAC addresses in your W5100 devices are DIFFERENT!
Otherwise you won’t get them working in same or neighbour networks.