Cerberus beta MF4.2 network issues

Hi,

I have some issues with the last released version of firmware for Cerberus.

First, I can’t find the class Ehternet as it was for Hydra. The library GHIElectronics.OSH.NETMF.Hardware is not supported by MF4.2.

Second, this is a piece of my code:

        NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
        if (interfaces != null && interfaces.Length > 0)
        {
            networkInterface = interfaces[0];
            if (!networkInterface.IsDhcpEnabled)
                networkInterface.EnableDhcp();
            else
                networkInterface.RenewDhcpLease();
        }

NetworkInterface.GetAllNetworkInterfaces() is finding 1 network.
Once Dhcp is enabled, IPAdress = 0, gateway = o and subnetmask = 0.

Finally, no data is received or sent.

Should I install something else?
Is Ethernet[] class needed for communication?

If is needed, I will post the rest of the code.

Ok, I do not solve the problem, however, you should know that enc28j60 module is supported by SOCKET 5 and no other.
Now I’m able to send data.

Hi Crespi
I’ve got exactly the same problem …
Before I tried socket 1… Now I try socket 5 like you say but for me problem is the same …

If someone knows…

This module needs a type S socket, as shown on the site : http://www.ghielectronics.com/catalog/product/333

On Cerberus, that would be sockets 5 & 6.
On Cerbuino, that would be socket 1
On Hydra, that would be sockets 3 & 4

Hi plouf30,

Do you have a “P” or “Y” module plugged into socket 6? If so, these will disable the “S”, “P”, and “Y” features of socket 5. These sockets require Gadgeteer derating…socket letter features on one socket go away when certain module types are plugged into other sockets.

Try unplugging all other modules first and start with just the ENC28J60 module to get networking running first. Then plug in other modules to find out what works (or run through the schematics and datasheets of the mainboard, mcu, and modules to determine for sure which resources are available).

Chris

Thanks Guys
with Cerberus I only plug ENC28J60 (socket 5 or 6 ) and usbDpModule (socket 8)
It’s the same problem (even static or dhcp) …

And why even I connect none ENC28J60
NetworkInterface.GetAllNetworkInterfaces(); send the same informations …

@ plouf30

There are at least two requirements for Ethernet on Cerberus, First is the Ethernet version of the firmware; the second is you need to have the module plugged into socket 6 of Cerberus to get Ethernet to work. The current version of the firmware has a static chip select pin that is only on socket 6 and subsequently matches socket 1 on Cerbuino.

Thanks for your precision Aron
I stress socket 6 but still nothing …
I think it must be hardware problem…
I will try to put firmware again

Ok guys I think I am squint !
after send again the firmware it’s ok, I was certain, however, to choose ethernet …
thanks now I can have fun with my Cerberus :wink:

Is it possible (and worth it?) to put something in the “Device Capabilities” report that tells whether the firmware is Ethernet or not? (if this dual-firmware scenario is a longer term proposition, then it would be beneficial in my view)

Ideally there no Ethernet version altogether. One firmware with dynamic support is the way to go.

@ plouf30 - Did you make the Ethernet on Cerberus work? How ?

Could you share a piece of code.

I can’t make it work.

Here is my

   public static void Main()
        {

            NetworkInterface ni;

            ni = NetworkInterface.GetAllNetworkInterfaces()[0];

            if (ni.IPAddress != "0.0.0.0")

                Debug.Print("IP Address:" + ni.IPAddress);  // IP address is right



            Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            IPAddress address = IPAddress.Parse(ni.IPAddress);


            IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, 8080);
            server.Bind(localEndPoint);
            server.Listen(2);

            while (true)
            {
                // Wait for a client to connect.
                Socket clientSocket = server.Accept();       // here get exception
                // Process the client request.  true means asynchronous.
                new ProcessClientRequest(clientSocket, true);
            }

        }

@ Sonoguy - did you load the Ethernet version of the firmware?

What kind of exception?

Can you ping the device?

Sorry guys. When I started this post, there was no Ethernet version for Cerberus.
Upgrading Cerberus to the latest firmware versions, it should be able to use the Ethernet module provided by GHI. With a minimum programming skills and Gus saving us, it is possible.

As a comment, if you are having issues, is a good idea to wait some milliseconds or try many times, to get ip.

@ Gus - Yes I load the ethernet version firmware

C:\Program Files (x86)\GHI Electronics\GHI OSHW NETMF v4.2 SDK\FEZ Cerberus\Firmware\Ethernet

SDK Version v0.0.5 (BETA)
July 23, 2012

@ Gus -

Ignore my question. I make the ethernet works today. I have to connect to PC when I am running debug, otherwise exception error 10050

WSAENETDOWN 10050

Network is down.
A socket operation encountered a dead network. This could indicate a serious failure of the network system (that is, the protocol stack that the Windows Sockets DLL runs over), the network interface, or the local network itself.

Thanks

Just for make a precision
In my case I try this before


NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
if (interfaces != null && interfaces.Length > 0)
{
networkInterface = interfaces[0];
if (!networkInterface.IsDhcpEnabled)
networkInterface.EnableDhcp();
else
networkInterface.RenewDhcpLease();
}

and not working
after I see in debug

networkInterface = interfaces[0];

at this time I have a good IP address
and when I do

networkInterface.RenewDhcpLease();

the DHCP seems never give me a good new address

so I comment

// networkInterface.RenewDhcpLease();

and now it’s ok

I have the same issue as plouf30 on chipworkx. Oh, and have you finally fixed NetworkAvailabilityChanged event because it doesn’t work for me on 4.1.8 SDK. [More details about that here → http://www.tinyclr.com/forum/topic?id=5066 ]