That's strange, could you please upload (a part of) your project so I can see what's going on?
using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; using Toolbox.NETMF; using Toolbox.NETMF.NET; using Toolbox.NETMF.Hardware; namespace NetduinoApplication1 { public class wifi { public static void Main() { // write your code here Debug.Print("Starting wifi config..."); WiFlyGSX WifiModule = new WiFlyGSX(); Debug.Print("Instace created..."); WifiModule.EnableDHCP(); WifiModule.JoinNetwork("TEHS_4B6B22", 0 , WiFlyGSX.AuthMode.MixedWPA1_WPA2, "12121212121"); //// Showing some interesting output Debug.Print("Local IP: " + WifiModule.LocalIP); Debug.Print("MAC address: " + WifiModule.MacAddress); Debug.Print("Dns Lookup google.com.au: " + WifiModule.DnsLookup("google.com.au")); // Creates a socket SimpleSocket Socket = new WiFlySocket("google.com.au", 80, WifiModule); // Connects to the socket Socket.Connect(); // Does a plain HTTP request Socket.Send("GET / HTTP/1.1\r\n"); Socket.Send("Host: " + Socket.Hostname + "\r\n"); Socket.Send("Connection: Close\r\n"); Socket.Send("\r\n"); // Prints all received data to the debug window, until the connection is terminated and there's no data left anymore while (Socket.IsConnected || Socket.BytesAvailable > 0) { string Text = Socket.Receive(); if (Text != "") Debug.Print(Text); } // Closes down the socket Socket.Close(); } } }
One thing is funny if I disconnect and reconnect the output works. The second time i run the code it errors out when it tries to create the socket