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.

CarTech's Content

There have been 9 items by CarTech (Search limited from 26-April 23)


By content type

See this member's

Sort by                Order  

#27246 SD Card Issues.

Posted by CarTech on 14 April 2012 - 03:41 PM in Netduino 2 (and Netduino 1)

I'm using 4.2 RC4 and I can't get the sparkfun 1GB card to work. I have the netduino firmware loaded onto a netduino plus. A 2GB sandisk card works perfectly. With the sparkfun card, I can't get it to mount (doesn't return "\SD" when I search for directories on "\"). Any suggestions for what I should try?



#25161 Native code lighter on memory?

Posted by CarTech on 06 March 2012 - 10:00 PM in Netduino 2 (and Netduino 1)

I'm using a netduino in a data logging application. I've integrated a GS1011 wifi board, GPS, accelerometer, Gyroscope, Compass, and OBDII/CAN to talk to my car. With all of these devices logging data to an SD buffer, memory is tight. If I try to post via the wifi connection, I run out of memory. I think I've optimized about as much as I can within reason. I understand that native code will run much faster and is useful for time-sensitive applications. This might be a dumb questions, but can I expect to see significantly less memory use if implement some drivers for the these devices in native and then call them from managed code?



#21114 Reference for System.Uri?

Posted by CarTech on 29 November 2011 - 05:19 PM in Netduino Plus 2 (and Netduino Plus 1)

I figured out the missing reference was System.HTTP



#21113 Reference for System.Uri?

Posted by CarTech on 29 November 2011 - 05:00 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello.

Don’t think that system.Uri exist in Micro .net framework.

http://msdn.microsof...y/cc533014.aspx


I have 4.1, which shows it in the API reference:
http://msdn.microsof...y/ee436970.aspx

Any other ideas?



#21111 Reference for System.Uri?

Posted by CarTech on 29 November 2011 - 04:40 PM in Netduino Plus 2 (and Netduino Plus 1)

I can't figure out which reference I need to use the System.Uri class. Opening a fresh project, I get this error message: type or namespace name "Uri" could not be found (are you missing an assembly reference?) error when I try something like the following.

using System;
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 TestingUri
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            Uri myUri = new Uri("http:\\www.google.com");
            
        }

    }
}




#19767 Timer only executes five times?

Posted by CarTech on 25 October 2011 - 07:08 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for all the help!

For reference, I declared the timer as a field in the class (instead of local variable) and it works perfectly. Here's the updated code:

EDIT: fixed error in code copy paste

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 Testing9DOF
{
    public class BufferFileManager
    {
	
        // Declare timer
        private static Timer timer;
		
        // Constructor
        public BufferFileManager()
        {
            Debug.Print("Created a new BufferFileMananger instance");
        }

        // Public methods
        public void StartDAQ()
        {
            // Start up sensor class
            ADXL345 myAccel = new ADXL345();
            myAccel.CheckConnection();
            myAccel.FullResolution = true;
            myAccel.EnableMeasurements();
            myAccel.SetDataRate(0x08);

            // Start collecting data to file
            timer = new Timer(delegate(object o)
                {
                    myAccel.ReadAllAxes();
                    string data = myAccel.ScaledXAxisG + "\t" + myAccel.ScaledYAxisG + "\t" + myAccel.ScaledZAxisG;
                    Debug.Print(data);
                }, null, 0, 80);
        }
    }

    public class Program
    {         
        public static void Main()
        {
            BufferFileManager fm = new BufferFileManager();
            fm.StartDAQ();

            Thread.Sleep(Timeout.Infinite);
        }
    }
}



#19730 Timer only executes five times?

Posted by CarTech on 25 October 2011 - 02:14 AM in Netduino Plus 2 (and Netduino Plus 1)

Please be kind as I'm a mechanical engineer during the day learning both C# and the netduino as a hobby. :D

I'm using an ADXL345 accelerometer connected to the netduino via I2C. I've attached the class for the accelerometer which I got almost directly from LoveElectronics ADXL345 Library & Tutorial. This code works very nicely.

Unfortunately the sensor stick from SparkFun, which I have, doesn't have the interrupts on the ADXL345 broken out. Thus, I've resorted to polling the ADXL345 with a timer.

The problem I'm having is that the timer only executes five times. If I change the time interval (tried 8ms and 800ms), it still only runs five times. Here's the problematic 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 Testing9DOF
{
    public class BufferFileManager
    {
        // Constructor
        public BufferFileManager()
        {
            Debug.Print("Created a new BufferFileMananger instance");
        }

        // Public methods
        public void StartDAQ()
        {
            // Start up sensor class
            ADXL345 myAccel = new ADXL345();
            myAccel.CheckConnection();
            myAccel.FullResolution = true;
            myAccel.EnableMeasurements();
            myAccel.SetDataRate(0x08);

            // Start collecting data to file
            Timer timer = new Timer(delegate(object o)
                {
                    myAccel.ReadAllAxes();
                    string data = myAccel.ScaledXAxisG + "\t" + myAccel.ScaledYAxisG + "\t" + myAccel.ScaledZAxisG;
                    Debug.Print(data);
                }, null, 0, 80);
        }
    }

    public class Program
    {         
        public static void Main()
        {
            BufferFileManager fm = new BufferFileManager();
            fm.StartDAQ();

            Thread.Sleep(Timeout.Infinite);
        }
    }
}

Now, if put everything in the Main class, it works fine:

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 Testing9DOF
{
    public class Program
    {         
        public static void Main()
        {
            ADXL345 myAccel = new ADXL345();
            myAccel.CheckConnection();
            myAccel.FullResolution = true;
            myAccel.EnableMeasurements();
            myAccel.SetDataRate(0x08);

            // Start collecting data to file
            Timer timer = new Timer(delegate(object o)
            {
                myAccel.ReadAllAxes();
                string data = myAccel.ScaledXAxisG + "\t" + myAccel.ScaledYAxisG + "\t" + myAccel.ScaledZAxisG;
                Debug.Print(data);
            }, null, 0, 80);

            Thread.Sleep(Timeout.Infinite);
        }
    }
}

Not really sure what's going on. I'm guessing it's something to do with how I've attempted to put it in a second class? Any ideas?

Attached Files




#19138 Netduino - WiFi

Posted by CarTech on 14 October 2011 - 01:16 AM in Project Showcase

Hi, unfortunately I have not used the built-in http features of the Gainspan. For my Gainspan projects I rolled my own http communications.


I figured out the problem was I left out the command which sets the data length, fifth line below. Here is the working code snippet:

at+httpconf=20,Mozilla/4.0\r
at+httpconf=3,keep-alive\r
at+httpconf=11,enginuitydiagnostics.com\r
at+httpconf=7,application/x-www-form-urlencoded\r
at+httpconf=5,23\r
at+httpopen=<myhostip>\r
at+httpsend=0,3,10,/test_post.php,23\r\x1BHname=myName&info=myInfo



#18672 Netduino - WiFi

Posted by CarTech on 02 October 2011 - 05:16 PM in Project Showcase

I'm using the gainspan 1011. I followed your source code and have tcp working nicely, thanks! I'm trying to get the httpsend feature working to send an http post. I setup a php script that accepts two fields and I've verified it works using putty. So far, the php script is telling me I'm sending an empty message. So, I'm definitely talking to the server, just not sending any data. I think maybe I've got the escape sequence incorrect. Here's the relevant commands I'm sending the gainspan:

at+httpconf=20,User-Agent: Mozilla/4.0\r
at+httpconf=3,keep-alive\r
at+httpconf=11,<myhost>\r
at+httpconf=7,application/x-www-form-urlencoded\r
at+httpopen=<myhostip>\r
at+httpsend=0,3,10,/test_post.php,23\r\x1BHname=myName&info=myInfo

Any suggestions? I'm not sure what to try next.




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.