Hello,
I have a problem with connecting to internet with Wifi RS21 and Fez Spider board. On Spider, I have installed 4.2 firmware.
I found available networks, connect to password protected network, and get dynamic ip address (in my case 192.168.10.6). However, I cannot ping this address from my laptop, which is in same network. When I try to get response from web page, the socket server occures. Please help
The code and output messages:
void ConnectMe()
{
if (!wifi_RS21.Interface.IsOpen)
wifi_RS21.Interface.Open();
if (!wifi_RS21.Interface.NetworkInterface.IsDhcpEnabled)
wifi_RS21.Interface.NetworkInterface.EnableDhcp();
NetworkInterfaceExtension.AssignNetworkingStackTo(wifi_RS21.Interface);
wifi_RS21.Interface.WirelessConnectivityChanged += new WiFiRS9110.WirelessConnectivityChangedEventHandler(Interface_WirelessConnectivityChanged);
wifi_RS21.Interface.NetworkAddressChanged += new NetworkInterfaceExtension.NetworkAddressChangedEventHandler(Interface_NetworkAddressChanged);
wifi_RS21.NetworkDown += new GTM.Module.NetworkModule.NetworkEventHandler(wifi_RS21_NetworkDown);
wifi_RS21.NetworkUp += new GTM.Module.NetworkModule.NetworkEventHandler(wifi_RS21_NetworkUp);
WiFiNetworkInfo[] ScanResp = wifi_RS21.Interface.Scan("MyAP");
if (ScanResp != null && ScanResp.Length > 0)
wifi_RS21.Interface.Join(ScanResp[0], "MyPwd");
Debug.Print("Connected to network...");
Gadgeteer.Networking.HttpRequest wc = WebClient.GetFromWeb("http://www.google.com");
wc.ResponseReceived += new HttpRequest.ResponseHandler(wc_ResponseReceived);
Debug.Print("Waiting for response...");
}
void wifi_RS21_NetworkUp(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
{
Debug.Print("NetworkUp event!");
}
void wifi_RS21_NetworkDown(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
{
Debug.Print("NetworkDown event!");
}
void Interface_WirelessConnectivityChanged(object sender, WiFiRS9110.WirelessConnectivityEventArgs e)
{
Debug.Print("WirelessConnectivityChanged event!");
Debug.Print("IP Address : " + wifi_RS21.Interface.NetworkInterface.IPAddress);
}
void wc_ResponseReceived(HttpRequest sender, HttpResponse response)
{
Debug.Print("Response is received");
string text = response.Text;
}
void Interface_NetworkAddressChanged(object sender, EventArgs e)
{
Debug.Print("NetworkAddressChanged event!");
Debug.Print("IP Address : " + wifi_RS21.Interface.NetworkInterface.IPAddress);
}
And messages:
Using mainboard GHI Electronics FEZSpider version 1.0
RS9110 firmware version Number is 4.4.5
RS9110 driver version Number is 4.4.5
NetworkDown event!
WirelessConnectivityChanged event!
IP Address : 0.0.0.0
Connected to networkâŚ
Waiting for responseâŚ
NetworkAddressChanged event!
IP Address : 192.168.10.6
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (9) ####
#### Message:
#### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] ####
#### System.Net.Dns::GetHostEntry [IP: 0008] ####
#### System.Net.HttpWebRequest::EstablishConnection [IP: 00e1] ####
#### System.Net.HttpWebRequest::SubmitRequest [IP: 0019] ####
#### System.Net.HttpWebRequest::GetResponse [IP: 000c] ####
#### Gadgeteer.Networking.HttpRequest::HandleRequestSync [IP: 01a9] ####
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
A first chance exception of type âSystem.Net.Sockets.SocketExceptionâ occurred in Microsoft.SPOT.Net.dll
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
#### Exception System.Net.WebException - 0x00000000 (9) ####
#### Message: host not available
#### System.Net.HttpWebRequest::EstablishConnection [IP: 00f1] ####
#### System.Net.HttpWebRequest::SubmitRequest [IP: 0019] ####
#### System.Net.HttpWebRequest::GetResponse [IP: 000c] ####
#### Gadgeteer.Networking.HttpRequest::HandleRequestSync [IP: 01a9] ####
A first chance exception of type âSystem.Net.WebExceptionâ occurred in System.Http.dll
#### Exception System.Net.WebException - 0x00000000 (9) ####
#### Message:
#### System.Net.HttpWebRequest::GetResponse [IP: 00d3] ####
#### Gadgeteer.Networking.HttpRequest::HandleRequestSync [IP: 01a9] ####
A first chance exception of type âSystem.Net.WebExceptionâ occurred in System.Http.dll
An exception occured while connecting to the Internet. Please, make sure that a valid URL is used and a network connection is up.