WiFi fails during Scan or Join

I have the following code:


        string ipAddress = "192.168.0.93";
        string nsk = "xxxxxxxx";

 
        void ProgramStarted()
        {
            try
            {
                wifi_RS21.Interface.Open();

                wifi_RS21.Interface.WirelessConnectivityChanged += new WiFiRS9110.WirelessConnectivityChangedEventHandler(Interface_WirelessConnectivityChanged);

                GHI.Premium.Net.NetworkInterfaceExtension.AssignNetworkingStackTo(wifi_RS21.Interface);

                WiFiNetworkInfo[] scanResults = wifi_RS21.Interface.Scan();
                WiFiNetworkInfo info = new WiFiNetworkInfo(scanResults[0]);
                wifi_RS21.Interface.NetworkInterface.EnableStaticIP(ipAddress, "255.255.255.0", "192.168.0.1");
                wifi_RS21.Interface.Join(info, nsk);


            }
            catch (Exception ex)
            {
                Debug.Print("ERRRRRRRRRRRR" + ex.Message);
            }
            Debug.Print("Program Started");
        }

During the execution of wifi_RS21.Interface.Scan(); I think it resets itself; if I’m lucky it will pass the scan and reset at the wifi_RS21.Interface.Join(info, nsk); and if I’m really lucky (and lately happens extremely rare) it just works.

One more thing: No error is thrown.

So, am I doing something wrong? If so, why does it sometimes work?

@ andre.m
The link from that topic goes to page that was moved and from there a link goes to this page
http://www.ghielectronics.com/docs/40/netmf-4.2-developer where the download link is missing :frowning:

@ andre.m - thank you.

I’ve installed the new version, but now nothing works; I’ve tried with a new empty project:

[em]
Found debugger!

Create TS.

Loading start at a0e00000, end a0e1383c

Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2
.0.0) Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.

Attaching deployed file.

Assembly: Microsoft.SPOT.IO (4.2.0.0) Attaching deployed file.

Assembly: Gadgeteer (2.42.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Attaching deployed file.

Assembly: System.Http (4.2.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Attaching deployed file.

Assembly: System (4.2.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Net.Security (4.2.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Attaching deployed file.

Assembly: GHI.Premium.Hardware (4.2.10.0) ***********************************************************************

  •                                                                 *
    
  • ERROR!!! Firmware version does not match managed code version!!! *

  •                                                                 *
    
  •                                                                 *
    
  • Invalid native checksum: GHI.Premium.Hardware 0xE9C5E572!=0x4814E574 *

  •                                                                 *
    

Attaching deployed file.

Assembly: GHI.Premium.System (4.2.10.0) ***********************************************************************

  •                                                                 *
    
  • ERROR!!! Firmware version does not match managed code version!!! *

  •                                                                 *
    
  •                                                                 *
    
  • Invalid native checksum: GHI.Premium.System 0x8AF38F5C!=0x1D6C0EC2 *

  •                                                                 *
    

Resolving.

Link failure: some assembly references cannot be resolved!!

Assembly: Gadgeteer (2.42.0.0) needs assembly ‘Microsoft.SPOT.TinyCore’ (4.2.0.0)

Assembly: Gadgeteer (2.42.0.0) needs assembly ‘Microsoft.SPOT.Net’ (4.2.0.0)

Assembly: Gadgeteer (2.42.0.0) needs assembly ‘System.IO’ (4.2.0.0)

Assembly: System.Http (4.2.0.0) needs assembly ‘System’ (4.2.0.0)

Assembly: System.Http (4.2.0.0) needs assembly ‘System.Net.Security’ (4.2.0.0)

Assembly: System (4.2.0.0) needs assembly ‘Microsoft.SPOT.Net’ (4.2.0.0)

Error: a3000000

Waiting for debug commands…

The program ‘[1] Micro Framework application: Managed’ has exited with code 0 (0x0).

[/em]

How do I change the firmware version to match managed code version?

@ allex4project

Can you use MFDeploy to tell us the firmware version that you are using?

@ Aron -

[em]
HalSystemInfo.halVersion: 4.2.0.0
HalSystemInfo.halVendorInfo: Microsoft Copyright © Microsoft Corporation. All rig
HalSystemInfo.oemCode: 255
HalSystemInfo.modelCode: 0
HalSystemInfo.skuCode: 65535
HalSystemInfo.moduleSerialNumber: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HalSystemInfo.systemSerialNumber: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ClrInfo.clrVersion: 4.2.0.0
ClrInfo.clrVendorInfo: Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion: 4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.7.0
SolutionReleaseInfo.solutionVendorInfo: Copyright © GHI Electronics, LLC
SoftwareVersion.BuildDate: Nov 29 2012
SoftwareVersion.CompilerVersion: 410462
FloatingPoint: True
SourceLevelDebugging: True
ThreadCreateEx: True
LCD.Width: 128
LCD.Height: 128
LCD.BitsPerPixel: 16
AppDomains: True
ExceptionFilters: True
IncrementalDeployment: True
SoftReboot: True
Profiling: False
ProfilingAllocations: False
ProfilingCalls: False
IsUnknown: False

[/em]

Is your VS project targeting 4.1, 4.2 or 4.3?

@ mhectorgato -

4.2; I have VS2010; 4.3 isn’t in the list.

@ allex4project

Your firmware needs to be updated. Please see this link for help to update your firmware: http://www.ghielectronics.com/community/forum/topic?id=11849