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.

600mL

Member Since 31 Oct 2012
Offline Last Active Aug 19 2015 11:02 PM
-----

Posts I've Made

In Topic: Committing File to SD Card

28 May 2014 - 03:07 AM

it's an essential problem. I just wonder to buy N+2, but after read this thread....  I think twice, maybe it's ok to keep develop my project using N+  :wacko:

 

It works fine if you flush afterwards, eg:

        public void writeToFile(string data)
        {
            using (FileStream filestream = new FileStream(filename, FileMode.Append))
            {
                using (StreamWriter write = new StreamWriter(filestream))
                {
                    write.WriteLine(DateTime.Now + "," + data);
                }
            }
                        
            VolumeInfo.GetVolumes()[0].FlushAll();      // Force write to sd card
        }

In any case, even if you do not flush, the card will be written to eventually. I believe the data is buffered in memory and then written to when it reaches a certain level. I think this is to avoid too many short read/write operations to the SD Card which will probably impact on performance.


In Topic: Could my Netduino COM ports be malfunctioning?

27 May 2014 - 11:41 PM

Don't see why making the variable static would make a difference :) But I tried that and your suggestion about Timeout as well. No difference and same gibberish as well. In earlier posts you'll see that I've tried the other COM ports as well with no difference.

 

Well, the Bluetooth module definitely communicates using Serial as you can see from my previous posts while using Hyper Terminal. The chip (CSR BC417143) is a UART chip.

http://www.digikey.c.../bc417143/21102

 

This is the vendor I bought mine from

http://www.amazon.co...0?ie=UTF8&psc=1

 

On the bottom of the board mine says v1.06.

 

Thanks for your help.

 

That was just some example code that worked for me, making it static probably makes no difference.

 

Are you powering the module from the 3.3V or the 5V pin? You need to connect it to 5V pin apparently.

 

Have a look at this tutorial: http://homepages.ihu...o/GUIDE_2BT.pdf

 

Check out page two, there is a wiring diagram that shows a pair of resistors connected from txd to gnd. Have a read through that pdf, it looks well written and informative.


In Topic: Could my Netduino COM ports be malfunctioning?

26 May 2014 - 04:44 AM

Also, can you provide a link to the datasheet of the bluetooth device you are using?

 

Perhaps your module uses a different interface to communicate with the Netduino

 

EG. Netduino <-- SPI/I2C --> Bluetooth <---- RS232 ----> Device ????


In Topic: Could my Netduino COM ports be malfunctioning?

25 May 2014 - 11:29 PM

I can suggest a few things. Make the serial port a static class and place your serialport instantiation outside of the main function and include a serial port timeout. You should also try the other available serial ports if this doesn't work. Example:

public class program
{
   private static SerialPort dataPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);

   public static void Main()
   {
      dataPort.ReadTimeout = Timeout.Infinite;
      dataPort.WriteTimeout = Timeout.Infinite;
      dataPort.Open();
      dataPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
   }
}

In Topic: Could my Netduino COM ports be malfunctioning?

23 May 2014 - 04:27 AM

Hi,

 

You have your serial port baud rate set to 9600. Is this correct? I would reconfigure both devices to work at 115200 and see if you are still receiving gibberish.

 

Usually gibberish is an indication of incompatible baud rates. I know the netduino plus has some issues at lower baud rates, but 9600 should be ok. Give what I suggested a try and let us know how you go.


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.