WiFi RS21 stopped working

Wifi rs21 stopped working ones again… Just hang all system on ProgramStarted and isn’t shown up in wifi search.
Does anybody know how to force UpdateFirmware() for apgrade.

This code doesnt work:

void ProgramStarted()



This is not the first time rs21 behaves like this, the last time i didn’t even understand how it started to upgrade and liven up.

Alex, this isn’t the first time you’ve posted this. Multi-posting doesn’t get help quicker I’m afraid. GHI are still in the middle of Sunday so will be a while before they’re online and able to comment.

Brett, i deleted my previous post (it wasn’t consistent as i think) and reposted a new one. Waiting forward for GHI comments…

@ Alex Bilityuk - Is your problem UpdateFirmware not returning?

1 Like

@ John -
Glad to hear from you guru… UpdateFirmware is not returning (it just do nothing) if i put the break point on UpdateFirmware and ican’t even reach it during debug and when wifi is connected to Raptor my project doesnt work, doesn’t even reach ProgramStarted code. I had the same problem two days before. And i solved it this way: I reinstalled the firmware, bootloader and was trying to load the project assemblies to the mainboard about 5 times, and on the 5-th or 6-th try i’ve got a WIFI Hardware exception and WIFI RS21 start to upgrade by itself without even UpdateFirmware() method in my code and after upgrade procedure was completed module started to shown in wifi search and my project continued to work as expected…

Now i want to know is there any way to reboot wifi module or force upgrading procedure. I am sure that after upgrading procedure it will start to work as expected.

@ Alex Bilityuk - There is no way to reboot it and the only way to force an update is to call UpdateFirmware. The module won’t be available during the update process, which can take a few minutes. You can always try to create the interface outside of Gadgeteer so you have more control over the calls to the object.

Can you explain please what do you mean about interface outside of Gadgeteer? and how it can help to solve my problem? Code sample would be perfect…

@ Alex Bilityuk - By outside of Gadgeteer, I mean use the GHI.Networking.WiFiRS21 object directly: https://www.ghielectronics.com/docs/30/networking#3121. Make sure to update the pins to the socket you are using.

@ John -
Wich pins should i use if set the module to X1 socket on Raptor?

Ok. found it on the codeshare. I hope this one is right pins for X1 socket on Raptor:

WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)37, (Cpu.Pin)32, (Cpu.Pin)7, 24000);

Will try to run Update process outside of the Gadgeteer and let you know

@ Alex Bilityuk - Those are correct.

The same behavior outside of the gadgeteer. Code just doesn’t execute. Can’t even reach the Program Started debug print line of code.

void ProgramStarted()
  Debug.Print ("Program Started");
  GHI.Networking.WiFiRS9110 wifiRS21 = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)37, (Cpu.Pin)32, (Cpu.Pin)7, 24000);


Only have this warning shown up in debugger:

WARN: Total initialization time exceeds 10 seconds.
: ProgramStarted is blocking execution, which means events and timers will not run properly.
: Make sure not to use blocking code such as while(true) - use a GT.Timer instead.

Any suggestions?

@ Alex Bilityuk - Perform the test in a Micro Framework Console Application, not Gadgeteer.

@ John -
All the same… code doesn’t execute… doesn’t reach the Main() function…

I rewrote the code this way and set the breakpoint to wifiinit method. I can see GHI.Networkin.WiFiRS9110.RecoverFromHardwareException when debugger hits the netif = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)37, (Cpu.Pin)32, (Cpu.Pin)7, 24000); code.

private static WiFiRS9110 netif;
private static void Main()

private static wifiinit()
netif = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)37, (Cpu.Pin)32, (Cpu.Pin)7, 24000);
Also tryed different cables and sockets…

@ Alex Bilityuk - How long do you let it sit for? Does it get stuck in the constructor or UpdateFirmware? Are there any lights illuminated on the board?

@ John -
I let it sit for 5 minutes. doesnt reach the netif.UpdateFirmware(); line. the following lights are active: red power light on the mainboard,
green light on the wifi. light are solid doesnt blink

It get stuck on this line: netif = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)37, (Cpu.Pin)32, (Cpu.Pin)7, 24000);

here is a complete debug output:

Reinstalled the firmware one more time, trying to initialize the module. but with no success…

Help me to liven up the wifi module please

@ Alex Bilityuk -
this worked for me

// This code updates the firmware of WiFiRS9110 on Raptor Socket 1

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Net;
using System.Threading;
using GHI.Usb;
using GHI.Usb.Client;
using GHI.Networking;
using Microsoft.SPOT.Hardware;

namespace WiFiRevival
    public class Program
        private static GHI.Networking.WiFiRS9110 netif;
        public static void Main()
            Debug.Print("Creating WiFiRS9110");
            //netif = new WiFiRS9110(SPI.SPI_module.SPI2, (Cpu.Pin)37, (Cpu.Pin)32, (Cpu.Pin)7, 24000);
            netif = new WiFiRS9110(Microsoft.SPOT.Hardware.SPI.SPI_module.SPI2, GHI.Pins.FEZRaptor.Socket1.Pin6
                , GHI.Pins.FEZRaptor.Socket1.Pin3, GHI.Pins.FEZRaptor.Socket1.Pin4, 24000);

            Debug.Print("IpAddress: " + netif.IPAddress
                                      + "\r\n" + "SubnetMask " + netif.SubnetMask);
            Debug.Print("Trying to update firmware!");                         
            Debug.Print("Finished to update firmware!"); 
            while (true) { }

RoSchmi, thank you for the code sample!!! It seems like you use the last SDK.

I still stay on v4.3.6 2014 R5 SDK and it doesn’t have GHI.Pins.FEZRaptor namespace. Due to this reason i slightly changed one line of your code to:

netif = new WiFiRS9110(Microsoft.SPOT.Hardware.SPI.SPI_module.SPI2, GHI.Pins.G400.PB5
                , GHI.Pins.G400.PB0, GHI.Pins.G400.PA7, 24000);

And still it doesn’t work for me. Debug outputs only: Creating WiFiRS9110 and just hangs on it. No exceptions is thrown.

Is there any changes of pin initialization in new SDK. Should i try your code in new SDK or it doesn’t matter?

@ Alex Bilityuk - I don’t know, and I have no time in the next hours to have a look.
Does the WiFi module have a means for an electrical factory reset?
Do you know where the source code of the WiFiRS9110 driver can be found?