-
Notifications
You must be signed in to change notification settings - Fork 35
DHCP renew / rebind #35
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
Comments
Not that I know of.
Yes, much appreciated and desired 👍
Not sure, I'll be glad to test/comment/accept as requested. The DHCP client is ported from the Arduino Ethernet Library (https://github.com/arduino-libraries/Ethernet/blob/master/src/Dhcp.cpp).
I believe that is happening within the WiFi client implemented in nina-fw (https://github.com/adafruit/nina-fw/tree/master/arduino/libraries/WiFi/src).
Arduino uses ethernet.maintain() (https://www.arduino.cc/en/Reference/EthernetMaintain), I think your suggestion of |
I have been working on this and have code that mostly works, but has a really weird issue. I have it running together with the WSGI web server, and I keep getting an error like this:
What should happen is that the DHCP component opens a socket, sends out a request, and then receives a response on that socket. What instead seems to be happening is that another socket, one of the ones listening on port 80 for the web server, receives the response or at least is told it has data available, it starts to interpret this but doesn't get a "\r\n" and times out, taking down the server. Of course it's not great that the whole web server can be brought down by a malformed request, this shouldn't really happen either, but that's a problem for another day. What I don't get here is why the wrong socket, one that is listening on a different port, would be told it has data available. Has anyone else observed this? Any ideas? |
I may have fixed the above, which happened when using a valid socket.
It seems there's an issue in the socket allocation code: it allocated socket 2 for DHCP, but this socket was already allocated to the web server. 😬 |
I seem to have the wrinkles ironed out. See pull request #36. |
Closing via #36 |
Currently the DHCP client gets called once, and that's it. The device gets an IP, the lease expires, but the device happily keeps on using the IP, even if the DHCP server may assign the IP to another device in the mean time. Works for demos but not a good thing to have devices that do this on your network.
I was thinking of rewriting the DHCP client to maintain the lease properly, but this would likely require an
eth.maintain_dhcp_lease()
or similar call in the main loop to handle what needs to be done. So I would like to know:The text was updated successfully, but these errors were encountered: