Cerbuino Bee and ENC28

Hi everyone.

I’m currently using the mIP framework to use the ENC28 module with my Cerbuino Bee. There are a few issues with the code that I’m trying to work through, such as DNS lookups failing after calling a webservice 3 times. Because of that, I’m curious if I can use the Ethernet enabled firmware on the Cerbuino Bee. I’ve tried this before but I get an error stating the socket is invalid.

Ethernet_ENC28 en = new Ethernet_ENC28(1);

I’ve updated my firmware to the latest version as of last week (11/8), using .net MF 4.2.

Has anyone successfully gotten the ENC28 working on the Cerbuino Bee without the use of the mIP framework?


If you load the ethernet firmware then there is nothing else to do to be able to use networking. See this http://wiki.tinyclr.com/index.php?title=Ethernet_ENC28_Module

I have read the wiki link you posted but I’m not sure where to go. Are there any code examples for the ENC28 that I can reference? I have looked at http://www.tinyclr.com/codeshare/entry/588 but I keep getting exceptions being thrown. I have the following code:

var eth = new EthernetENC28J60(SPI.SPI_module.SPI1, (Cpu.Pin)13, (Cpu.Pin)14, FEZCerberus.Pin.PC1);

I get an “IndexOutOfRange” exception. Am I using the correct classes for the Cerbuino Bee and the ENC28 module?

@ bdowden

The ENC28 Gadgeteer module interface only works with the premium libraries. Once you have the module in the right socket you only need to implement your net code into your program in the non Gadgeteer manner.

Ah, alright. So just by having the ethernet firmware and plugging the ENC28 module into socket 1, I can do something like

WebRequest req = new HttpWebRequest.Create("http://www.google.com");

and it should just work? I’ll give that a shot.

@ bdowden - I will be the first to admit that the mIP stack is immature compared to LWIP. You should definitely consider both. But at the same time, mIP is far easier to debug and fix. With respect to the version of mIP in codeplex, I have made huge progress since the last check-in. I am trying to tidy the code up for a Beta version Check-in in codeplex. It is exceptionally stable now and with respect to DNS, there is now proper caching implemented and some very nice synchronous methods with proper/configurable timeouts!

@ Aron - Thanks! It worked. After looking at http://www.tinyclr.com/forum/topic?id=8967, I realized I had to enable static IP for the time being (which I guess I need to deal with for now).

@ Valkyrie - Good to know. I’m happy to send a patch/pull request, but I’ll wait until you commit your latest code to see if it helps any. I’d love to use it, especially considering I’m stuck with static IPs for now.