WIZnet Developer Forum

W7500P, DHCP not working

I cannot get my W7500P to acquire IP address from DHCP server.
I am running DHCP example as is, and there is no DHCPOFFER received after sending DHCPDISCOVER message.
Also, there is a strange behaviour when running loopback.
I will describe my setup first:
The board is powered through 1-in 1-out PoE switch. The PoE switch is connected to LAN port of an access point.
In Loopback example (static IP), the MCU links OK. But it is not visible on the network (same subnet). I can connect to the MCU ONLY if connecting directly (through PoE switch) my laptop and the MCU board and the loopback example works fine.

As I said, DHCP example does not work at all.

Does it have to do with a particular router? I have a bit complex wireless infrastructure in my office:

  1. there is a wireless router 1 with SSID “network” with the address
  2. there is another wireless router 2 with the same SSID connected wirelessly to the router 1, with the address
  3. the MCU is connected by cable to the router 2 (through PoE switch)
  4. DHCP server runs on the router 1
  5. The both routers are the same tenda model.

So, the connection of the MCU board is: PoE switch -> router 2 with no DHCP server -> router 1 with DHCP server.
Please note that if I connect my laptop in the same way it works fine (acquires IP address). However, through wireshark I can see that the laptop first sends DHCPREQUEST instead of DHCPDISCOVER message.
Please help, I have no idea what the problem is.

I tried several different routers and the behaviour is the same, DHCP server does not respond to DHCP_DISCOVER from W7500p. I caught DHCP_DISCOVER message from the MCU by Wireshark, so the MCU sends the message.
Please advise

Can you connect to the router 1 ?
If you can that, please check the difference and debug message of W7500P.
The SSID is not relevant with W7500P because W7500P is using Ethernet and SSID used to WiFi.
Is it right laptop is assigned ip via ethernet?

I cannot connect to any router via DHCP, I have tried three so far (one Tenda, one TP-LINK, and a direct cable connection to my company ethernet infrastructure). Also, I cannot connect statically, that is W7500P is not visible on the subnet. If I connect a laptop on the same cable instead of W7500P it gets IP address (through DHCP) fine and is visible on the subnet.
If I directly connect W7500P and a laptop only then I can communicate with the W7500P (the both are assigned IP address manually).
Here is the Wireshark capture of DHCP_DISCOVER message from W7500P:

Dynamic Host Configuration Protocol (Discover)
Message type: Boot Request (1)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x1234567e
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
1… … … … = Broadcast flag: Broadcast
.000 0000 0000 0000 = Reserved flags: 0x0000
Client IP address:
Your (client) IP address:
Next server IP address:
Relay agent IP address:
Client MAC address: Wiznet_01:02:03 (00:08:dc:01:02:03)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Discover)
Option: (61) Client identifier
Option: (12) Host Name
Option: (55) Parameter Request List
Option: (255) End
Padding: 000000000000000000000000000000000000000000000000…

I hope this helps you to better understand my issue.
Thank you for you interest

First, If you have several DHCP server, I think you should add the delay of 200ms between call of like DHCP_run() in main loop.
Could you please add the delay and try again?

Your Wire shark capture has not problem.

It is normal work that W7500 first sends DISCOVER message.

I have added the delay in the main loop between calls to DHCP_run(), but no change.

Can you confirm/check that the DHCP example works as is on the GitHub? Or anyone else who tried it?

I downloaded DHCP server application onto my laptop (http://tftpd32.jounin.net), and now this server assigns IP address to W7500P correctly if I connect laptop and W7500P through cable.

But still I could not obtain IP from any of four routers I tried (TP-Link and Tenda), and W7500P is not visible on subnet even in Loopback example (with manual IP).

The good experiment would be if somebody tries the DHCP example with a router and confirm it works as is. Sounds lame, but maybe DHCP servers on routers need more information in Discover message?

Do you use a board made by yourself using the W7500P? or use WIZ750SR?
If you use like WIZ750Sr module, you can use the DHCP code on the Github.
WIZ750SR Github : https://github.com/Wiznet/WIZ750SR
When I use the WIZ750SR, I could check the DHCP packet like below figure.

I use a board made by myself after WIZwiki-W7500P.

Could you expand Wireshark so I could see the content of Discover packet?

Dear all!

The DHCP client example maybe not worked with any DHCP server. Because some DHCP servers require a special option value for security or authenticaton.

To solve your problem, please compare two DISCOVERY message between W7500P and Your PC to find what is different option.

Anyway, If your W7500 can’t send a Discovery message, it is another problem, not DHCP.

Thank you.

Thank you.

You can see the DHCP discover packet as below figure.

Have you ever succeeded in connecting DHCP when you use the WIZwiki-W7500P?
There is a DHCP-related example that we provide and first, I think you test the DHCP protocol using WIZwiki-W7500P.

Dear Irina,
Can you expand Parameter request list in wireshark, so I can check against my design?
Yes, I have tried the example with WizWiki-7500P board.
Thank you

The first thing I’d like to do is check your schematic.
Because the example of DHCP is hardcoding and if you didn’t change the source code, it would be no problem.
Also, As @mc said, it would be good to compare the discover packets when PC get an address assigned using DHCP.

Schematic Prints1.pdf (79.2 KB) Schematic Prints2.pdf (57.1 KB) Schematic Prints3.pdf (66.0 KB)

Here are the schematics of my project.

And here are screenshots from a PC discovery packet



Please note that if I connect directly PC and W7500P, and run a DHCP server application on the PC, W7500P gets an IP address from the DHCP server

The first thing you do is check the packet of between PC and Router as shown in figure.

Could you please let me tell the DHCP tool on the PC?
I want to test as same environment.

The above screenshots are of the discover packet sent from PC to router, after which the PC gets IP address from the router.

Do you want to see some other packet?

As for DHCP tool for PC, I try three different tools, all work the same, for example

I will request to hardware engineer(@Scott) your schematic.
If you can access admin account in router, you can see to manager the assigned IP in DHCP Server.Could you check if W7500P is assigned IP.
Isn’t it a problem with the router?

Dear @rajovic

I think your schematic is wrong.

You do not use the MCU clock and PHY clock on W7500P.

So W7500P can’t work.

You can check the reference schematic for W7500P at the URL below.

Thank you.

Dear @Scott

Sorry, I forgot to mention that the board has been reworked so we added PHY clock. AS for MCU clock, we use internal RC oscillator as a clock source.
Anyway, many examples work (loopback for example), but not DHCP.

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