Hydra NIC configuration in GHI NETMF and Gadgeteer Package 2014 R5

Hello,
We are performing Hydra firmware from 4.2 to the latest version (GHI NETMF and Gadgeteer Package 2014 R5 ) and trying to enable networking.
I’m checking the connectivity with ping (enabled by default in 4.2).
I tried to use old method to set static IP with FEZ Config but it didn’t work. Device still doesn’t response to ping.
I tried to set it in SW in two ways:

  1. The way we used once in 4.2 and mentioned here https://www.ghielectronics.com/community/codeshare/entry/606
                
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
if (interfaces.Length > 0)
{
       interfaces[0].EnableStaticIP("10.12.227.250", "255.255.255.0", "10.12.227.3");
}

  1. The second way I found somewhere in GHI forums
                
var netif = new EthernetENC28J60(SPI.SPI_module.SPI1, (Cpu.Pin)(32 + 13), (Cpu.Pin)(32 + 8), (Cpu.Pin)(32 + 9)); // Hydra socket 3
netif.EnableStaticIP("10.12.227.243", "255.255.255.0", "10.12.227.3");
netif.Open();

Both of them didn’t work.
My question is whether ping response is still enabled in FW?
Should I enable and configure networking each time I starting Hydar?
I will really appreciate any working code sample enables network.

Thanks,
Alex

Another observation.
I tried to add EthernetENC28 with diagram to slot 3.
The following code generates exception:

               
 ethernetENC28.UseStaticIP("10.12.227.200", "255.255.255.0", "10.12.227.3");

Debugging was not possible since debugger each time requested to make reboot:
THE MAINBOARD WILL NOW REBOOT.
To continue debugging, you will need to restart debugging manually (Ctrl-Shift-F5)
After restarting manually the following error generated:
An error has occurred. Please check your hardware

@ Alexr111 - You code looks right. https://www.ghielectronics.com/docs/30/networking should help you get started. To fix the “THE MAINBOARD WILL NOW REBOOT.” messages continually coming up, try to reflash the loader and firmware.

Can you really clarify what you are going to do ? Are you trying to update from your code 4.2 to 4.3 ? And to confirm, if you’re doing this that you have updated your firmware ?

Hello Bret and John,
Thanks for prompt reply.
Eventually I figured out and got a ping working.
Anyway I will try to describe here my findings:
I’m trying to update Hydra’s official FW and bootloader from 4.2 to 4.3. I’m using the latest GHI release (GHI NETMF and Gadgeteer Package 2014 R5 ).
I tried to configure network using the following methods:


        private void InitializeNetwork()
        {
            Utils.DatedPrint("Initializing network...");
            NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
            if (interfaces.Length > 0)
            {
                interfaces[0].EnableStaticIP("10.12.227.200", "255.255.255.0", "10.12.227.3");
            }
        }
        private void InitializeNetwork1()
        {
            var netif = new EthernetENC28J60(SPI.SPI_module.SPI1, (Cpu.Pin)45, (Cpu.Pin)40, (Cpu.Pin)41, 4000); //socket 3
            netif.Open();
            netif.EnableStaticIP("10.12.227.200", "255.255.255.0", "10.12.227.3");
        }
        private void InitializeNetwork2()
        {
            ethernetENC28.UseThisNetworkInterface();
            ethernetENC28.UseStaticIP("10.12.227.200", "255.255.255.0", "10.12.227.3");
        }
        private void InitializeNetwork3()
        {
            EthernetBuiltIn builtIn = new EthernetBuiltIn();
            builtIn.Open();
            builtIn.EnableStaticIP("10.12.227.200", "255.255.255.0", "10.12.227.3");
        }
        private void InitializeNetwork4()
        {
            var netif = new EthernetENC28J60(SPI.SPI_module.SPI1, Cpu.Pin.GPIO_Pin1, Cpu.Pin.GPIO_Pin2, Cpu.Pin.GPIO_Pin3);
            netif.Open();
            netif.EnableStaticIP("10.12.227.200", "255.255.255.0", "10.12.227.3");
        }


Only method InitializeNetwork2 found working. InitializeNetwork worked on 4.2 does nothing on 4.3. The rest of methods throws exception. Network2 or Network4 causes to Hydra making endless reboots. This was solved only by refllash loader and FW.
In addition please notice that after adding network assemblies debugging is not possible and failing with THE MAINBOARD WILL NOW REBOOT message

@ Alexr111 - If you are using Gadgeteer (and it looks like you are), Network1 will not work. Network is no longer supported in 4.3 for the Hydra. Network3 is only for devices with built in Ethernet like the EMX and G400. Network4 is the sample code from the documentation that needs to be adjusted for your hardware (in a non-Gadgeteer program). So you are correct that only Network2 will work.

The reboot message should only be displayed the first time you try to debug. The second time should work. The endless reboots you saw the first time should have been corrected by the reflashing.