Wifi RS21 Unable to Start

Hi,

I am trying to get my Wifi RS21 Module working with my FEZ spider. I am trying a really basic program with the USB DP (using external power and USB) and a Wifi RS21 module only.

The wifi module is using socket 6

I have tried using both socket 6 and 9 and have tried several different cables.

The application code is

private static WiFiRS9110 netif;

        void ProgramStarted()
        {
            NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged;
            NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged;

            netif = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)10, (Cpu.Pin)18, (Cpu.Pin)20);
            netif.Open();
            netif.EnableDhcp();
            netif.EnableDynamicDns();
            netif.Join("xxxxxxx", "xxxxxxx");

            while (netif.IPAddress == "0.0.0.0")
            {
                Debug.Print("Waiting for DHCP");
                Thread.Sleep(250);
            }

        }

        private static void NetworkChange_NetworkAddressChanged(object sender, Microsoft.SPOT.EventArgs e)
        {
            Debug.Print("Network address changed");
        }

        private static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            Debug.Print("Network availability: " + e.IsAvailable.ToString());
        }

The program never get past



The output of the application is 

Found debugger!

Create TS.

 Loading start at a0e00000, end a0e2f494

   Assembly: mscorlib (4.3.1.0)     Assembly: Microsoft.SPOT.Native (4.3.1.0)     Assembly: Microsoft.SPOT.Security.PKCS11 (4.3
.1.0)     Assembly: System.Security (4.3.1.0)     Assembly: Microsoft.SPOT.Hardware (4.3.1.0)  
   Assembly: Microsoft.SPOT.Graphics (4.3.1.0)     Assembly: Microsoft.SPOT.TinyCore (4.3.1.0)  
   Assembly: Microsoft.SPOT.IO (4.3.1.0)     Assembly: System.IO (4.3.1.0)     Assembly: Microsoft.SPOT.Hardware.Usb (4.3.1.0) 
    Assembly: Microsoft.SPOT.Hardware.SerialPort (4.3.1.0)     Assembly: Microsoft.SPOT.Touch (4.3.1.0)  
   Assembly: Microsoft.SPOT.Ink (4.3.1.0)     Assembly: Microsoft.SPOT.Hardware.PWM (4.3.1.0)  
Loading Deployment Assemblies.

Attaching deployed file.

   Assembly: Gadgeteer (2.43.1.0)  Attaching deployed file.

   Assembly: GHI.Hardware (4.3.6.0)  Attaching deployed file.

   Assembly: Microsoft.SPOT.Net.Security (4.3.1.0)  Attaching deployed file.

   Assembly: System (4.3.1.0)  Attaching deployed file.

   Assembly: GTM.GHIElectronics.WiFiRS21 (4.3.6.0)  Attaching deployed file.

   Assembly: GadgeteerApp1 (1.0.0.0)  Attaching deployed file.

   Assembly: GTM.GHIElectronics.USBClientDP (4.3.6.0)  Attaching deployed file.

   Assembly: Gadgeteer.SPI (2.43.1.0)  Attaching deployed file.

   Assembly: GHI.Usb (4.3.6.0)  Attaching deployed file.

   Assembly: Microsoft.SPOT.Net (4.3.1.0)  Attaching deployed file.

   Assembly: GHIElectronics.Gadgeteer.FEZSpider (4.3.6.0)  Attaching deployed file.

   Assembly: GHI.Networking (4.3.6.0)  Resolving.

GC: 1msec 38388 bytes used, 7301280 bytes available

Type 0F (STRING              ):     24 bytes

Type 15 (FREEBLOCK           ): 7301280 bytes

Type 17 (ASSEMBLY            ):  36528 bytes

Type 1E (BINARY_BLOB_HEAD    ):   1332 bytes

Type 28 (MEMORY_STREAM_HEAD  ):     36 bytes

Type 29 (MEMORY_STREAM_DATA  ):    396 bytes

Type 34 (APPDOMAIN_HEAD      ):     72 bytes

GC: performing heap compaction...

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\mscorlib.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Native.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Security.PKCS11.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.Security.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Graphics.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.TinyCore.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.IO.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.IO.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.Usb.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.SerialPort.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Touch.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Ink.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Net.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies\.NET Micro Framework 4.3\le\Gadgeteer.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.3 SDK\Libraries\le\GHI.Hardware.dll'
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Net.Security.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.3 SDK\Libraries\le\GHI.Networking.dll'
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies\.NET Micro Framework 4.3\le\Gadgeteer.SPI.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Modules\WiFiRS21\NETMF 4.3\le\GTM.GHIElectronics.WiFiRS21.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Modules\USBClientDP\NETMF 4.3\le\GTM.GHIElectronics.USBClientDP.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.3 SDK\Libraries\le\GHI.Usb.dll'
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Mainboards\FEZSpider\NETMF 4.3\le\GHIElectronics.Gadgeteer.FEZSpider.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Users\James\Desktop\GadgeteerApp1\GadgeteerApp1\bin\Debug\le\GadgeteerApp1.exe', Symbols loaded.
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZ Spider version 1.0
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAddressChanged.add'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAddressChanged.add'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged.add'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged.add'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.RefreshNetworkInterface'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces'
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.RefreshNetworkInterface'
Step into: Stepping over non-user code 'GHI.Networking.BaseInterface.BaseInterface'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'Microsoft.SPOT.Hardware.OutputPort.OutputPort'
Step into: Stepping over non-user code 'Microsoft.SPOT.Hardware.OutputPort.OutputPort'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WiFiRS9110'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.Reset'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.Reset'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.Reset'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.Reset'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.Reset'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WaitOn'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.WaitOn'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'
Step into: Stepping over non-user code 'GHI.Networking.WiFiRS9110.UpdateInternalMacAddress'




Do I need to manually set a mac address on the module ?
If so how can I do this ?

Is my Module possibly faulty ?
If so can I return it ?

My Fez config network windows is attached

@ j1mb0jay - It looks like you are using Gadgeteer, in which case I’m assuming you have added the WiFi RS21 through the toolbox to your project?

In which case you don’t need to initialize it but simply use the instance that is created automatically during initialization of the modules. Take a look in “Program.generated.cs”

Also, if you go into a loop in the ProgramStarted method, events will never occur. And things will not work as expected.

I have tried using the toolbox which did not work.

The code never hits the loop as it never gets passed

netif = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)10, (Cpu.Pin)18, (Cpu.Pin)20);

As it is hanging on

‘GHI.Networking.WiFiRS9110.UpdateInternalMacAddress’

@ j1mb0jay - if you are using gadgeteer then you should not try to communicate with the module directly.

Have you gone through the gadgeteer book newly posted? Or is under the gadgeteer support page.

It talks about not blocking the program started method as well.

Try this…


using System;
using Microsoft.SPOT;

using GT = Gadgeteer;
using Microsoft.SPOT.Net.NetworkInformation;

namespace GadgeteerApp1
{
    public partial class Program
    {
        #region Confidential
        string SSID = "YourSSID";
        string PASSWORD = "YourPassword";

        #endregion

        GT.Timer Kick;

        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            if (!wifiRS21.NetworkInterface.Opened)
                wifiRS21.NetworkInterface.Open();

            if (!wifiRS21.NetworkInterface.IsDhcpEnabled)
                wifiRS21.NetworkInterface.EnableDhcp();


            NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged;
            NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged;

            Kick = new GT.Timer(5000, GT.Timer.BehaviorType.RunOnce);
            Kick.Tick += Kick_Tick;
            Kick.Start();
        }

        void Kick_Tick(GT.Timer timer)
        {
            Debug.Print("Attempt to Join");
            try
            {
                wifiRS21.NetworkInterface.Join(SSID, PASSWORD);
            }
            catch (Exception ex)
            {
                Debug.Print("Exception : " + ex.Message);
            }
        }

        private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            Debug.Print("Network Availability : " + e.IsAvailable.ToString());
        }

        private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
        {
            Debug.Print("Address : " + wifiRS21.NetworkInterface.IPAddress);
        }
    }
}


Hi,

As expected the application never makes it to the “ProgramStarted” method as the module is failing to initialize.

The code is now hanging here (exactly the same problem as the original post just now in a different place)

private void InitializeModules() {
            this.wifiRS21 = new GTM.GHIElectronics.WiFiRS21(6);
            this.usbClientDP = new GTM.GHIElectronics.USBClientDP(1);
}

Does this mean that the module is faulty. It seems to be hanging on something to do with trying to get the module MAC address.

Any ideas ?
A replacement module maybe ?

I would like to point out the the modules green light does turn on when this.wifiRS21 = new GTM.GHIElectronics.WiFiRS21(6); is called but the method never returns.

Seems like the same problem is reported here https://www.ghielectronics.com/community/forum/topic?id=17595

If you have the right socket and the right main board then the module or main board is damaged.

It sounds like the module has failed. I had an older V1.1 that did a similar thing but at least threw an exception.

This one is a 1.2 and not all that old.

Is a replacement possible ?

I have just ordered a jd11 to keep the project alive. Feel free to sneek a new WiFi module into the parcel!!

Let me know what I can do please.

It maybe the main board. Let us know of the enc work first please.

Enc ??

I thought you ordered that. Never mind, my mistake.

Please contact GHI directly for a replacement.