Cobra II Wifi DHCP issues

It looks like there is an issue connecting to a network using some of the wireless routers. If you have Cobra II Wifi and tried it please report what kind of router you have and the outcome of the test.

Here is a related thread:

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

The routers mentioned already:

Motorola SurfBoard (@ Skewworks) - WORKS
netgear n600 (@ ransomhall) - IP address of 0.0.0.0
D-Link DIR-655 (@ Architect) - IP address of 0.0.0.0

If you have a router that is already in the list, but your result is different please report.

I hope this information will help GHI to troubleshoot the issue faster and have a fix for it. Thank you.

Throwing in our routers to known working:

Cisco Linksys E4200: works
Cisco Linksys WRT54G: works
TP-Link WR841N: works
Netgear G54: works

Cisco E3000 - no work
Asus N66U - no work
iPad 3rd gen hotspot - no work

This needs to be fixed or at least the list of supported routers should be included in the product description.

We will be purchasing several of the non-working routers to investigate the issue.

This is great! Thank you!

@ Mike - Is your Cisco E3000 the E3000-RM flavor?

I will have to check it tonight. Recently I replaced it with an Asus router, so it
is in my computer graveyard.

It might be worth while to post a common test program for connecting to a
DHCP AP. I think everyone has a program that they have tweaked to try
to get it going.

My personal theory is there is something happening with the persistence
of network information on the device. But, I have no real evidence to support
this theory.

@ ransomhall - The Netgear N600 is a wide range model. I am seeing WNDR3400, WNDR3800 and DGND3700. Could you provide a more specific model number please?

@ James - If it will help, I can send you the CiscoE3000 router, the Cobra II and the program I was using to test Wifi DHCP. I was also having problems with a static IP address.

What if this is all related to not having the right MAC address?

What would be the right MAC address?

I agree. We should all try the same chunk of code before James buys a bunch of routers.

@ James - It’s one of the WNDRs. I’ll confirm which one until this evening.

I obtained a MAC address generated by an online site. other addresses from site work on spider.

why did I get a MAC address for spider? I am too lazy to unscrew spider from board to look at Mac label.

Here is the sample code we used to run the DHCP test, references are included at the top for your convenience, please do not copy this section into your code.

References
 #GHI Hardware
 #GHI Hardware G120
 #GHI Net
 #MS Spot Hardware
 #MS Spot Native
 #MS Spot Net
 #System

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Net;

using GHI.Premium.Net;
using GHI.Premium.Hardware;
using System.Net;

namespace Cobra_II_DHCP_Test
{
    public class Program
    {
        public static WiFiRS9110 wifi;

        public static void Main()
        {
            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();

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

            GHI.Premium.Net.NetworkInterfaceExtension.AssignNetworkingStackTo(wifi);

            WiFiNetworkInfo[] scanResults = wifi.Scan();

            int targetAP = 0;
            string passPhrase = "";

            wifi.Join(scanResults[targetAP], passPhrase);

            IPAddress ip = null;

            while (true)
            {
                ip = IPAddress.GetDefaultLocalAddress();
                if (ip != IPAddress.Any)
                    break;
            }

            Debug.Print(ip.ToString());

            System.Threading.Thread.Sleep(-1);
        }

        static void wifi_WirelessConnectivityChanged(object sender, WiFiRS9110.WirelessConnectivityEventArgs e)
        {
            Debug.Print("WiFi is: " + (e.IsConnected ? "connected" : "disconnected"));
        }

        static void wifi_NetworkAddressChanged(object sender, EventArgs e)
        {
            Debug.Print("Is DhCp enabled: " + wifi.NetworkInterface.IsDhcpEnabled);
            Debug.Print("Is DynamicDnsEnabled enabled: " + wifi.NetworkInterface.IsDynamicDnsEnabled);
            Debug.Print("NetworkInterfaceType " + wifi.NetworkInterface.NetworkInterfaceType);
            Debug.Print("Network settings:");
            Debug.Print("IP Address: " + wifi.NetworkInterface.IPAddress);
            Debug.Print("Subnet Mask: " + wifi.NetworkInterface.SubnetMask);
            Debug.Print("Default Gateway: " + wifi.NetworkInterface.GatewayAddress);
            Debug.Print("Number of DNS servers:" + wifi.NetworkInterface.DnsAddresses.Length);
            Debug.Print("------------------------------------------------------");
        }
    }
}

We just finished testing the Netgear N600 WNDR3400v2 with a successful DHCP lease. We are proceeding to the DLink DIR655.

@ James - Did you do anything special about MAC address?

I also would like to mention another issue. If your restart debugging session the following line throws unhandled exception:


GHI.Premium.Net.NetworkInterfaceExtension.AssignNetworkingStackTo(wifi);

@ skewworks had the same issue:
http://www.tinyclr.com/forum/topic?id=10433

Thanks!

We did nothing with the MAC Address. The AssignNetworkingStackTo() is fixed and will be available in the next release of the SDK.

Just want to make sure.
Thanks

@ James - I just realized that I have given you some bad info on my WiFi network configuration.

I originally told you that I was having problems with a Cisco E3000, Asus N66U and iPad 3rd generation…

Well, I had forgotten that the Cisco and Asus devicse are just being used as access points. I get my
Internet access through Verizon FIOS, and the interface to Verizon is an ActionTec MI424WR router.
This router acts a cable modem, firewall and wireless access point. Because the device that
Verizon provides does not support N class WiFi, I turn off the wireless on the ActionTec and
user another router as a wireless access point. Thus the use of the Cisco and Asus. But,
DHCP service is always provided by the ActionTec.

The Cobra II was able to associated with both the Cisco and Asus access points. The
issue is with the DHCP address. Therefore, any problem most likely resides with
the ActionTec DHCP server, not the Cisco or Asus routers/APs.

The iPad hotspot connects to Verizon via LTE, so this would be another issue.

Sorry for the misleading information.

@ Mike - We are charging your account with the cost of the access points we had to buy :slight_smile: