ioLibrary recv only returns Zeros
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: ioLibrary recv only returns Zeros
by Eugeny ·
Data “Hello” is having 5 bytes it in?
%s outputs till null char. If first char appears to be null nothing is displayed. I propose you making a data dump in hex.
RE: ioLibrary recv only returns Zeros
by mdxg ·
Sorry the value of tmp for “Hello” is 7 and the hex value of the buffer after a read out
is [0,0,0,0,0,0,0]
RE: RE: ioLibrary recv only returns Zeros
by Eugeny ·
???
I think you can count letters - H E L L O is 5 letters, thus size returned must be 5, not 6 and not 7. Use wireshark to see what is actually going on the network. Send another phrase “Hello Friends” to see how many bytes recv will return.
RE: ioLibrary recv only returns Zeros
by mdxg ·
No thats okay. If you use putty as ascii to tcp terminal, putty adds two characters for newline at the end of the payload.
RE: RE: ioLibrary recv only returns Zeros
by Eugeny ·
Try declaring
uint8_t buffer[128];outside of themain()function (in thenetInfodeclaration location).RE: ioLibrary recv only returns Zeros
by mdxg ·
Okay I did declare the buffer outside of the main. Still only zeros in the return
RE: RE: ioLibrary recv only returns Zeros
by Eugeny ·
I think there’s some issue with pointers. Before performing recv(), initialize
bufferwith some values, for example 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 to see if it will have these values after recv() execution or recv will really reload the array with zeros.RE: ioLibrary recv only returns Zeros
by mdxg ·
Okay I did work on the buffer stuff and found the error. The printing of the buffer was the original error.
The connection now works but from time to time the receive method receives way more bits than I sent.
Thanks alot for the help:)