FEZ Cerberus with ENC28 Module on 4.3

Hi guys,

I’m trying to switch an old project from 4.2 framework to 4.3.
I need to initialize ENC28 with Static IP and then start a web server.
In 4.2 project I initialized the ENC28 and started Web server using this code:

With NetworkInterface.GetAllNetworkInterfaces()(0)
.EnableStaticIP("", "", "")
.EnableStaticDns(New String() {""})
End With
WebServer.StartLocalServer("", 80)

Now, in framework 4.3 the same code throws this exception on the row of WebServer.StartLocalServer function:

ErrorNumber: 10022
Message: Exception was thrown: System.Net.Sockets.SocketException


Is changed the method for initialize the ENC28 module or it’s the same of 4.2 framework?

Thanks a lot

@ BigFoot - How the FEZ Cerberus handles networking was brought in line with the rest of our products in the 4.3 SDK. https://www.ghielectronics.com/docs/30/networking discusses how to initialize the network now.

@ John - I read that document and I also tried this code:

Dim pEth As New GHI.Networking.EthernetENC28J60(Hardware.SPI.SPI_module.SPI1, Hardware.Cpu.Pin.GPIO_Pin7, Hardware.Cpu.Pin.GPIO_Pin8, Hardware.Cpu.Pin.GPIO_Pin9)
With pEth
   .EnableStaticIP("", "", "")
   .EnableStaticDns(New String() {""})
End With

but the same exception is thrown.
Maybe are wrong the parameters of EthernetENC28J60 constructor?

@ BigFoot - You need to update the pins to match your hardware setup as the document talks about. If you are using Gadgeteer, just connect the ENC28 module in the designer and it will be taken care of for you.

@ John - In older versions of framework I remember that ENC28 module couldn’t be added in designer when using Fez Cerberus. Now is it possible?

@ BigFoot - That is correct, starting in 4.3.

@ John - I found the issue. I didn’t call the EthernetENC28’s function .UseThisNetworkInterface() .

Now I found another problem using WebServer.
Those are the steps I do:

  • Set EthernetENC28 using static ip address;
  • Start a web server on port 80;
  • Manage the web server’s default event using a WebEvent’s class instance.

When I request the default page from a browser I see in the Immediate Control Window that there is a thrown exception IndexOutOfRangeException from Gadgeteer.WebServer.dll:

[quote]Using mainboard GHI Electronics FEZ Cerberus version 1.3
IS OPEN : True
Web server started at
Program Started
Eccezione first-chance di tipo ‘System.IndexOutOfRangeException’ in Gadgeteer.WebServer.dll[/quote]

This exception is thrown each time I request the default page.

Here you can find a sample project (VS2012 - VB.NET) to reproduce this issue: http://www.filedropper.com/gadgeteerapptestenc2843
About hardware I’m using the lastest FEZ Cerberus firmware:

[quote]Loader (TinyBooter) version information: on this computer. on this device.

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

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

The Firmware (TinyCLR) is up to date. <<<[/quote]

What can I do?
Can you provide me a link with WebServer source code for debugging?

@ BigFoot - Regretfully it appears to be an issue with Gadgeteer: https://gadgeteer.codeplex.com/workitem/1861

Solved. Thanks to both!