Main Site Documentation

Can't enable wifi rs21


#1

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


#2

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


#3

Thanks for the hint, Gus, but I’ve already read it and this http://tinyclr.com/forum/21/4372/ 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,


#4

Steph,

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


#5

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 ?


#6

Do you get an exception when you enable the module?


#7

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 ?


#8

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


#9

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

Based on what I found in http://www.ghielectronics.com/downloads/Gadgeteer/Mainboard/FEZ%20Spider.pdf 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?)!


#10

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.


#11

A wholee SDK is coming soon. :wink:


#12

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!


#13

It will be out next week

Welcome to the community.


#14

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?


#15

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:


#16

:hand:

Beta tester available!


#17

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 !


#18

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

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


#19

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, http://www.tinyclr.com/forum/21/5508/)
I’ll retry when the firmware will be up to date.


#20

Yes firmware problem.