Snippet - WiFi: for Testing V4.2.9.0

WiFi: for Testing V4.2.9.0

This code is a combination of wifi code presented on the forum by several members and GHI staff over the past four months. I have presented similar versions but not within Codeshare. I have used this code to test EMX systems however it is easily modified for G120 systems.

An example of the output follows:

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: System (4.2.0.0) Attaching deployed file.

Assembly: GHI.Premium.Hardware.EMX (4.2.9.0) Attaching deployed file.

Assembly: GHI.Premium.Net (4.2.9.0) Attaching deployed file.

Assembly: GHIwifiDHCP429 (1.0.0.0) Attaching deployed file.

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

Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Resolving.

GC: 1msec 18624 bytes used, 7321044 bytes available

Type 0F (STRING ): 24 bytes

Type 15 (FREEBLOCK ): 7321044 bytes

Type 17 (ASSEMBLY ): 14484 bytes

Type 1E (BINARY_BLOB_HEAD ): 4044 bytes

Type 34 (APPDOMAIN_HEAD ): 72 bytes

GC: performing heap compaction…

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Security.PKCS11.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.Security.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Net.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\GHI Electronics\GHI Premium NETMF v4.2 SDK\Assemblies\le\GHI.Premium.Hardware.EMX.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\GHI Electronics\GHI Premium NETMF v4.2 SDK\Assemblies\le\GHI.Premium.Net.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Programming\Projects\GHIwifiDHCP429\GHIwifiDHCP429\bin\Debug\le\GHIwifiDHCP429.exe’, Symbols loaded.
The thread ‘’ (0x2) has exited with code 0 (0x0).
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
Wireless is: Connected
SSID: KGNETGEAR
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: 64:70:02:40:69:3A
RSSI: -50dB
Wireless Security Mode: WPA2
Network address changed!
DHCP is: Enabled
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:8.8.8.8
DNS Server 1:8.8.4.4

Network settings for: Count1 = 1 Count2 = 1
IP Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Getway: 192.168.1.1
DNS Server: 8.8.8.8
DNS Server: 8.8.4.4

Testing access to Internet and DNS:
www.ghielectronics.com: 207.58.176.212

Disconnecting WiFi link.
Wireless is: Disconnected
Network address changed!
DHCP is: Enabled
No IP Address allocated!

Wireless is: Connected
SSID: KGNETGEAR
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: 64:70:02:40:69:3A
RSSI: -48dB
Wireless Security Mode: WPA2
Network address changed!
DHCP is: Enabled
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:8.8.8.8
DNS Server 1:8.8.4.4

Network settings for: Count1 = 1 Count2 = 2
IP Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Getway: 192.168.1.1
DNS Server: 8.8.8.8
DNS Server: 8.8.4.4

Testing access to Internet and DNS:
www.ghielectronics.com: 207.58.176.212

Disconnecting WiFi link.
Wireless is: Disconnected
Network address changed!
DHCP is: Enabled
No IP Address allocated!

Wireless is: Connected
SSID: KGNETGEAR
WiFi Channel number: 11
Wireless Network Type: Access Point
MAC Address: 64:70:02:40:69:3A
RSSI: -50dB
Wireless Security Mode: WPA2
Network address changed!
DHCP is: Enabled
Is DynamicDnsEnabled enabled: False
NetworkInterfaceType 71
Network settings:
IP Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
Number of DNS servers:2
DNS Server 0:8.8.8.8
DNS Server 1:8.8.4.4

Network settings for: Count1 = 1 Count2 = 3
IP Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Getway: 192.168.1.1
DNS Server: 8.8.8.8
DNS Server: 8.8.4.4

Testing access to Internet and DNS:
www.ghielectronics.com: 207.58.176.212

Disconnecting WiFi link.
Wireless is: Disconnected
Network address changed!
DHCP is: Enabled
No IP Address allocated!

Closing WiFi interface
The thread ‘’ (0x3) has exited with code 0 (0x0).
The thread ‘’ (0x1) has exited with code 0 (0x0).
Done.
The program ‘[19] Micro Framework application: Managed’ has exited with code 0 (0x0).

KG1

Minor problem (Could be me?)

Def for int count1 = 0; ??

Debug.Print("Network settings for: Count1 = " + (count1 + 1).ToString() + " Count2 = " + (count2 + 1).ToString());

@ willgeorgeMaster

Yes, I also see this problem.

@ willgeorge: Yes I originally had two loops. Count1 covered a loop around Close() which is a severe test and not easy to restart the loop within the current framework provided by GHI. I will not edit the present code (seems quite major to revise code). The additional loop worked ok in version 4.2.7 but I had a different aproach at the beginning of the code. Thank you for your comment.