Hello, I am trying to get networking to work on a Cobra III. I am following the example on the support site to no avail. I also tried the setup in a recent post using ports/pins as below. What am I missing? Are there certain pins/spi ports that need to be used?
‘Microsoft.SPOT.Debugger.CorDebug.14.dll’ (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\NETMF v4.3 SDK\Libraries\le\GHI.Pins.dll’
The thread ‘’ (0x2) has exited with code 0 (0x0).
#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
#### Microsoft.SPOT.Hardware.OutputPort::.ctor [IP: 0006] ####
#### GHI.Networking.WiFiRS9110::.ctor [IP: 00c0] ####
#### GHI.Networking.WiFiRS9110::.ctor [IP: 000e] ####
#### FEZWirelessTesting.Program::Main [IP: 0026] ####
Exception thrown: ‘System.ArgumentException’ in Microsoft.SPOT.Hardware.dll
SRCSRV: The module ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.dll’ does not contain source server information.
An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll
The program ‘[3] Micro Framework application: Managed’ has exited with code 0 (0x0).
private static WiFiRS9110 netif;
public static void Main()
{
NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged;
NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged;
//error on the next line
netif = new WiFiRS9110(G120E.SpiBus.Spi2, G120E.Gpio.P3_30, G120E.Gpio.P2_30, G120E.Gpio.P4_31);
netif.Open();
netif.EnableDhcp();
netif.EnableDynamicDns();
netif.Join("SSID", "Password");
while (netif.IPAddress == "0.0.0.0")
{
Debug.Print("Waiting for DHCP");
Thread.Sleep(250);
}
//The network is now ready to use.
}
@ jrowe88 - The Cobra III is based on the G120 while the example code you posted uses the G120E pin definitions. Which will throw the exception you see.
@ John - Ok; changed the pins and still no dice… different error now. Any suggestions?
//neither of these worked
netif = new WiFiRS9110(GHI.Pins.G120.SpiBus.Spi2, GHI.Pins.G120.P0_10, GHI.Pins.G120.P0_11, GHI.Pins.G120.P0_12);
netif = new WiFiRS9110(FEZCobraIII.SpiBus.Spi2, FEZCobraIII.Gpio.D10, FEZCobraIII.Gpio.D11, FEZCobraIII.Gpio.D12);
@ jrowe88 - Have you verified the connections to the module? Do you have another product you can try it with? Do you see any green lights illuminate on the board?
empty FEZCobra III - nothing plugged in except the micro USB
Tiny Booter: 4.3.7.7
Tiny CLR: 4.3.7.10
I don’t know if this helps or not, but using the “FEZ Config” app, I am able to Load and Apply WiFi config on the “Network Configuration” tab (Mac is disabled and shows 0-21-3-0-0-3).
I only have a Panda, but that doesn’t have wifi if I recall correctly.
@ mmonteagudo - I’d start with double checking all of the connections. If they’re good, the firmware can sometimes get corrupt on the Wi-Fi module. Using the latest SDK, call UpdateFirmware immediately after the constructor and before you call Open and then try again.
For me the code below runs fine (I have a G120TH btw.). I chose those pins, because the are all next to each other on the TH-board ;). Have you tried another SPI-port, because SPI2 is “not recommended”. How is your hardware-setup? With Gadgeteer-modules or something on a breadboard or something? My experience so far showed me, that the module requires a very stable power source and short wires (on breadboards it also doesn’t run fine) in order to run reliable.
netif = new WiFiRS9110(G120.SpiBus.Spi3, G120.Gpio.P0_2, G120.Gpio.P0_3, G120.Gpio.P0_25);
netif.Open();
netif.EnableDhcp();
netif.EnableDynamicDns();
netif.Join("AP_02", "WiFiPassword");
while (netif.IPAddress == "0.0.0.0")
{
//Debug.Print("Waiting for DHCP");
Thread.Sleep(500);
}