EMX Spider connecting netgear router

I have bought EMX spider with J11D Eth board and Wifi_RS21 board. I took a try to connect EMX with my Netgear router. The result is that I can make the connection with J11D, but I failed with Wifi_RS21, and the message I got from dll:
tc_ip_process: iface not open
the code that I use isquite standard:

            wifi.UseDHCP();
            string myAP = "NETGEAR";
            wifi.NetworkDown += new GTM.Module.NetworkModule.NetworkEventHandler(wifi_NetworkDown);
            wifi.NetworkUp += new GTM.Module.NetworkModule.NetworkEventHandler(wifi_NetworkUp);

            Debug.Print("Scan for wireless networks");
            try
            {
                WiFi_RS21.WiFiNetworkInfo[] scanResult = wifi.Scan(); 
                if (scanResult != null)
                {
                    foreach (WiFi_RS21.WiFiNetworkInfo x in scanResult)
                    {
                        Debug.Print(x.ToString());
                        Debug.Print("------------------------------------");
                    }
                }
                else
                {
                    Debug.Print("No wireless netowrks were found.");
                    AddLogMessage(txtf, "No wireless netowrks were found.");
                }
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
            }

            Debug.Print("Searching for: " + myAP);
            WiFi_RS21.WiFiNetworkInfo myBSS = null;
            try
            {
                myBSS = wifi.Search(myAP);
            }
            catch (Exception)
            { }            
            if (myBSS != null)
            {

                Debug.Print("Connecting to " + myAP);
                    wifi.Join(myBSS, "password"); // Network with WEP 64bit (10 hex digits).
                    Debug.Print("Connected");
                    AddLogMessage(txtf, "Wifi Connected");
            }
            else
            {
                Debug.Print(myAP + " Wireless network was not found");
                AddLogMessage(txtf,myAP + " Wireless network was not found");
            }

I really want to do what’s wrong with my code or any thing I missed.

Thanks

Hi HHGong, can you edit your above post (click the pencil icon on the upper right of that post), then highlight the code, and hit the 101010 icon (on the top, towards the left) and re-submit? This will format your code correctly.

Using code tags will make your post more readable. This can be done in two ways:[ol]
Click the “101010” icon and paste your code between the

 tags or...
Select the code within your post and click the "101010" icon.[/ol]
(Generated by QuickReply)

The top grey icon not the bottom orange one

@ hhgong - what version of MF are you using? 4.1 or 4.2?

WiFi is not yet available with 4.2.

I am using NetMF 4.1, I know that 4.2 not yet ready for Wifi_RS21

This issue has been solved. I just connected RS21 board to ChipworkX and used premium lib to initialize RS21, then took it back to EMX spider. It works well this time.