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:
there is a wireless router 1 with SSID “network” with the address 192.168.0.1
there is another wireless router 2 with the same SSID connected wirelessly to the router 1, with the address 192.168.0.10.
the MCU is connected by cable to the router 2 (through PoE switch)
DHCP server runs on the router 1
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?
hello.
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: 0.0.0.0
Your (client) IP address: 0.0.0.0
Next server IP address: 0.0.0.0
Relay agent IP address: 0.0.0.0
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?
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.
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.
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?
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.