-
Notifications
You must be signed in to change notification settings - Fork 35
* Received DHCP Message is not OFFER #17
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
Hm, I didn't see them on my Wireshark capture. Could you provide more info?
This example (https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/blob/master/examples/wiznet5k_simpletest_manual_network.py) allows you to set a static IP, DNS server, gateway address and subnet mask.
Agreed, please open a separate issue for this feature if you'd like to see it implemented. |
The DHCP server is running W2008R2 German. It could be a problem of encoding. But this was not seen from many different clients. |
I get something similar.
Is it possible to add a debug print to show WHAT message is coming back? Oddly, in my case, this happens the first time a DHCP request is done, and the next try I do get an address. |
@xorbit Odd that it works the second time.
Yes - the |
The log above was with the Since the code you linked to was last updated on April 9, I'm pretty sure that's what I'm running. I'm handling the problem at the moment with the following code: dhcp_retries = 3
while dhcp_retries:
try:
eth = WIZNET5K(spi_bus, cs, debug=True)
break
except:
dhcp_retries = dhcp_retries - 1
if not dhcp_retries:
print("Failed to get IP address from DHCP") It's kind of a kludge I'd rather avoid, but it seems to solve my problem for now. |
@xorbit It should print out the subnet mask, gateway ip, etc (https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/blob/master/adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py#L332) along with the contents of the buffer received by the socket (https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/blob/master/adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py#L250). Could you drop the |
Ok, I think I got to the bottom of this. The print at line 250 never gets executed because the problem is a timeout. The code calls The timeout setting throughout the call chain seems to be a mess actually. The DHCP object has both a Higher up the chain, the Bottom line is that the DHCP expects a response in 1 second, and there is no way for the user to override this. |
@xorbit Ok, thanks for taking a deep dive into this.
Ok, this is confusing.. Let's keep the
If not, I'll assign myself and make a PR |
Created a PR. |
DHCP timeout and hostname fixed plus made settable in my pull request #20. |
hi @bytelinker it looks like @brentru and @xorbit have already handled this, and I probably wouldn't have been much help anyway since I don't really know a whole lot about this and I was out most of last week, but if you tag someone using an @ sign, it'll send them a notification that they've been mentioned. I get a lot of emails from github, and tend to just kind of skim through the ones I wasn't assigned or wasn't mentioned in. |
Hi dherrada,
with
adafruit-circuitpython-grandcentral_m4_express-en_US-5.3.0.uf2 and
adafruit-circuitpython-grandcentral_m4_express-en_US-5.4.0-beta.0.uf2
I run:
import board
import busio
from digitalio import DigitalInOut
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
import adafruit_wiznet5k.adafruit_wiznet5k_socket as socket
import adafruit_requests as requests
cs = DigitalInOut(board.D10)
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
Initialize ethernet interface with DHCP
eth = WIZNET5K(spi_bus, cs,is_dhcp=True,debug=True)
I get
and
But the adafruit_wiznet5k answers ping.
On DNS server (Windows Server 2008R2) I get:
11,05/22/20,14:07:52,renew,10.70.74.45,WIZnetÌ¡¥´¦¦.xxxx.local,DEADCDEFFEED,,2701393920,0,,,
There shouldn't be the non ascii symbols (tÌ¡¥´¦¦).
It would be great if the hostname could be set to custom values.
eth = WIZNET5K(spi_bus, cs,is_dhcp=True,debug=True,hostname='mydevice')
Where to find the documentation, to set the config for static IP, DNS, Route, Subnet mask, please?
Regards bytelinker
The text was updated successfully, but these errors were encountered: