(W5500)TCP Client Connect not working with Arduino Library
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 Client Connect not working with Arduino Library
by Eugeny ·
I do not immediately see anything wrong with the code. 0x13 is the status after socket is open, and as connect returns with 0x13, I guess it can not/does not proceed to connect. The only educated guess I have is that you pass variable
portas 0. I am not sure, I had the case before that connect does not work if destination port is 0.RE: RE: (W5500)TCP Client Connect not working with Arduino Library
by telliottosceola ·
Thanks for the reply @Eugeny
I have the destination port set to 4000. I also added debug code to the connect function which reads back the destination IP and port from the W5500 class. It prints out the correct IP and port number. See revised connect function here where I check the destination IP and port:
int EthernetClient::connect(IPAddress ip, uint16_t port, network_interface_t) {
Serial.println(“in connect function”);
if (_sock != MAX_SOCK_NUM){
Serial.println(“_sock != MAX_SOCK_NUM”);
return 0;
}
Serial.println(“Here”);
It prints out correctly as 192.168.1.53 which is my computer’s local IP on the network and port 4000 which is the port I’m listening on. So it seems the IP and port of the server is set correctly but it’s just never succeeding. I also cannot get the TCP server to work on the W5500 either.
RE: (W5500)TCP Client Connect not working with Arduino Library
by Eugeny ·
Do you check for interrupt flags - do they change at least?
It seems
connectfunction needs to be troubleshot. It would help if you can point to its code.RE: (W5500)TCP Client Connect not working with Arduino Library
by telliottosceola ·
My full port of the Arduino Library thus far is available on this github repo:
Not sure where to check interrupt flags or which ones you are refering to. Can you elaborate? Thank you very much for your help/interest to this point.
RE: (W5500)TCP Client Connect not working with Arduino Library
by Eugeny ·
Everything seems to be ok. Please perform dump of the register values of the common register block and socket’s register block. You can use
uint8_t W5500Class::read(uint16_t _addr, uint8_t _cb)function for it. Common register addresses are 0x00 to 0x39, socket register addresses are 0x00 to 0x2f, CB parameter is set as:
RE: (W5500)TCP Client Connect not working with Arduino Library
by telliottosceola ·
Hi @Eugeny
Sorry for the ridiculously delayed response. I have been really tied up lately and just got back to this project.
Going through your requests here. _sock in EthernetClient::connect prints out to my serial log as 0. Is that valid?
RE: (W5500)TCP Client Connect not working with Arduino Library
by Eugeny ·
Why not? There’s such socket 0 and you can use it (properly
)
RE: (W5500)TCP Client Connect not working with Arduino Library
by telliottosceola ·
Can you elaborate on how you want me to read the register values you requested?
RE: (W5500)TCP Client Connect not working with Arduino Library
by Eugeny ·
I am afraid to be not so familiar with libraries you use; please look into “sockets” header files, or “w5500” header file, you should be able to locate W5500 register read call (I am sure there will be comment/verbose description saying so). Then read register one by one and dump to the log.
RE: (W5500)TCP Client Connect not working with Arduino Library
by telliottosceola ·
Not seeing a generic read function on the W5500 header or socket. I think what you are looking for is probably in the W5500 header(gut says so anyway). Here it is:
https://github.com/ControlEverythingCom/Wiznet-W5500-Particle/blob/master/src/utility/w5500.h
RE: (W5500)TCP Client Connect not working with Arduino Library
by telliottosceola ·
Nix that. Found the Read function you wanted. It’s a private function.
RE: RE: (W5500)TCP Client Connect not working with Arduino Library
by Eugeny ·
Yes, right these two are your friends
One reads single register, another a set in a row. Please refer to the datasheet to set CB properly.