DHCP with ioLibrary not connecting
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: DHCP with ioLibrary not connecting
by Eugeny ·
What is going on the network? Do you see broadcast DHCP packets?
RE: RE: DHCP with ioLibrary not connecting
by seands ·
I just installed Wireshark and took a look - nothing is going out on the network at all in terms of DHCP packets. In contrast, the Arduino DHCP example sends out the DHCP discover, gets an offer in response, then sends a request and receives an ACK.
Is there some function I need to call before starting DHCP routines in ioLibrary? Or do I have to use a particular socket number?
RE: DHCP with ioLibrary not connecting
by Eugeny ·
First, you must capture packets within local network segment, where broadcasts are being routed. Most probably you will not see such packets behind the router.
Second, if you see nothing in this local segment - and Wireshark must report any packet, even malformed, then there’s a problem with programming the network chip - you really forgot to perform something to send data:
RE: DHCP with ioLibrary not connecting
by seands ·
Well, when I run the Arduino code on the same board, I can see DHCP packets from my computer running Wireshark. I think if the Arduino packets are visible, then the ioLibrary ones should be too, no?
Do you know if there are any other required commands to get DHCP to work when using ioLibrary that are not in the above code? Putting data into TX buffers etc. should be abstracted by this library.
RE: DHCP with ioLibrary not connecting
by Eugeny ·
Yes, you are correct.
Seems it is. The only I can tell you from looking into source you provided is that function
DHCP_init(0, dhcp_buf);should be expected to do the job, but for some reason it does not. Look into the library you use, or look here into hjjeon0608’s post.Don’t you forget to
setSHAR(gWIZNETINFO.mac);?RE: DHCP with ioLibrary not connecting
by seands ·
Argh, I found the problem - it was unrelated to the DHCP code - my
usb_send_messagefunction used a global variable as a buffer, defined in the code immediately above the DHCP buffer, and once I moved the USB buffer definition into the function itself as a local variable, the issues went away.This is before, when I had the problem:
and afterwards, with the problem fixed:
My hypothesis is that whenever I sent a USB message (which was before and during DHCP negotiation code), it affected the DHCP buffer where the UDP packets are assembled. I have to admit though, I don’t understand why the old code caused an overflow. My C knowledge is not great.
@Eugeny, thanks as always for your enthusiastic help!