Shop OBEX P1 Docs P2 Docs Learn Events
DHCP working! (code now attached) - Page 2 — Parallax Forums

DHCP working! (code now attached)

2»

Comments

  • Roy ElthamRoy Eltham Posts: 2,998
    edited 2011-01-07 23:03
    I've update the top post. I removed the file attachment, and instead included a link to the file in the google repository. That will always have the latest version.
  • agsags Posts: 386
    edited 2011-01-21 17:32
    Hi Roy, nice work. Once I swapped out an uncooperative ethernet switch I was able to get your code running quickly and was configuring my WizNet through a DHCP server.

    I've read the DHCP RFC docs, and while they talk about the details, I didn't see how the protocol is expected to work for things like renegotiation of a lease, or other requests from a DHCP server. For instance, my router is acting as DHCP server on my LAN; I have it configured to provide a known IP address to my WizNet when it requests an address. if I change the configuration (in the router/DHCP server) of that fixed IP value, I can see the router says that the client (WizNet) is in a state that is neither connected or disconnected. Am I supposed to be responding to other queries from the DHCP server? Any idea where I can learn about this?

    One other thing: my router/DHCP server is configured with a lease time of 24 hours. When my WizNet is connected and has been assigned it's IP address, I've noted that after several hours (but far less than the 24 hour lease time) it moves into a "unconnected" state. I can still PING it from another machine and get responses, but the router doesn't seem to know it's alive. This seems to be the case when I've not had any packets transferring to/from the WizNet. Am I supposed to be sending some kind of "keepalive heartbeat"? I would expect that that WizNet would automatically do that. Perhaps I'm on the wrong track here.

    Anyway, if you (or others) can shed some light on this that would be great. Regardless, thanks for the code.

    Al
  • Chip CoxChip Cox Posts: 73
    edited 2011-03-07 09:16
    ags wrote: »
    Hi Roy, nice work. Once I swapped out an uncooperative ethernet switch I was able to get your code running quickly and was configuring my WizNet through a DHCP server.

    What was the issue with the uncooperative ethernet switch?? I'm having problems getting a DHCP address assigned ( keeps timing out ). I am running through a 5 port linksys hub and a managed cisco switch with my workstation and spinneret vlan'ed off into an isolated network with the router still available. My desktop hooked up on the hub with the spinneret gets a DHCP address fine so I know the DHCP server is accessible.
    Thanks
    Chip
  • agsags Posts: 386
    edited 2011-03-07 15:30
    I had an old Linysys 5-port workgroup switch (EZXS55W version 2.0) and it just would not work with the WIZnet module. I had other machines connected to the swtich and working fine. I tried straight and crossover cables, I finally purchased a different switch and everything worked well. I don't think this is what you are experiencing. The behavior I saw was that the WIZnet wouldn't even get a solid link light. It was totally "off the LAN", not just not working with the DHCP server on the LAN.
  • DynamoBenDynamoBen Posts: 366
    edited 2011-03-08 12:06
    Chip Cox wrote: »
    I am running through a 5 port linksys hub and a managed cisco switch with my workstation and spinneret vlan'ed off into an isolated network with the router still available. My desktop hooked up on the hub with the spinneret gets a DHCP address fine so I know the DHCP server is accessible.

    You aren't going to a trunking port or anything like that? Also what type of VLAN are you running?
  • Chip CoxChip Cox Posts: 73
    edited 2011-03-08 19:20
    It's a simple cisco vlan. ports set to general. put it in place to keep the kids from chewing up all the bandwidth playing xbox and watching netflix. I switched out the hub just for grins and it didn't help any. I've added several debug statements around in the code and it fails waiting for the offer packet. I added the code to set the hostname and get it before the call to doDHCP hoping that would help. I can see the broadcast packet with the udp monitor if I bind to port 67. I can see the MAC address and host name in there. I need to go through the rest of the packet to make sure it's ok, but with everyone using this I'm guessing that the basic code works so it's something stupid I am doing.

    Update : You know how as you type emails, you think of things to try and before you post a stupid question in the forum, you decide to try it. It helps if you set the MAC address correctly in your code. I typo'ed the last two digits. When I corrected them, everything started working!!!!!
    Thanks everyone.
Sign In or Register to comment.