My script runs fine when I have my Netduino Plus plugged in and being debugged. But when I removed it from my computer and try to run the script independent of debugging, it stops running. I am using the board as a Web Client running on a continuous loop. I don't believe its code related but here is my code.
using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; namespace myProgram { public class Program { public static void Main() { WebCall webCall = new WebCall(); TimerCallback timerDelegate = new TimerCallback(webCall.GetResponse); AutoResetEvent autoEvent = new AutoResetEvent(false); Timer programLoop = new Timer(timerDelegate, autoEvent, 1000, 60000); while (programLoop != null) { } } } public class WebCall { OutputPort controlPort = new OutputPort(Pins.GPIO_PIN_D8, false); // produce request String requestUri = "http://www.mysite.com/somecall.php?ID=1"; public void GetResponse(Object stateInfo) { try { using (var request = (HttpWebRequest)WebRequest.Create(requestUri)) { request.Method = "GET"; // headers request.ContentType = "application/x-www-form-urlencoded"; try { using (var response = (HttpWebResponse)request.GetResponse()) { StreamReader reader = new StreamReader(response.GetResponseStream()); String returnString = reader.ReadToEnd(); if (returnString.Length > 0) { String[] array1 = returnString.Split(new Char[] { ',' }); for (int l = 0; l < array1.Length - 1; l++) { String[] array2 = array1[l].Split(new Char[] { '-' }); if (array2[1].Equals("0")) { controlPort.Write(false); } else { controlPort.Write(true); } } } } } catch (WebException ex) { Debug.Print(ex.Message); } } } catch (IOException ex) { Debug.Print(ex.Message); } } } }