Can't enable wifi rs21

Hello,

Just received the wifi module, but i can’t even enable it.
I tried this (from the wifi sample code found on this forum) :


                try
                {
                    WiFi.Enable(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, SPI.SPI_module.SPI2, (Cpu.Pin)10, (Cpu.Pin)18, (Cpu.Pin)20);// FEZ Spider Socket 6
                }
                catch (WiFi.HardwareException e)
                {

                    if (e.errorCode == WiFi.HardwareException.ErrorCode.CommunicationTimeout || e.errorCode == WiFi.HardwareException.ErrorCode.FirmwareVersionMismatch)
                    {
                        WiFi.UpdateFirmware(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, SPI.SPI_module.SPI2, (Cpu.Pin)10, (Cpu.Pin)18, (Cpu.Pin)20);// FEZ Spider Socket 6
                        WiFi.Enable(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, SPI.SPI_module.SPI2, (Cpu.Pin)10, (Cpu.Pin)18, (Cpu.Pin)20);// FEZ Spider Socket 6
                    }
                    else if (e.errorCode == WiFi.HardwareException.ErrorCode.CommunicationFailure)
                    {
                        Debug.Print("Check WiFi module hardware connections and SPI/signals configurations");
                        Thread.Sleep(Timeout.Infinite);
                    }
                }

I tried with different cables, it always ends on CommunicationFailure.

Does anybody know the pin numbers to try on socket 9 ?

Regards

Please see this http://tinyclr.com/forum/21/4373/

Thanks for the hint, Gus, but I’ve already read it and this [url]http://tinyclr.com/forum/21/4372/[/url] too.
The part of code I posted is a copy/paste from the documentation in the GHIElectronics.NETMF.Net WiFi class.

The VS solution is based on the micro framework console application template, not the gadgeteer one.
I only have the display and the WiFi module attached, and all I get when I enable the WIFI is a WiFi.HardwareException.ErrorCode.CommunicationFailure with
[italic]
#### Exception System.Exception - 0xffffffff (1) ####
#### Message:
#### GHIElectronics.NETMF.Net.RS21Driver::SetBootloadOption [IP: 0000] ####
#### GHIElectronics.NETMF.Net.WiFi::Enable [IP: 0037] ####
#### WiFiTest.Program::Main [IP: 001d] ####
#### Exception GHIElectronics.NETMF.Net.WiFi+HardwareException - 0x00000000 (1) ####
#### Message:
#### GHIElectronics.NETMF.Net.WiFi::Enable [IP: 003e] ####
#### WiFiTest.Program::Main [IP: 001d] ####
Une exception de première chance de type ‘GHIElectronics.NETMF.Net.WiFi.HardwareException’ s’est produite dans GHIElectronics.NETMF.Net.dll[/italic]

I would like to try the module on socket 9, but I don’t know how to find the cpu pin numbers…

Regards,

Steph,

I suggest that give it couple more days. :wink: We are working a patch for WiFi RS21 module gadgeteer library.

Found the pin numbers for socket 9 in the Fez mainboard source code (correct me if I’m wrong) :
Here is the test code :


 #define SOCKET_9

using System.Net;
using System.Net.Sockets;
using System.Threading;
using GHIElectronics.NETMF.Net;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Net.NetworkInformation;

namespace WiFiTest
{
    public class Program
    {
        public static void Main()
        {
            SPI.SPI_module spiModule;
            Cpu.Pin extInt;     // linked to pin 3 on sockets 'S' 
            Cpu.Pin reset;      // linked to pin 4 on sockets 'S' 
            Cpu.Pin cs;         // linked to pin 6 on sockets 'S' 

 #if SOCKET_6
            spiModule = SPI.SPI_module.SPI2;
            extInt = (Cpu.Pin)18;
            reset = (Cpu.Pin)20;
            cs = (Cpu.Pin)10;
 #elif SOCKET_9
            spiModule = SPI.SPI_module.SPI1;
            extInt = (Cpu.Pin)46;
            reset = (Cpu.Pin)6;
            cs = (Cpu.Pin)15;
 #endif

            //NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);
            while (true)
            {
                try
                {
                    WiFi.Enable(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, spiModule, cs, extInt, reset);
                }
                catch (WiFi.HardwareException e)
                {
                    if (e.errorCode == WiFi.HardwareException.ErrorCode.CommunicationTimeout || e.errorCode == WiFi.HardwareException.ErrorCode.FirmwareVersionMismatch)
                    {
                        WiFi.UpdateFirmware(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, spiModule, cs, extInt, reset);
                        WiFi.Enable(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, spiModule, cs, extInt, reset);
                    }
                    else if (e.errorCode == WiFi.HardwareException.ErrorCode.CommunicationFailure)
                    {
                        Debug.Print("Check WiFi module hardware connections and SPI/signals configurations");
                        Thread.Sleep(Timeout.Infinite);
                    }
                }

                // ...

                Thread.Sleep(Timeout.Infinite);
            }
        }
    }
}

but I still can’t even enable the module :frowning:
Any idea ?

Do you get an exception when you enable the module?

I get a WiFi.HardwareException with errorcode 0 (CommunicationFailure).
The detail is in my first reply.

Is there anything I can check on the module test points ?

This exception means that you probably have wrong pin configurations.
Let’s wait a bit more to get the WiFi R21 patch out. :wink: The guys over here are working on it

I’ve also been playing with the WiFi RS21 and I can attest to its behavioral inconsistency.

Based on what I found in [url]http://www.ghielectronics.com/downloads/Gadgeteer/Mainboard/FEZ%20Spider.pdf[/url] and my own , your pin assignments are correct. I had to sort out the same question and I modified the WiFi SDK example as:


WiFi.Enable(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, SPI.SPI_module.SPI1, (Cpu.Pin)15, (Cpu.Pin)46, (Cpu.Pin)06);// FEZ Spider Socket 9
WiFi.UpdateFirmware(WiFi.HardwareModule.RS9110_N_11_21_1_Compatible, SPI.SPI_module.SPI1, (Cpu.Pin)15, (Cpu.Pin)46, (Cpu.Pin)06);// FEZ Spider Socket 9

I can get it to initialize (most times) and it will scan (most times), but connecting to my WAP is a hit-or-miss (mostly miss) proposition.

More often than not, a connect simply fails with no error, but sometimes it hangs.

Looking forward to the patch (need a beta tester?)!

Thanks for the support !
I was afraid the code was good… Seeing messages on the forum, it seems that there are still problems with the wifi module, but mine never initializes. Haven’t seen anybody complaining about that. Are there many wifi users ?
I hope a patch will arrive soon, maybe with more debug messages when something goes wrong.
I’m ready to beta test too, if it may help.

A wholee SDK is coming soon. :wink:

I just got my RS21 today, and I am also getting an error:

Using mainboard GHIElectronics-FEZSpider version 1.0
 Version Number is 4.3.0
    #### Exception GHIElectronics.NETMF.Net.WiFi+HardwareException - 0x00000000 (1) ####
    #### Message: 
    #### GHIElectronics.NETMF.Net.WiFi::Enable [IP: 008d] ####
    #### Gadgeteer.Modules.GHIElectronics.WiFi_RS21::.ctor [IP: 0064] ####
    #### WiFiTest.Program::InitializeModules [IP: 000f] ####
    #### WiFiTest.Program::Main [IP: 0010] ####
A first chance exception of type 'GHIElectronics.NETMF.Net.WiFi.HardwareException' occurred in GHIElectronics.NETMF.Net.dll
    #### Exception System.ApplicationException - 0x00000000 (1) ####
    #### Message: Unable to enable WiFi module.
    #### Gadgeteer.Modules.GHIElectronics.WiFi_RS21::.ctor [IP: 006e] ####
    #### WiFiTest.Program::InitializeModules [IP: 000f] ####
    #### WiFiTest.Program::Main [IP: 0010] ####
A first chance exception of type 'System.ApplicationException' occurred in GTM.GHIElectronics.WiFi_RS21.dll
An unhandled exception of type 'System.ApplicationException' occurred in GTM.GHIElectronics.WiFi_RS21.dll

Additional information: Unable to enable WiFi module.

 Uncaught exception 
The thread '<No Name>' (0x1) has exited with code 0 (0x0).

Has the new SDK been released yet? Where can I find it?

Thanks!

It will be out next week

Welcome to the community.

Thanks!

I was able to load the firmware onto the Wifi module, but I am now unable to enable DHCP.

Has the SDK been released yet?

No not yet. RedPine is going to release a new firmware for the WiFi module RS21 shortly so this will take couple more days to integrate. I think it worth the waiting with better performance and additional features like Ad-Hoc with WEP security. :wink:

:hand:

Beta tester available!

Hi,

I tried the new SDK with the new WiFi sample code, I have another problem now :
The program stops immediately with the following error :

Link failure: some assembly references cannot be resolved!!

Assembly: WiFi (1.0.0.0) needs assembly ‘GHIElectronics.NETMF.Net’ (4.1.8.0)

Error: a3000000

I have already cleaned the solution, removed and added the GHIElectronics assemblies references.
The GHIElectronics.NETMF.Net and …System are both present with the version 4.1.8.0. The corresponding DLLs are in the solution bin directory with the correct version number too.

I also tried a whole new gagdeteer test solution with only the fez board and the WiFi module, it ends the same references problem.

Any help would be greatly appreciated !

Create a new .NET Gadgeteer project and use this example:
[url]http://code.tinyclr.com/project/424/wifi-rs21-module-example-with-fez-spider/[/url]

Do not forget to update the FEZ Spider’s firmware. FEZ SPider updater application takes you through the steps on how to do that.

Thanks Joe,

While looking at the debugger output, I found the following :
[italic]Invalid native checksum: GHIElectronics.NETMF.Net 0xB7F1767D!=0x310788CC[/italic]
I think it’s due to mismatching firmware, but I can’t update it for the moment (drivers problem, [url]http://www.tinyclr.com/forum/21/5508/[/url])
I’ll retry when the firmware will be up to date.

Yes firmware problem.