Main Site Documentation

ENC28 - DHCP Issue


#1

Hi,
I’d like to show you the issue that I got when I try to retrieve IP Address via DHCP using the ENC28J60 module.

I’d like to point out that when I set Static IP I didn’t have issues.
But when I call the function “EnableDhcp()” in about 3-4 minutes my DHCP server dies because the ENC28J60 module continues to ask an IP Address, receive a valid IP Address from DHCP server and then releases it (without a valid reason). After that the ENC28J60 module restarts to ask another IP Address and so on… After few minutes the DHCP server has no more free IP Addresses and the LAN become locked.

Another thing… Why I say that the problem is in the ENC28J60 module?? Because I have this issue only using FEZ Cobra 2 Net and FEZ Cerberus and, both mainboards, uses the ENC28J60 module. When I use FEZ Spider (that uses J11D module) the DHCP works properly.

Is this a new issue or is a known issue?
Any ideas?


#2

@ BigFoot - What firmware version do you use?


#3

@ RobvanSchelven - Mainboard FEZ Cobra 2 Net.

Loader (TinyBooter) version information:
4.2.11.1 on this computer.
4.2.11.1 on this device.

The Loader (TinyBooter) is up to date. <<<

Firmware (TinyCLR) version information:
4.2.11.1 on this computer.
4.2.11.1 on this device.

The Firmware (TinyCLR) is up to date. <<<


#4

@ BigFoot - I haven’t seen this behaviour. Do you change your mac address in code? Maybe you can show some of your code


#5

@ RobvanSchelven - I set mac address with FEZ Config just after I bought the mainboard, never more.
This is a simple VS2012 gadgeteer project that shows the code I wrote: http://speedy.sh/cHJFs/GadgeteerAppEthFezCobra2Test.zip

The issue occurs also when I run this project.


#6

Can you also tell us what device is handing out DHCP addresses? Is this your home router, and if so what brand and model is it? Do you have netmon/wireshark that you could capture the dhcp requests and responses ?


#7

Could be other problem, but …
DHCP requires a MAC to assign an IP.
Just for fun, set the MAC (Eth1.NetworkInterface.PhysicalAddress) before starting.
There was a thread or two about the config program not doing this correctly.


#8

I suspect that this is due to a non valid MAC…

please try my code below to set a valid MAC address:

https://www.ghielectronics.com/community/codeshare/entry/822

and let us know if that solves your problem…

Cheers,
Jay.


#9

@ Brett - The device that distributes IP addresses by DHCP is a FortiGate 60C by Fortinet.

@ Lurch @ Jay Jay - I tried to set MAC address by using the Jay Jay’s code linked above but the issue persists…