Cobra II WiFi

Sorry if this is posted somewhere else, I did a search and couldn’t find it. Is there an example of using the WiFi on Cobra II? I can’t find the normal WiFi object.

WiFiRS9110 doesn’t have anything I can see as far as connecting to a network…

See this post from James:

http://www.tinyclr.com/forum/topic?id=9766&page=1#msg96971

Did you make it to work? I am having issues with that code. It finds my wireless network, it returns signal strength after join but IP of the device is 0.0.0.0

Router shows 0.0.0.0 for Cobra’s mac address.
So I made a reservation of an ip address that never expires. Pinging that IP reports it unreachable.

This worked for me straight off. Note there is still that bug with this where if you try and assign it a second time without a hard reboot you’re going to get an error.

 WiFiRS9110 wifi = new WiFiRS9110(SPI.SPI_module.SPI2, G120.Pin.P1_10, G120.Pin.P2_11, G120.Pin.P1_9);
            if (!wifi.IsOpen)
                wifi.Open();

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

            // Set this as the current interface
            NetworkInterfaceExtension.AssignNetworkingStackTo(wifi);

            // Subscribe to events
            wifi.WirelessConnectivityChanged += new WiFiRS9110.WirelessConnectivityChangedEventHandler(wifi_WirelessConnectivityChanged);
            wifi.NetworkAddressChanged += new NetworkInterfaceExtension.NetworkAddressChangedEventHandler(wifi_NetworkAddressChanged);

            // Scan for networks
            WiFiNetworkInfo[] ScanResp = wifi.Scan();

@ Skewworks - Yeah I have that error too. I have ended up doing this:


            if( wifi.IsActivated )
                wifi.Close();

just after the wifi object is created. There is another exception but it is handled in the driver. So no need to reboot the device and assigning goes smoothly.

Do you get a good IP after you join?

Yup I was able to setup a ShoutCast client on the Cobra II rather quickly

@ Skewworks - What kind of router do you have?

SImilar behavior (IP address of 0.0.0.0) seen with my Cobra2 with DHCP over WiFi, as well. I’ve got a netgear n600 router. Let me know if there’s anything I can try, or help to troubleshoot. Maybe deserves a new thread since this one is marked as solved?

1 Like

Motorola SurfBoard here

@ ransomhall - Good idea!

http://www.tinyclr.com/forum/topic?id=10446