Main Site Documentation

NETMF-WiFi : unable to connect


#1

I have been trying to make WiFi work in my office environment but having some trouble

MFDeploy log:

Set MAC addr …
mac = 00:1E:C0:02:27:71
Mac address Set
Set regional domain …
region = fcc
Set security …
setting WEP key …
security key set
Scan … for ssid "DCIWIRELESS1 "
[0] bssid = 6C:50:4D:3E:EC:B0
strength = ###…

    indicator = 148

    ssid = DCIWIRELESS1

    channel = 9

AP selected = [0] 

Join …
succeeded
Authenticate …
succeeded
Associate …
failed
proceed to disconnect …
Disconnect starting …
succeeded
Disconnect complete … (1/3)

Following code gives “An unhandled exception of type ‘System.ArgumentOutOfRangeException’ occurred in Microsoft.SPOT.Net.dll” while executing SaveConfiguration function call.



WiFi.Enable(SPI.SPI_module.SPI2, ChipworkX.Pin.PC9, ChipworkX.Pin.PA19);
// WiFi settings
NetworkInterface[] netif = NetworkInterface.GetAllNetworkInterfaces();
Wireless80211 WiFiSettings = null;
for (int index = 0; index < netif.Length; ++index)
{
if (netif[index] is Wireless80211)
{
WiFiSettings = (Wireless80211)netif[index];

            }
        }

          WiFiSettings.Ssid = "DCIWIRELESS1";
            //WiFiSettings.PassPhrase = "";                
            WiFiSettings.Authentication = Wireless80211.AuthenticationType.None;
            WiFiSettings.Encryption = Wireless80211.EncryptionType.WEP;
            WiFiSettings.NetworkKey = new byte[] {0x5B, 0xC2, 0x5C, 0x20, 0x0D, 0xD4, 0xE3, 0x6E, 0x8C, 0xB7, 0x22, 0xA4, 0x36 };

            Wireless80211.SaveConfiguration(new Wireless80211[] { WiFiSettings }, false);

Any clues??

Thanks
Venkat.


#2

You are correct. We found a bug in Wireless80211.SaveConfiguration().
This will be reported to Microsoft NETMF team.

For now to work around this bug add ,0x00,0x00,0x00 to Key array

WiFiSettings.NetworkKey = new byte[] { 0x5B, 0xC2, 0x5C, 0x20, 0x0D, 0xD4, 0xE3, 0x6E, 0x8C, 0xB7, 0x22, 0xA4, 0x36,0x00,0x00,0x00 };

#3

Thanks Joe. Your workaround does allow me to stop the code from throwing exception.
Still I have trouble connecting to WiFi router in our office. It is always failing with message “Associating failed” disconnecting…

I thought of trying something different. I have created Ad-hoc wireless network on my PC and tried to connect from the NetMF-WiFi using MFDeploy as well as from code. MFDeploy log says “No network found…” error.

I was able to connect from my Palm PDA to the same adhoc network fine.

I don’t know what to try next.

By the way I was able to connect NetMF-WiFi at my home using MFDeploy.

Any thoughts and ideas are highly appreciated.


#4

I am pretty sure that the issues are related to router configuration of accepting 2.4GHz/802.11b devices.
I have tried with some other old router in my office, I was able to acquire IP address with NetMF-WiFi.
The new router is Cisco Air - AP1262N-A and the old router is Cisco Air - AP1242A-G.
I will leave the issue to our Network Administrators to figure out the solution.

Thanks
Venkat.


#5

Ad-hoc is not yet supported.

Do all the routers have the same encryption settings?

Can you try to disable encryption on this specific router and try again?


#6

Yes. All the routers have same encryption. Our admins are replacing old routers with newer ones. So far they have covered one part of the building.

I did indeed tried with one of the new routers with encryption disabled with no apparent luck.

I was under the impression that Ad-hoc is kind of implicit with WiFi. I glad that you have mentioned this otherwise I might be wasting some more time on this.