ENC28 on the Bee

I am on the latest beta firmware and was wondering if they ever got networking on the device I flashed the networking firmware and still with the ping code I get this…

An unhandled exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.dll

from

Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp);
socket.Bind(localEndPoint);
socket.SetSocketOption(
SocketOptionLevel.IP,
SocketOptionName.IpTimeToLive,
128
);

any suggestions or do I have to wait on this too???

If using beta then please continue to post in beta forum to contain all “beta” issues. For now, it is okay.

Why are you starting with ICMP instead of using UDP or TCP? I am not sure if ICMP is supported in NETMF 4.2.

Was just trying to ping out made sense to me to build aping and send it pretty basic…
Any ways… I can try a web request instead…

Tried TCP with same error… wondering now if the plug in is correct for the enc28 i have it in socket 1 on the Bee and to my router with a static ip with this code

      var iface = NetworkInterface.GetAllNetworkInterfaces()[0];
                    iface.PhysicalAddress = new byte[] { 0x00, 0x19, 0x5B, 0x04, 0x36, 0x20 };
                    iface.EnableStaticIP("192.168.1.180", "255.255.255.0", "192.168.1.99");
                    iface.EnableStaticDns(new string[] {"206.54.112.1" });

two things arnt working for me … DNS and sockets…

IPHostEntry host = Dns.GetHostEntry(server);

throws an error

Socket socket= new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(new IPEndPoint(IPAddress.Parse("74.125.227.66"), 80));
 

any suggestions observations??

Can you ping the device and see a response?

I mean, from PC’s prompt,
ping 192.168.1.180

Nope no ping… Like i say not sure if ive got it configured right…

I just thought about something! This will not work on Cerbuino Bee on current release. Which socket you have ENC28 plugged into?

Aron was saying today that we need to change the ethernet version of the firmware to use socket 6 on Cerberus which marches a socket on cerbuino.

Aron?

I have it in socket 1 marked with s

Yes, unfortunately it was socket 6 on Cerberus that matched Cerbuino’s SPI socket 1 and to an extent be compatable with Cerb40. It will be fixed to conform to the whole family.

so what another week?? Last week I kinda gave up and ordered a spider kit… I’m betting it will be here before I get this board fully working like I want, and all I have left is the networking for this project …

Actually, how would right now sound? :slight_smile: Can you accept zip files in your email account? I can send you a copy of the firmware for you to test in your Cerbuino.

i can up to 20 mb… and will be glad to reply with my findings…

What email should I send it to? Your forum email is an account that will not accept zip files. If you want me to email it to this email then I will change the extension so the email server will not reject the file.

pepperlk@ gmail.com or lp@ pitchengine.com if it wont accept zip feel free to change it i can adjust on my side also drop box on the pepperlk@ gmail.com

I emailed the file to you. I hope it works well. :slight_smile:

Any chance I can get a copy to try on my Cerb40? This is exactly what I needed here: http://www.tinyclr.com/forum/topic?id=7571
My email address is my username @ gmail

I emailed you a copy as well.

Thanks, I’ll keep you posted.

for whatever reason i still cant ping the board…

here is all of the code… I must be missing something also i have the new firmware… and the network is showing activity…

using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Microsoft.SPOT.Net.NetworkInformation;

namespace GadgeteerApp1
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing 
            their name followed by a period, e.g.  button.  or  camera.
            
            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>
            
            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.


            new Thread(delegate()
                {

                    var iface = NetworkInterface.GetAllNetworkInterfaces()[0];
                    iface.PhysicalAddress = new byte[] { 0x00, 0x19, 0x5B, 0x04, 0x36, 0x20 };
                    //iface.EnableDhcp();
                    //iface.EnableDynamicDns();
                    //iface.RenewDhcpLease();

                    iface.EnableStaticIP("192.168.1.115", "255.255.255.0", "192.168.1.99");
                    iface.EnableStaticDns(new string[] { "206.54.112.1" });

                    //Thread.Sleep(2000);
                    Debug.Print(iface.IPAddress);
              

                    int i = 0;
                }).Start();


            Debug.Print("Program Started");
        }
    }
}

It works! I can ping the device from another machine on the network!

Thanks, Aron! I’ll do more extensive testing shortly.