WIZnet Developer Forum

reset when ip update from DHCP

Is it necessary to restart the W5500 when we obtain a different IP from the DHCP server when we do an IP renewal?

Is it not enough to update the registers with the new ip?

In an RTOS environment, it is difficult to reset the chip because that affects other threads

regards

You don’t have to reset the W5500 as you say.
Update the Network registers and If there is an open socket, close it and open it again.

ok,

I saw that the callback default_ip_update() in dhcp.c in the ioLibrary has a sw_reset. for that reason is my question.

regards

Hi, I have another question

If the socket is UDP, it is necessary close and open? It seems that DHCP socket is still working without restarting it.

Regards

If you are using DHCP function of wiznet library, please do DHCP_run () after DHCP_init ().

Yes, I use DHCP function of wiznet library.
Should I run DHCP_init() when the delivered ip from DHCP server has changed?

I can not see where the DHCP socket is closed. I only can see “close(DHCP_SOCKET);” in the DHCP_stop() function, and this is not executed.

regards

I guess you asked this question because I told you to close and open the socket when updating ip. The DHCP socket does not need to be closed and opened. I told you to close and open the socket because it can cause confusion if you are communicating with a specific target.
For example, if the W5500 was communicating with the server as a TCP client, there may be a problem when transferring data to the server after your IP is changed. But this is not essential.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.