Is my ENC28 module broken?

Hi! =)

I was wondering if I can always expect the leds on the ENC28-module to light up when I plug in a ethernet-cable? I’ve tried just about every combination of the various setup procedures I’ve found on this forum to get an IP of the DHCP, but nothing seems to work. I know that the next step is to go static IP and try to ping the device, but I really need the dynamic way to work :slight_smile: So does anyone know what the default behavior of these leds are?

Btw I’ve already tried: Changing sockets, cables, power source (computer vs usb-charger)

Setup: Raptor G400-S 1.1, USB Client SP 1.3, Ethernet ENC28 1.2, netmf 4.3

All help is appreciated ;D

Thx @ andre.m !!

Just to be painfully specific, will the module be able to get a link by just being connected to a powered mainboard (no specific initialization done in code)? Hoping the answer is “no” and that its just another case of pebkac :smiley:

This is the code I used the last time I tried it:

ethernetENC28.NetworkInterface.Open();
ethernetENC28.NetworkSettings.EnableDhcp();
ethernetENC28.NetworkSettings.EnableDynamicDns();
ethernetENC28.UseDHCP();

Hi,
if you add the ENC28 Module with the designer it is initialized automatically.
This code works for me (Raptor, ENC28 Module on Socket 1):


 public partial class Program
    {
        private IPAddress localIpAddress;
        private IPAddress SubnetMask;

        #if ENC28_NETMF
            private static GHI.Networking.EthernetENC28J60 netif;
        #endif

        
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            ethernetENC28.NetworkUp +=ethernetENC28_NetworkUp;
            ethernetENC28.NetworkDown += ethernetENC28_NetworkDown;
            
            if (!ethernetENC28.NetworkInterface.Opened)
            {
                ethernetENC28.NetworkInterface.Open();
            }
            ethernetENC28.NetworkInterface.EnableDhcp();
            ethernetENC28.NetworkInterface.EnableDynamicDns();
            while (ethernetENC28.NetworkInterface.IPAddress == "0.0.0.0")
            {
                Debug.Print("Waiting for DHCP");
                Thread.Sleep(250);
            }
            localIpAddress = IPAddress.Parse(ethernetENC28.NetworkSettings.IPAddress);
            SubnetMask = IPAddress.Parse(ethernetENC28.NetworkSettings.SubnetMask);
            Debug.Print("My IP is: " + localIpAddress.ToString());
            Debug.Print("My Sub is: " + SubnetMask.ToString());
           }
          void ethernetENC28_NetworkDown(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
         {
               Debug.Print("Network Down");
          }

          void ethernetENC28_NetworkUp(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
          {
 	        Debug.Print("Network Up");
           }


First of all, thx for the code example @ RoSchmi, I really appreciate all the help I’ve gotten so far! =)

Unfortunately I think your code example pretty much confirms my original suspicion (that the module has been broken all along). I’ve tried the same thing you suggested a while back, and I even reran your code example just now to be sure, but, alas…there’s no signs of life :’(

The module was fresh out of the bag (even though I ordered it a long time ago), so I guess its a case of a faulty product sneaking its way passed quality control… :confused:

@ dnyvik - Can you try the example on https://www.ghielectronics.com/docs/30/networking#3123 and see if you can get an IP? If you are using socket 1 for the ENC28, the constructor parameters in the example are below. Also before testing, make sure you disconnect all other modules and do a firmware update.


new EthernetENC28J60(GHI.Pins.FEZRaptor.Socket1.SpiModule, GHI.Pins.FEZRaptor.Socket1.Pin6, GHI.Pins.FEZRaptor.Socket1.Pin3, GHI.Pins.FEZRaptor.Socket1.Pin4);