Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Patrick

Member Since 11 Aug 2010
Offline Last Active Mar 22 2015 02:05 AM
-----

Topics I've Started

Running out of memory

14 October 2012 - 08:49 PM

This code seems to cause my N+ to run out of memory. There are no errors but I figure that it's running out of memory because it will insert 536 records every time and if I add a couple references to the project and increase the size of the payload, it will insert a few less records. Scientific huh? :P

Any ideas? Is it possible to do a POST using sockets instead?

int numTests = 1000;

            while (numTests > 0)
            {
                //write test data and show LED
                led.Write(true);
                Thread.Sleep(250);

                try
                {
                    string strNewValue;
                    //string strResponse;
                    req = (HttpWebRequest)WebRequest.Create("http://SERVERNAME.com/PATH/TestInsert.php?");
                    req.Method = "POST";
                    req.ContentType = "application/x-www-form-urlencoded";
                    req.KeepAlive = false;

                    // Set values for the request back                
                    strNewValue = "TestID=''&TestDesc=AWholeBunchOfTestDataDoesItMatterHowMuchWePass";
                    req.ContentLength = strNewValue.Length;

                    // Write the request
                    stOut = new StreamWriter(req.GetRequestStream());
                    stOut.Write(strNewValue);
                    stOut.Dispose();
                    stOut.Close();

                    req.Dispose();
                }
                catch (Exception ex)
                {
                    Debug.Print(ex.Message.ToString());
                }

                //hide LED
                led.Write(false);
                Thread.Sleep(250);

                numTests--;
            }

            Debug.Print("Test complete");

Ethernet Broken?

18 September 2012 - 01:47 PM

I've spent quite a bit of time trying to get my Netduino Plus to reliably post data to a web server and I think its time to poll the brains in the community as I've tried on 4.1 and 4.2 and am seemingly out of options. Some background: http://forums.netdui...dpost__p__34958 Initially, I wrote the most basic of examples using the HTTPRequest class, then thought that I was missing something silly, so I move to Stephan's toolbox and used his Web_Client but the results are the same. So I'm thinking the bug is in the firmware or maybe its a hardware issue. "Regardless of how long I sleep for (tested between 250 ms and 10000 ms) the application on the N+ becomes unresponsive (led stops blinking) but no exception is thrown and the debugger never disconnects. I also tried this without being attached to the debugger and got that same result." What is going on?

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.