I have been using a application for my Spider that communicates with my Android Tablet. In fact I just posted some code of this application yesterday.
(I think it was yesterday) Anyway, it was ‘really working’ … Honest it was!
But not now??? I have no Idea what happened and I have not been able to find the solution.
In fact I erased EVERYTHING related to .NET Micro from my computer (Including C# Express and SQL). I started over from scratch (What a pain!).
Reflashed the Spider firmware to the current 4.2 (Same as I had been using before)
Maybe somebody has an Idea… Sure hope so.
Partial code:
void StartWIFI()
{
wifi_RS21.Interface.Open();
WiFiRS9110.AssignNetworkingStackTo(wifi_RS21.Interface);
if (!wifi_RS21.Interface.NetworkInterface.IsDhcpEnabled)
wifi_RS21.Interface.NetworkInterface.EnableDhcp();
wifi_RS21.Interface.WirelessConnectivityChanged +=
new WiFiRS9110.WirelessConnectivityChangedEventHandler(Interface_WirelessConnectivityChanged);
wifi_RS21.Interface.NetworkAddressChanged +=
new WiFiRS9110.NetworkAddressChangedEventHandler(Interface_NetworkAddressChanged);
//
try
{
WiFiNetworkInfo[] ScanResp = wifi_RS21.Interface.Scan(ssid); //The Spider resets/reboots here
// ^ On the above statement the Debuggable .Net Micro Framework Device driver ^
// (GHI .NET Micro Framework USB Debugging Interface) disappears in the Device manager
//Use to Scan for all SSID's
//WiFiNetworkInfo[] ScanResp = wifi_RS21.Interface.Scan( );
if (ScanResp != null && ScanResp.Length > 0)
{
//Your passkey needed here
wifi_RS21.Interface.Join(ScanResp[0], PassKey);
if (useDebug) { Debug.Print("Connected to Wireless network - " + ssid); }
}
else
{
if (useDebug) { Debug.Print("Failed to connect to Wireless network - " + ssid); }
}
}
catch (Exception e)
{
Debug.Print("!!Exception : " + e.Message);
}
//
ipep = new IPEndPoint(IPAddress.Parse(ip), port);
AndroidSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
At the code statement
WiFiNetworkInfo[] ScanResp = wifi_RS21.Interface.Scan(ssid);
The Spider resets/reboots because the GHI .NET Micro Framework USB Debugging Interface disappears from the Device manager.
I am using Windows 7 64 Bit and have used the code many times without problems.