DHCP problem troubleshooter thread

@ KG1 -

I am aware of the issue as I had similar with my Spider. I forgot to say that in my first post.
I would assume that GHI is fully aware of this but I thought I should post anything that I saw that was ‘consistent’ each time I tried it.
I’ll look at your code in codeshare.

Thanks again…

@ andre.m - Dangerous to make assumptions now :wink: Just a thought … if you receive a valid IP after each power up, but not after a reset… you might consider to pragmatically reset the internet device…

@ andre.m - It works much better as before, but i am still testing on G120 and WiFi cos no consistent results… Sometimes hard to Join Router… Sometimes no IP from DHCP… Sometimes socket exceptions… Using Cisco EPC3925. Continue testing today…

It seems that calling _wifi.NetworkInterface.EnableDhcp() in a loop works as a work-around for me…


            Log.Instance.WriteString(LogMessageType.Info, "GetDynamic IP");
            int retryCounter;
            for (retryCounter = 0; retryCounter < 10; retryCounter++)
            {
                try
                {
                    DebugHelper.DebugPrint("Get IP through DHCP..");
            
                    if (!_wifi.NetworkInterface.IsDhcpEnabled)
                        _wifi.NetworkInterface.EnableDhcp();
                    else
                        _wifi.NetworkInterface.RenewDhcpLease();

                    int counter = 20; // wait 20x500mSec = 10 seconds max
                    while (!_ipAddressSetResetEvent.WaitOne(500, false))
                    {
                        DebugHelper.DebugPrint("IP address is not set yet.");
                        if (--counter == 0)
                        {
                            break;
                        }
                    }
                    if (counter > 0)
                    {
                        DebugHelper.DebugPrint("IP address is set");
                        return;
                    }
                }
                catch (Exception e)
                {
                    Log.Instance.WriteException(e);
                    StatusLed.Off();
                    Thread.Sleep(100);
                }
            }

Dear KG1
I test your code in my spider but get some errors.

The code in my spider is

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 GHI.Premium.Net;
using System.Net.Sockets;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using GHINET = GHI.Premium.Net;
using System.Net;
namespace GadgeteerWiFi_Test_GHI_2013_02_14SDK
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
           
            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            if (!wifi_RS21.Interface.IsOpen)
                wifi_RS21.Interface.Open();

            if (!wifi_RS21.Interface.NetworkInterface.IsDhcpEnabled)
                wifi_RS21.Interface.NetworkInterface.EnableDhcp();

            wifi_RS21.Interface.NetworkAddressChanged += new GHI.Premium.Net.NetworkInterfaceExtension.NetworkAddressChangedEventHandler(Interface_NetworkAddressChanged);
            wifi_RS21.Interface.WirelessConnectivityChanged += new GHI.Premium.Net.WiFiRS9110.WirelessConnectivityChangedEventHandler(Interface_WirelessConnectivityChanged);
            NetworkInterfaceExtension.AssignNetworkingStackTo(wifi_RS21.Interface);

            for (int count2 = 0; count2 < 3; count2++)
            {
                GHINET.WiFiNetworkInfo[] scanResult = wifi_RS21.Interface.Scan();

                for (int i = 0; i < scanResult.Length; i++)
                {
                    if (scanResult[i].SSID == "ZyXEL9FA")
                    {
                        string passPhrase = "sinotech11569326";
                        wifi_RS21.Interface.Join(scanResult[i], passPhrase);
                        break;
                    }
                }

                try
                {
                    if (wifi_RS21.Interface != null && wifi_RS21.Interface.IsLinkConnected)
                    {
                        Thread.Sleep(2000);
                        Debug.Print("Network settings for:   Count2 = " + (count2 + 1).ToString());
                        Debug.Print("IP Address: " + wifi_RS21.Interface.NetworkInterface.IPAddress);
                        Debug.Print("Subnet Mask: " + wifi_RS21.Interface.NetworkInterface.SubnetMask);
                        Debug.Print("Default Getway: " + wifi_RS21.Interface.NetworkInterface.GatewayAddress);
                        for (int j = 0; j < wifi_RS21.Interface.NetworkInterface.DnsAddresses.Length; j++)
                        {
                            Debug.Print("DNS Server: " + wifi_RS21.Interface.NetworkInterface.DnsAddresses[j]);
                        }
                        Debug.Print("------------------------------------------------------");
                    }
                    else
                    {
                        Debug.Print("The WiFi link is not connected!");
                    }
                }
                catch (SocketException e)
                {
                    Debug.Print("DHCP Failed");
                    if (e.ErrorCode == 11003)
                        Debug.Print("Re-Enable the module.");

                    throw;
                }

                try
                {
                    string hostName = "www.ghielectronics.com";
                    IPHostEntry myIP = Dns.GetHostEntry(hostName);

                    if (myIP != null)
                    {
                        Debug.Print("Testing access to Internet and DNS:");
                        Debug.Print(hostName + ": " + myIP.AddressList[0].ToString());
                    }
                }
                catch (SocketException e)
                {
                    Debug.Print("Failed to Get the host entry of the FQN from DNS server!");
                    if (e.ErrorCode == 11003)
                        Debug.Print("Re-Enable the module.");
                    throw;
                }

                Debug.Print("------------------------------------------------------");
                Debug.Print("Disconnecting WiFi link.");
                wifi_RS21.Interface.Disconnect();
                Thread.Sleep(2000);
            }
            Debug.Print("Closing WiFi interface");
            wifi_RS21.Interface.Close();
            Thread.Sleep(2000);

        }


     

        void Interface_WirelessConnectivityChanged(object sender, GHI.Premium.Net.WiFiRS9110.WirelessConnectivityEventArgs e)
        {
            Debug.Print("Wireless is: " + (e.IsConnected ? "Connected" : "Disconnected"));

            if (e.IsConnected)
            {
                Debug.Print("SSID: " + e.NetworkInformation.SSID);

                Debug.Print("WiFi Channel number: " + e.NetworkInformation.ChannelNumber);

                DisplayNetworkType(e.NetworkInformation);

                DisplayMACAddress(e.NetworkInformation);

                Debug.Print("RSSI: -" + e.NetworkInformation.RSSI + "dB");

                DisplaySecurityMode(e.NetworkInformation);
            }
        }

        void Interface_NetworkAddressChanged(object sender, EventArgs e)
        {
            Debug.Print("Network address changed!");
            Debug.Print("DHCP is: " + (wifi_RS21.Interface.NetworkInterface.IsDhcpEnabled ? "Enabled" : "Not Enabled"));

            if (wifi_RS21.Interface.NetworkInterface.IPAddress != "0.0.0.0")
            {
                Debug.Print("Is DynamicDnsEnabled enabled: " + wifi_RS21.Interface.NetworkInterface.IsDynamicDnsEnabled);
                Debug.Print("NetworkInterfaceType " + wifi_RS21.Interface.NetworkInterface.NetworkInterfaceType);
                Debug.Print("Network settings:");
                Debug.Print("IP Address: " + wifi_RS21.Interface.NetworkInterface.IPAddress);
                Debug.Print("Subnet Mask: " + wifi_RS21.Interface.NetworkInterface.SubnetMask);
                Debug.Print("Default Gateway: " + wifi_RS21.Interface.NetworkInterface.GatewayAddress);
                Debug.Print("Number of DNS servers:" + wifi_RS21.Interface.NetworkInterface.DnsAddresses.Length);
                for (int i = 0; i < wifi_RS21.Interface.NetworkInterface.DnsAddresses.Length; i++)
                    Debug.Print("DNS Server " + i.ToString() + ":" + wifi_RS21.Interface.NetworkInterface.DnsAddresses[i]);
            }
            else
                Debug.Print("No IP Address allocated!");
            Debug.Print("------------------------------------------------------");
        }
        #region Helpers
        static void DisplayNetworkType(GHINET.WiFiNetworkInfo info)
        {
            switch (info.networkType)
            {
                case GHINET.NetworkType.AccessPoint:
                    {
                        Debug.Print("Wireless Network Type: Access Point");
                        break;
                    }
                case GHINET.NetworkType.AdHoc:
                    {
                        Debug.Print("Wireless Network Type: Ad Hoc");
                        break;
                    }
            }
        }

        static void DisplayMACAddress(GHINET.WiFiNetworkInfo info)
        {
            string MAC = new string(null);
            int splitCount = 0;

            for (int i = 0; i < info.PhysicalAddress.Length; i++)
            {
                MAC += (info.PhysicalAddress[i].ToString("X"));

                if (splitCount < 5)
                {
                    MAC += ":";
                    splitCount++;
                }
            }

            Debug.Print("MAC Address: " + MAC);
        }

        static void DisplaySecurityMode(GHINET.WiFiNetworkInfo info)
        {
            switch (info.SecMode)
            {
                case GHINET.SecurityMode.Open:
                    {
                        Debug.Print("Wireless Security Mode: Open");
                        break;
                    }
                case GHINET.SecurityMode.WEP:
                    {
                        Debug.Print("Wireless Security Mode: WEP");
                        break;
                    }
                case GHINET.SecurityMode.WPA:
                    {
                        Debug.Print("Wireless Security Mode: WPA");
                        break;
                    }
                case GHINET.SecurityMode.WPA2:
                    {
                        Debug.Print("Wireless Security Mode: WPA2");
                        break;
                    }
            }
        }
        #endregion
    }
}

The debug output is

Using mainboard GHI Electronics FEZSpider version 1.0
Program Started
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ZyXEL9FA
WiFi Channel number: 2
Wireless Network Type: Access Point
MAC Address: 00:19:70:2B:F2:C3
RSSI: -72dB
Wireless Security Mode: WPA2
WARN: Total initialization time exceeds 10 seconds.
: ProgramStarted is blocking execution, which means events and timers will not run properly.
: Make sure not to use blocking code such as while(true) - use a GT.Timer instead.
Network settings for: Count2 = 1
IP Address: 0.0.0.0
Subnet Mask: 0.0.0.0
Default Getway: 0.0.0.0

WARN: Total initialization time exceeds 20 seconds.
: ProgramStarted is blocking execution, which means events and timers will not run properly.
: Make sure not to use blocking code such as while(true) - use a GT.Timer instead.
WARN: Total initialization time exceeds 30 seconds.
: ProgramStarted is blocking execution, which means events and timers will not run properly.
: Make sure not to use blocking code such as while(true) - use a GT.Timer instead.
WARN: Total initialization time exceeds 40 seconds.
: ProgramStarted is blocking execution, which means events and timers will not run properly.
: Make sure not to use blocking code such as while(true) - use a GT.Timer instead.
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) ####
#### Message:
#### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] ####
#### System.Net.Dns::GetHostEntry [IP: 0008] ####
#### GadgeteerWiFi_Test_GHI_2013_02_14SDK.Program::ProgramStarted [IP: 01d5] ####
#### GadgeteerWiFi_Test_GHI_2013_02_14SDK.Program::Main [IP: 0015] ####
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.dll
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
Failed to Get the host entry of the FQN from DNS server!
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in GadgeteerWiFi_Test_GHI_2013-02-14SDK.exe
#### SocketException ErrorCode = 10060
An unhandled exception of type ‘System.Net.Sockets.SocketException’ occurred in GadgeteerWiFi_Test_GHI_2013-02-14SDK.exe

WARN: Total initialization time exceeds 50 seconds.
: ProgramStarted is blocking execution, which means events and timers will not run properly.
: Make sure not to use blocking code such as while(true) - use a GT.Timer instead.
#### SocketException ErrorCode = 10060
Uncaught exception

@ Tzu Hsuan: It’s good to see you modifying my code for Gadgeteer libraries. I have had no experience with Gadgeteer so cannot help you with this. Also I have not previously seen such timing errors in the debug messages. Are you using Version 4.2.9.0?

The ProgramStarted method is not meant to take forever; the Gadgeteer core is warning you that it’s taking longer than expected. @ Tzu, you can either use the code originally posted here by GHI (in a console app) or do as the Gadgeteer core suggests and move the initialisation outside programstarted() method.

I use the GHI NETMF v4.2 and .NET Gadgeteer Package 2013-02-14 Testing.

I try simple testing but still get 0.0.0.0 IP adress and can’t connect to internet.

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 GHI.Premium.Net;
using System.Net.Sockets;
using Gadgeteer.Networking;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace GadgeteerWIFITESTSDK2013_02_14
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        string ssid = "ZyXEL9FA";     // <<<<< You need to enter your SSID here
        string PassKey = "sinotech11569326";    // <<<<< You need to enter your Password/Key here

        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.
            Debug.Print("Program Started");

            if (!wifi_RS21.Interface.IsOpen)
            {
                wifi_RS21.Interface.Open();
            }

            if (!wifi_RS21.Interface.NetworkInterface.IsDhcpEnabled)
            {
                wifi_RS21.Interface.NetworkInterface.EnableDhcp();
            }
            wifi_RS21.Interface.WirelessConnectivityChanged += new GHI.Premium.Net.WiFiRS9110.WirelessConnectivityChangedEventHandler(Interface_WirelessConnectivityChanged);
            NetworkInterfaceExtension.AssignNetworkingStackTo(wifi_RS21.Interface);

            WiFiNetworkInfo[] scanResult = wifi_RS21.Interface.Scan();

            for (int i = 0; i < scanResult.Length; i++)
            {
                if (scanResult[i].SSID == "ZyXEL9FA")
                {
                    string passPhrase = "sinotech11569326";
                    wifi_RS21.Interface.Join(scanResult[i], passPhrase);
                    break;
                }
            }
             
        }



    
            void Interface_WirelessConnectivityChanged(object sender, WiFiRS9110.WirelessConnectivityEventArgs e)
        {
            Debug.Print("IP=" + wifi_RS21.Interface.NetworkInterface.IPAddress);
            Debug.Print("IP=" + e.IsConnected.ToString());
            //Gadgeteer.Networking.HttpRequest wc = WebClient.GetFromWeb("http://www.google.com");
           // wc.ResponseReceived += new HttpRequest.ResponseHandler(wc_ResponseReceived);
            HttpRequest request;
            request = Gadgeteer.Networking.WebClient.GetFromWeb("http://www.google.com");
            request.ResponseReceived += new HttpRequest.ResponseHandler(request_ResponseReceived);

        }

        void request_ResponseReceived(HttpRequest sender, HttpResponse response)
        {
            string text = response.Text;
            Debug.Print("***Response is received : " + text);
        }
        
        
    }
}

Debug output.

The thread ‘’ (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZSpider version 1.0
Program Started
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
IP=0.0.0.0
IP=True
The thread ‘’ (0x3) has exited with code 0 (0x0).
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (6) ####
#### Message:
#### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] ####
#### System.Net.Dns::GetHostEntry [IP: 0008] ####
#### System.Net.HttpWebRequest::EstablishConnection [IP: 00e1] ####
#### System.Net.HttpWebRequest::SubmitRequest [IP: 0019] ####
#### System.Net.HttpWebRequest::GetResponse [IP: 000c] ####
#### Gadgeteer.Networking.HttpRequest::HandleRequestSync [IP: 01a9] ####
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.dll
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
#### Exception System.Net.WebException - 0x00000000 (6) ####
#### Message: host not available
#### System.Net.HttpWebRequest::EstablishConnection [IP: 00f1] ####
#### System.Net.HttpWebRequest::SubmitRequest [IP: 0019] ####
#### System.Net.HttpWebRequest::GetResponse [IP: 000c] ####
#### Gadgeteer.Networking.HttpRequest::HandleRequestSync [IP: 01a9] ####
A first chance exception of type ‘System.Net.WebException’ occurred in System.Http.dll
#### Exception System.Net.WebException - 0x00000000 (6) ####
#### Message:
#### System.Net.HttpWebRequest::GetResponse [IP: 00d3] ####
#### Gadgeteer.Networking.HttpRequest::HandleRequestSync [IP: 01a9] ####
A first chance exception of type ‘System.Net.WebException’ occurred in System.Http.dll

An exception occured while connecting to the Internet. Please, make sure that a valid URL is used and a network connection is up.

Update:

I posted about receiving three wifi_NetworkAddressChanged events.

I have found out that > I < was causing the multiple interrupts.

It appears the my use of ‘display.SimpleGraphics.DisplayText()’ is causing some timing issue.

I do receive the proper IP from DHCP even while using SimpleGraphics.DisplayText() but it does cause the issue.

Using Debug.Print() does not cause the multiple interrupts.

Using a Cobra II.

@ Tzu, please use ghi’s code. They’ve explicitly asked for you to use their known working code, and to provide additional info about your network setup.

@ Brett -

Geee it was for @ Tzu

Oh well… The comments below still apply because using the display did give me a problem.

I did EXACTALY that originally. I gave the results I found using ‘their known working code’ without ANY changes.
I stated that received a valid IP from my router using my Cobra II.

I believe I posted what I did when I tried printing to the LCD. Maybe I forgot to say ‘why’ I did.
I was trying to track down a issue I had getting DHCP with my Spider some time ago using 4.1 and 4.2.

I was receiving multiple NetworkAddressChanged events on the Spider and Cobra II
and I wanted to find out if I could duplicate the problem. (At least with my boards and router)

My post was only to inform others that using the display ‘did in fact’ cause a repeatable problem
that caused multiple NetworkAddressChanged events.

I did not intend to cause confusion.

Have a GREAT day!

I’m not trying to have a go at @ Tzu, just point out that using code that GHI haven’t confirmed “works” for diagnosing the DHCP problem, when they’ve explicitly asked to use that code (making minimal changes if needed), doesn’t add value to this thread. It’s fine to have that conversation elsewhere, but the key goal here was to drive out a pretty serious problem by capturing the same information from as many people who have the issue using a repeatable process, so the value of that information gets maximised. We’re unfortunately adding to the noise to signal ratio here…

  1. Latest firmware 4.2.9.0
  2. No changes made to the code.
  3. Custom G120 + RS9110-N11-22-04 Rev 7 0F
  4. Interface: WiFi RS21
  5. Router Cisco EPC3925

Using MFdeploy reboot CLR via menu, Board remain power

For those who are curious what the Dutch phrase of the SSID means… “I am so Happy” But i guess i am going to change this phrase :wink:


Connecting to G120_G120…Connected
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -82dB
Wireless Security Mode: WPA2
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.63
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:62.179.104.196
DNS Server 1:213.46.228.196


MFDeploy… Plug-In → Debug → RebootCLR

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -84dB
Wireless Security Mode: WPA2


WAIT 30 seconds
MFDeploy… Plug-In → Debug → RebootCLR

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -82dB
Wireless Security Mode: WPA2


WAIT 30 seconds
MFDeploy… Plug-In → Debug → RebootCLR

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -76dB
Wireless Security Mode: WPA2


WAIT 30 seconds
MFDeploy… Plug-In → Debug → RebootCLR

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -94dB
Wireless Security Mode: WPA2
Wireless is: Disconnected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -94dB
Wireless Security Mode: WPA2
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -94dB
Wireless Security Mode: WPA2


WAIT 30 seconds
MFDeploy… Plug-In → Debug → RebootCLR

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
#### Exception System.Exception - 0x00000000 (1) ####
#### Message:
#### GHI.Premium.Net.RS9110Helper::Join [IP: 003b] ####
#### GHI.Premium.Net.WiFiRS9110::Join [IP: 008b] ####
#### Program::Main [IP: 008b] ####
#### Exception GHI.Premium.Net.NetworkInterfaceExtensionException - 0x00000000 (1) ####
#### Message:
#### GHI.Premium.Net.WiFiRS9110::Join [IP: 00e0] ####
#### Program::Main [IP: 008b] ####
Uncaught exception
Wireless is: Connected
#### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (4) ####
#### Message:
#### Program::wifi_WirelessConnectivityChanged [IP: 0023] ####
#### GHI.Premium.Net.WiFiRS9110::NetworkChangeExtension_NetworkAvailabilityChanged [IP: 0025] ####
#### GHI.Premium.Net.NetworkChangeExtension::OnNetworkChangeCallback [IP: 0099] ####
#### GHI.Premium.Net.NetworkChangeExtension+NetworkChangeExtensionListener::OnEvent [IP: 000d] ####
#### Microsoft.SPOT.EventSink::EventDispatchCallback [IP: 0014] ####
Uncaught exception
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.63
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:62.179.104.196
DNS Server 1:213.46.228.196


WAIT 30 seconds
MFDeploy… Plug-In → Debug → RebootCLR

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
#### Exception System.Exception - 0x00000000 (1) ####
#### Message:
#### GHI.Premium.Net.RS9110Helper::Join [IP: 003b] ####
#### GHI.Premium.Net.WiFiRS9110::Join [IP: 008b] ####
#### Program::Main [IP: 008b] ####
#### Exception GHI.Premium.Net.NetworkInterfaceExtensionException - 0x00000000 (1) ####
#### Message:
#### GHI.Premium.Net.WiFiRS9110::Join [IP: 00d9] ####
#### Program::Main [IP: 008b] ####
Uncaught exception

  1. Latest firmware 4.2.9.0
  2. No changes made to the code.
  3. Custom G120 + RS9110-N11-22-04 Rev 7 0F
  4. Interface: WiFi RS21
  5. Router Cisco EPC3925

Power the board On/OFF watched the results from COM1 using Teraterm

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -92dB
Wireless Security Mode: WPA2
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.63
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:62.179.104.196
DNS Server 1:213.46.228.196


POWER DOWN

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
#### Exception GHI.Premium.Net.NetworkInterfaceExtensionException - 0x00000000 (1) ####
#### Message:
#### GHI.Premium.Net.RS9110Helper::Join [IP: 0031] ####
#### GHI.Premium.Net.WiFiRS9110::Join [IP: 008b] ####
#### Program::Main [IP: 008b] ####
Uncaught exception


POWER DOWN

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5


WAIT 30 seconds POWER DOWN

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -80dB
Wireless Security Mode: WPA2
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.63
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:62.179.104.196
DNS Server 1:213.46.228.196


POWER DOWN

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -84dB
Wireless Security Mode: WPA2
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.63
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:62.179.104.196
DNS Server 1:213.46.228.196


POWER DOWN

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ikbenzoblij
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: E8:40:F2:C7:34:91
RSSI: -88dB
Wireless Security Mode: WPA2
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.63
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:62.179.104.196
DNS Server 1:213.46.228.196


POWER DOWN

G120
Version: 4.2.9.0
Debug: COM1
LCD: 320x240
.NetMF v4.2.0.0
G120, Build Date:
Feb 13 2013 13:50:21
ARM Compiler version 410713

TinyCLR (Build 4.2.0.0)

Starting…
Created EE.
Started Hardware.
MSdbgV1y§Ç´Ãÿ%6Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHI.Premium.Hardware.G120 (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Native (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.9.0) Attaching deployed file.
Assembly: G120DHCP (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Resolving.
GC: 1msec 314064 bytes used, 7025604 bytes available
Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 7025604 bytes
Type 17 (ASSEMBLY ): 15888 bytes
Type 1E (BINARY_BLOB_HEAD ): 298080 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
Ready.
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5


WAIT… POWER DOWN

I have extended the two test from above to show that EVEN a valid IP address is assigned… Does not always guaranty that sockets works well…
I have tested this with GetDnsHostEntry as wel as trying to connect and send data to a local device over sockets


    for (int i = 0; i < scanResult.Length; i++)
        {
            if (scanResult[i].SSID == "MatRouter")
            {
                wifi.Join(scanResult[i], "Wi$1024Fi");
                break;
            }
        }

        while (wifi.NetworkInterface.IPAddress == "0.0.0.0")
        {
            Thread.Sleep(500);
        }

        Debug.Print("GetHostEntry");
        try
        {
            IPHostEntry iph = Dns.GetHostEntry("www.sentics.com");
            for (int i=0; i < iph.AddressList.Length; i++)
            {
                Debug.Print(iph.AddressList[i].ToString());
            }
        }
        catch (Exception e)
        {
            Debug.Print(e.Message);
        
        }

        Thread.Sleep(-1);

Repeated the test with a Chinese brand portable router, one that is close to my desk and no other devices connected too…

Same kind of behaviour as my Cisco… One time it works, the other time it wont… :frowning:

@ GHI - Have you checked the latest firmware (4.7 2/1/2013 ) from RedPine. I just noticed that there is a more recent version, but don’t know if there are changes that might be interesting to us…

@ Brett -

I’m not trying to have a go at @ Tzu

I understand that…

At first, I thought it was for me! I’m OK with that also…

Can’t say I ever read anything unfriendly in this form…

@ willgeorge: Any testing that makes v4.2.9.0 a better product is worth doing. Keep up the good work. What you are doing is relevant to establishing a wireless network connection. It is interesting how often the class NetworkInterface appears to be associated with the variablity of outcomes. This class is in the centre of setting up a wireless network with its DHCP functions. Note that it is not in a GHI Library but in a NETMF Library. Perhaps under the hood there is multithreading causing timing differences (processor taking different time slices). I consider placing Thread.Sleep functions in the code is a relevant step in testing. It confirms whether the code can take some variability in the same way that your display adds variability.

OK, I modified GHI’s Code to Gadgeteer project.

  1. Latest firmware 4.2.9.0
  2. little change to the code.

change wifi to wifi_RS21.Interface
and comment it //Thread.Sleep(-1);

  1. Spider mainboard

  2. Interface: WiFi RS21 Gadgeteer module

  3. I don;t really know the network setup in my company

  4. ZyXEL Router in office don’t know the number.

  5. DCHP Address obtained first try and can’t get the DCHP Address every time after a soft or hard reboot.

If I re-power the Router I can obtain DCHP Address only in the first time and Interface_NetworkAddressChanged event only raise in the first try also.

First try

Program Started
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ZyXEL9FA
WiFi Channel number: 3
Wireless Network Type: Access Point
MAC Address: 00:19:70:2B:F2:C3
RSSI: -64dB
Wireless Security Mode: WPA2
The thread ‘’ (0x3) has exited with code 0 (0x0).
New address for the Wireless Network Interface
Is DhCp enabled: True
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 10.59.1.20
Subnet Mask: 255.255.255.0
Default Gateway: 10.59.1.1
Number of DNS servers:1
DNS Server 0:200.200.6.2

Second try

Program Started
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: ZyXEL9FA
WiFi Channel number: 3
Wireless Network Type: Access Point
MAC Address: 00:19:70:2B:F2:C3
RSSI: -66dB
Wireless Security Mode: WPA2
The thread ‘’ (0x3) has exited with code 0 (0x0).

@ KG1 -
I have not had much time… babysitting Grandchildren…

However I had time to take the sample code that was giving me a DHCP IP address for the WiFi device on the first shot.
I was reciving only one NetworkAddressChanged and a proper IP address.

I added some simple code to see if I could get the default web page.
I have the correct IP address for the WiFi device.


            //string url = "http://192.168.2.5:80/cobrawifi/";
            string url = "http://" + WiFideviceIP + ":" + port.ToString() + "/cobrawifi/";
            //Debug.Print(url);
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url) as HttpWebRequest;
            string[] sResponse;
            sResponse = new string[5];

            sResponse[0] = "CONNECT";
            sResponse[1] = "POST";
            sResponse[2] = "GET";
            sResponse[3] = "PUT";

            request.UserAgent = "cobrawifi";
            request.KeepAlive = false;
            request.Timeout = 2000;

After adding the code I am now back to reciving three NetworkAddressChanged events.
Event 1 - I reveive the proper IP
Event 2 - IP 0.0.0.0
Event 3 - I reveive the proper IP

However I now have the visual studio Output window full of ERRORS…
Too many to post here.

I removed my T35 LCD from the board just to remove any possibility it has any influence on timing or something like that.

I checked my router and it shows that it is assigning a DHCP IP address that is correct
(My WiFi module has always came back with 192.168.2.5)

See attached image… Usually there are many more items in the DHCP list but most of the electronic ‘toys’ are off…