W5500 tcp connection problem
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W5500 tcp connection problem
by Zack1 ·
RE: RE: W5500 tcp connection problem
by becky ·
read - VERSIONR
read - PHYCFGR
write - MR (0x80)
read - MR
write - GAR(192 168 0 1)
read - GAR
write - SUBR ( 255 255 255 0)
write - SHAR (0x00 0x08 0xdc 0x01 0x02 0x03)
write - SIPR (192 168 1 2)
write - Sn_MR (0x21)
write - Sn_Port(0x13 0x88)
write - Sn_CR(0x01)
read - Sn_SR
read - Sn_CR
read - PHYCFGR
write - Sn_DIPR(192 168 1 1)
write - Sn_DPORT(0x13 0x88)
write - Sn_CR(0x02)
read - Sn_CR
read - Sn_SR
read - Sn_IR
I have summarized your code as above.
But this took too long. It would be nice to show it in pseudocode for easy viewing.
You do not need to fill in Socket Destination IP and Socket Destination Port when using W5500 as a server.
This is a register for connecting to the server when in client mode.
Please refer to image.
However, writing a Destination does not cause problems when running in server mode.
I think your problem is that the gateway address is 192.168.0.1 and the source IP address is 192.168.1.2.
This is not the right network bandwidth. Match the network bandwidth of the two addresses.
The same applies to the network bandwidth of the client, and the gateway address and the client address must not be the same.
RE: W5500 tcp connection problem
by Zack1 ·
somebody do help as soon as possible
RE: W5500 tcp connection problem
by Zack1 ·
@becky
Hello.
I see you have edited the code in the notification.
What change did you make?
RE: RE: W5500 tcp connection problem
by becky ·
I applied this to your code.
It makes the code readable.
RE: W5500 tcp connection problem
by Zack1 ·
@becky
Thanks for the help sir. And sorry for the inconvenience caused ,
i was able to solve the issue for now, i was able to establish the connection.(Mistake was with an array name)
But through herculese only. My code gets stuck at the Listen state, and only after using herculese the conection gets established.
I dont know why its doesnot work with the code.
Another doubt is regarding the Sn_TXBUF_SIZE , Sn_TX_FSR, Sn_TX_RD ,do these registers belongs to the Socket 0 Register or the Socket 0 TX Buffer.
Doubt arised as i was tring to send some 8 byte data am getting so many junk values along with the data
RE: W5500 tcp connection problem
by Zack1 ·
@becky
Sir ,
It would be a great help if you could help me clear these things for me.
For sending data , i believe the steps are like this right,
RE: W5500 tcp connection problem
by Zack1 ·
@becky
By doing so am able transmit data but am getting so many junk values along with data. and Large number of packets are being send.
RE: W5500 tcp connection problem
by Zack1 ·
this is the data captured. as you can see i have send " AA AA AA AA AA AA AA" as data for a single time. But am getting data of length 1460 3 times and 1 packet of 629.
4 images are of 4 packets.
I wrote the value for TX_WR as 0x07 as am sending 7 bytes.
and data writing offset address which i got from TX_RD reg
RE: W5500 tcp connection problem
by becky ·
TCP Server waits for Client connection in listen state. After that, when the Client connects, it changes to Establish state. This is normal operation.
2 → Read the offset address from TX_RD → Sn_TX_WR.
4 → You should calculate Write Offset Address and write data to this address(=addrsel).
5 → Write the value increased by the amount of data to be transmitted of the existing Sn_TX_WR value. If Sn_TW WR value is 0x0070, you should write the 0x0078 to send 8byte data.
RE: W5500 tcp connection problem
by Zack1 ·
Sorry I didn’t get that well.
Can you explain it a bit more,?
For you information am not using the IO library.
Did u mean to Read the Offset address from the TX_RD and write the address as the starting address to the TX_BUFFER register?
And I am getting same values from TX_RD and TX_WR, is this normal?
RE: W5500 tcp connection problem
by Zack1 ·
W5500 data sheet is so incomplete that i have to depend on the forum for simple doubts and that too takes days to get replay