-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wiznet Ethernet Hat - Will not set up DHCP #53
Comments
DHCP works in other environments on the WizNet Ethernet Hat, so I suspect there is some difference in the network, could even be something in-spec that isn't handled in the library. Can you post more of the debug trace, and link to the example code? |
You can also initialize with debug on and get more detailed tracing of the code: |
I seem to be able to reproduce, adding the debug output. code.py output:
Code done running. |
When swapping it over to a HUB to start doing some packet captures, it seems it works on a hub but not a switch. The switch is 100/1000 auto MDIX (its an older 8 port ubiquiti with POE). So something odd seems to be happening, If I hardcode IP address some communication seems to work, ping etc seems to work. |
So this maybe related to spanning tree. disabling it on my switch seems to resolve the issue. Which means something maybe causing unwanted packet collisions and spanning tree was cutting the unit out due to the collisions. |
Similar observation here. I ordinarily have a dumb switch closest to the W5100S, which seems to mask the issue. My main switch (next hop) has "loop prevention" enabled. But If I take the dumb switch out of the equation, I get the same DHCP failure. |
From a little light reading, Spanning Tree Protocol (STP) is used when there are redundant links (intentional or accidental) between switches, to avoid broadcast loops. But even with STP enabled, there should always be one active path, so it's not clear why the DHCP broadcast doesn't pass through. |
I am using a newer Ubiquity 8-port switch and it is in the stock configuration.
I do not get the output shown above by infamy. Instead I just get |
@cascmptrski @infamy Would you mind re-testing? There have been substantial changes to this library, including DHCP handling. |
Sorry for the delay, I can confirm with the updates done this is resolved. Chip Version: w5100s At least on the W5100s. The Pico EVB board definitions in circuit python leave a lot to be desired (MISO, MOSI, SCK, CS) are not set in the baordfile even though they are hard connected to the W5100s, but that is an issue for else where. |
Thanks for checking. I'll close this for now. @cascmptrski if you are still having the issue with the latest release we can re-open. Feel free to open an issue or PR in |
Testing the Wiznet w5500-evb-pico
|
I now believe it's just far from reliable. I seem to get a message sometimes immediately upon the link going up, and other times not at all. Longer sleeps seem to help but effectively it's just eventually retrying or bringing the link down and up again. Not much useful to say except once it works it's reliable at getting an IP across reloads as long as power is not dropped, so I'm curious whether the STP talk above meant that the users were never able to get DHCP to work, or mostly not. If I unplug it, then upon replugging it takes sometimes takes until the third reload (two timeouts) before I get an IP, then I get a reliable one every reload. Just to add that watching the lights, it seems there are no packets when it times out most of the time (no orange activity light), but sometimes there are flashes of the activity light and the debug text doesn't acknowledge anything and isn't sending at the time. It would be nice if it logged all data received in debug mode even if dropped multicast packets or whatever. |
Trying EVB 5500 with CP 8.2.0 and adafruit-circuitpython-wiznet5k-py-3.0.0, DHCP seems fine (sometimes get DNS errors though). Haven't been able to reproduce so far. Running this code: https://gist.github.com/anecdata/fbc57e96c8328127b791ebaf4a1a8e8c output...
P.S. network: EVB is wired to a Netgear (PoE managed) switch, then to a larger Netgear (managed) switch, then to a Peplink router that runs the DHCP. |
Since the library has changed substantially since this issue was initially filed, and changes seemed to have corrected at least some causes, I'd suggest opening a new issue. Discussions on closed issues can get lost more easily. |
P.P.S. W5100S, W5500, and W6100 EVB-Picos all got the same result. |
It's curious, I'll take it to a new issue.
The main thing I'm noticing is doing a long reset pause, then passing the
reset pin to init (which does a short pause) reliably restarts the link as
it's about to listen to it (i.e. init). Without the second reset / brief
drop it's unreliable at DHCP. I was also getting hung up on trying to
change the hostname with set_dhcp and crashing there too needlessly
complicating matters (I was toggling dhcp on and off in init while set_dhcp
calling).
…On Thu, 20 Jul 2023 at 23:08, anecdata ***@***.***> wrote:
P.P.S. W5100S, W5500, and W6100 EVB-Pico all got the same result.
—
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTBZ43Z6DCHV6UWNYSX4OLXRGT6FANCNFSM5PSKUHBQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
On second thought, after more testing, let's re-open this issue for now: the behavior seems to be network-dependent as in some of the early comments. In my case, though I can't readily explain it. the following scenarios work:
the following scenario doesn't work
This could be related, or a different issue, I'm really not sure. I've verified that there are no wiring loops in my network. edit: I have tons of other devices with working DHCP connected like the non-working scenario above: "device --> managed switch 2 --> router". So this seems CP-specific. |
The only way I've ever had a look at such things, was to wireshark my laptop while sharing the internet over its ethernet port, but that affects things. I can swing the linux hammer at things to probe etc, but I'm no managed switch expert, especially not one who has network tracing hardware, my budget ends at hobbyist equipment. If there are useful things to do detection-wise let me know (best I could think of was checking routes from the same device on each LAN/router and then get some network promiscuity going). I'll come back to this at some point. |
Using the WizNet Ethernet Hat for the Pi Pico, I am trying the example software with CircuitPython. The ping test works fine as does the fixed IP, however setting up to use DHCP, It times out never getting an address.
Turning on debug for the shows that it is sending, but fails the assertion at line 202 in adafruit_wiznet5k.py
"Failed to configure DHCP Server"
The debug message prior to the failure is:
* socket_available called on socket 0, protocol 2
First a question, the failure message seems to imply that the system is trying to set up a DHCP server, yet the documentation would seem to imply that the board is acting as a DHCP client. Is this just a confusing error message or should this be trying to function as a DHCP server.
I tried extending the timeout in the wiznet5k library, but that made no difference.
The basic code is as per the example:
The only change I made to this was to set debug to True with the result shown above.
Suggestions would be appreciated as to either where to look for the problem or possible workarounds.
Thanks,
-CAS
The text was updated successfully, but these errors were encountered: