WiFi rs21 problem

I’ve been using my WiFI modeule with a spider II for about a week for development. I have been opening sockets, sending data, no probs, until last night. :’(

Suddenly, the wifi module’s class is not returning from the constructor during initialization. Took me a while to narrow it down to that module, but the program loads if I un-wire it in the diagram (or remove it from the project entirely).

Does this mean my wifi module died, or is there some way I can reset/reflash it?

this is the call that never returns now:

@ jasells - Which of our SDKs are you using?

The Gadgeteer SDK. v. 4.3.7.10 according the properties in the VS project.

Dev System OS: Win 8.1
VS 2013 Ultimate - Update 5.

here’s where you will need to install the pre-release SDK. There were some wifi related changes that you might need. From Step 4 of .NET Micro Framework – GHI Electronics, grab the GHI Electronics NETMF SDK 2016 R1 Pre-Release 2 SDK.

@ jasells - @ Brett is right, the latest pre-release contains some changes to Wi-Fi that can help you recover from some problems with it. Specifically, after you run the constructor but before you call Open, call UpdateFirmware once to reflash the Wi-Fi module. You’ll need to do that in a Micro Framework Console App, not Gadgeteer. https://www.ghielectronics.com/docs/30/networking#3121 has a simple example.

@ John, So I copied that example and added the UpdateFirmware method call.


Debug.Print(Resources.GetString( Resources.StringResources.String1));

netif = new WiFiRS9110(SPI.SPI_module.SPI1, Cpu.Pin.GPIO_Pin1, Cpu.Pin.GPIO_Pin2, Cpu.Pin.GPIO_Pin3);
netif.UpdateFirmware();
netif.Open();
netif.EnableDhcp();
netif.EnableDynamicDns();

Which genereates this exception @ UpdateFirmware() call :wall: :

Program Started
#### Exception GHI.Networking.WiFiRS9110+HardwareFailureException - 0x00000000 (1) ####
#### Message:
#### GHI.Networking.WiFiRS9110::ThrowFailure [IP: 0007] ####
#### GHI.Networking.WiFiRS9110::UpdateFirmware [IP: 0031] ####

Am I setting the right pins for a FEZ Spider II? I tried to find some info on what pins to map, but… not sure where to find that info. Hopefully, my module isn’t dead. :frowning:

Where do you have this all connected?

You’re better off using GHI.Pins rather than CPU.Pin

@ jasells - Hi, These are the correct arguments for the constructor (Spider II, Socket 6):


 netif = new GHI.Networking.WiFiRS9110(GHI.Pins.FEZSpiderII.Socket6.SpiModule, GHI.Pins.FEZSpiderII.Socket6.Pin6,GHI.Pins.FEZSpiderII.Socket6.Pin3, GHI.Pins.FEZSpiderII.Socket6.Pin4);

@ RoSchmi or anyone else,

Where can I find the pin mappings for future ref?

In the assembly GHI.Pins

:smiley:

BTW, that fixed me up! Thanks to all who helped! I’m glad to see an active and helpful community!

The final code to reflash the RS21 WiFi module from A Spider II:



netif = new WiFiRS9110(GHI.Pins.FEZSpiderII.Socket6.SpiModule, GHI.Pins.FEZSpiderII.Socket6.Pin6,GHI.Pins.FEZSpiderII.Socket6.Pin3, GHI.Pins.FEZSpiderII.Socket6.Pin4);
netif.UpdateFirmware();

It will take several seconds, so if you’re reading this at a later date, be patient.

For the record, is there anything I can do to avoid requiring this update procedure in the future?

@ Scardinale,

No I mean how would I know to use Pins 6,3, and 4? And how would I know to use them for the respective pins in the ctor (reset, chip select, etc).

Look at the schematic for the WiFiRS9110 module. It will show you how the socket pins are connected to the IC.

For instance, is the Chip Select pin is connected to Pin6 of the socket, then you would use GHI.Pins.FEZSpiderII.Socket6.Pin6 for the pin assignment in the module driver constructor. The same follows for the remaining required pins.

Oh, duh. I was looking @ the main board schematic… that’s why I’m a s/w guy… :wink:

Hi:
I am using a Raptor, VB, gadgeteer, 4.3.8.1. The RS21 is connected to socket 9.
At the beginning of my program, the first line of ProgramStarted is

            wifiRS21.NetworkInterface.Open()

The result is
#### Exception GHI.Networking.WiFiRS9110+HardwareFailureException - 0x00000000 (1) ####
#### Message:
#### GHI.Networking.WiFiRS9110::UpdateInternalMacAddress [IP: 001c] ####
#### GHI.Networking.WiFiRS9110::OnOpening [IP: 000a] ####
#### SpaController.SpaController.Program::ProgramStarted [IP: 0018] ####
A first chance exception of type ‘GHI.Networking.WiFiRS9110.HardwareFailureException’ occurred in GHI.Networking.dll

What are the particulars for solving this issue which it seems is in the firmware?

Thanks,
Rocky

Did you already use the module (the one you try to use, not in gerneral)? I experienced that new modules doesn’t work until you update the firmware once (but I only used the bare modules, not the Gadgeteers), maybe that helps. Just call

 once. Based on my experiences, the device has to be reset after updating the Wifi-firmware to get it working properly.

@ rockybooth - As @ glx said, try to call UpdateFirmware immediately after the WiFiRS21 constructor.

@ gix, @ John:
Thanks for your replies. If I make updatefirmware the first line of code executed, I get the same result:

Using mainboard GHI Electronics FEZ Raptor version 1.0
Program Started
#### Exception GHI.Networking.WiFiRS9110+HardwareFailureException - 0x00000000 (1) ####
#### Message:
#### GHI.Networking.WiFiRS9110::ThrowFailure [IP: 0007] ####
#### SpaController.SpaController.Program::ProgramStarted [IP: 0010] ####
A first chance exception of type ‘GHI.Networking.WiFiRS9110.HardwareFailureException’ occurred in GHI.Networking.dll

@ rockybooth - Can you start a new Micro Framework Console Application, not Gadgeteer, and just add the WiFi RS21 constructor and the call to UpdateFirmware?

@ John - could you save me some time and help me out with the references and socket definition I need to do plain netmf on this gadgeteer board?