-
Notifications
You must be signed in to change notification settings - Fork 18
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
DHCP Support #14
Comments
One needs to send and receive two UDP packages, track the intermediate state and detect the when it needs renewal: https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol Might be related for duration tracking: rust-embedded/embedded-hal#59 That... might help us https://github.com/Wiznet/W5500_EVB |
Good, this initial direction will help greatly, thank you. |
One other approach is to actually just use the W5500 in MACRAW mode and put smoltcp on top of it. In this way, you get all the goodness of smoltcp (i.e. DHCP, DNS, mDNS, etc.) without having to duplicate the implementation in this crate. Check out https://github.com/quartiq/booster/blob/main/src/hardware/external_mac.rs for a reference implementation on how to do this. It's on my TODO list to pull the external-mac operation into it's own crate as well to enable this. |
Has anyone got W5500 working with DHCP? I've got TCP working when specifying an ipaddress, but I have no idea how to get DHCP added when initializing the device. |
As I mentioned above, you can get DHCP working by using Smoltcp just fine, and I do this in the In it's current state, this crate does not support DHCP without using smoltcp. |
I tried with smoltcp-nal, not smoltcp itself. Sorry I'm a bit new to rust so its a bit daunting to init the devices. I was hoping a minimal example to get DHCP. At this stage I'm stuck having to hardcode the ip :( Heres my attempt: So the main branch is working, the smoltcp branch is failing. this is the diff: |
@rvdende Sorry, I don't have a ton of time on my hands, so it's hard for me to review your code and tell you exactly what's wrong. If you want to review a working example used in production, check out Booster's initialization routines, which use the smoltcp-nal, smoltcp. and the W5500: |
this is my minimal example that I take from the "booster" repo. I hope it can help you |
Thank you @cnmozzie !! I'm going to try this as soon as possible. |
@cnmozzie thanks again for the example code, I got it working on my stm32F407 :) |
Need to add DHCP support so that an IP address can be dynamically acquired.
The text was updated successfully, but these errors were encountered: