Wifi RS21 Throwing NetworkInterfaceExtensionException on Join

I am getting a “GHI.Premium.Net.NetworkInterfaceExtensionException” when I try to join my wifi network. Any ideas whats wrong here?


       public void Connect()
        {
            var networkName = configurationManager.GetSetting(ConfigSettings.WifiNetwork);
            var password = configurationManager.GetSetting(ConfigSettings.WifiPassword);

            if (!wifi.Interface.IsOpen)
                wifi.Interface.Open();
            var networks = wifi.Interface.Scan(networkName);
            if (networks == null || networks.Length < 1)
                throw new Exception("Could not find a WIFI network with name: " + networkName);
            var network = networks[0];
            wifi.Interface.Join(network, password);
        }

Trace:

You have to assign network stack to wifi

NetworkInterfaceExtension.AssignNetworkingStackTo(wifi);

…and maybe

 else if (!wifi.NetworkInterface.IsDhcpEnabled)
                    wifi.NetworkInterface.EnableDhcp();

…or use static ip?

@ tvinko I tried all your suggestions, but am still getting an error on Join. The error code is 7 (authentication failed). However, I am 100% sure i have the right password to connect to my WEP wifi network.

Also the authentication error is a little misleading because that is wrapping another error that occurred. (see attached image).

@ Paul F. - Did you check (Debug.print) the networks[] array. Perhaps there are more than one networks with the same name in your area and you try to join a false one?
Roland

@ RoSchmi, yep I’m sure I have the right network, there is only one with the name I’m using.

Also, I have tried every combination of WEP 64 key / String/Hex password and WEP 128 key / String/Hex password - just keep getting error 7 (authentication failed).

I have also tried the “UpdateFirmware” method a couple times, but that fails with an exception every time, so that’s not working either.

I’m not sure what else to try, have been working on this for hours now.

I guess I could try a static IP, but need to figure out what the network card’s MAC address is - anyone know how to do that?

Update, I was actually able to successfully “Join” after changing my wireless router to use WPA for wireless security, instead of WEP.

My router is a D-Link (DI-624)

I know it has been a long time since this post, but I’ve had the same problem with the WEP key and solved it.

In my case the problem was that my access point is configured for a 13 digits WEP ASCII key but it looks as an hexadecimal one >:).

I was writting the 13 digits in the password parameter with no success:

   wifi_RS21.Interface.Join(info[0], "C0030....");  <-- wrong

As it is an ASCII password key, you must write the HEX code of each ASCII char as an string:

   wifi_RS21.Interface.Join(info[0], "4330303330...");   <-- Correct

The ASCII code for the “C” is 0x43, for the “0” is 0x30, and so on…

Hope this can help somebody.

1 Like