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.

ukkiwisurfer

Member Since 22 Jan 2015
Offline Last Active Jan 27 2016 11:18 AM
-----

Topics I've Started

Netduino framework

19 January 2016 - 03:01 PM

Hi,

 

I've come to the painful conclusion that the .NET Micro framework just isn't worth the effort at the moment, purely from the toolchain perspective.

 

This isn't a decision I've come to lightly, especially after spending hundreds of hours on the platform (which seemed so very promising at the beginning). After upgrading to the Netduino 3 my issues of running out of memory were mostly resolved. But the issue of finding and fixing memory leaks (in my code I admit) became extraordinarily difficult and time consuming.  

 

Having to resort to print statements in the 21st century in order to identify memory leaks is not just painful - its also not very productive. Having to do so with a multi-threaded application makes it even more difficult. Using an interpreted language limits much of what the .NET tools and ecosystem can provide.

 

I've released the framework that I was working on as part of a larger project for .NET Micro under the MIT licence.

 

It can be found at https://github.com/u...mework.Embedded.

An example of how to use the framework can be found at: https://github.com/u.../UtilityMonitor 

 

Hopefully at some point in the near future the whole toolchain for .NET Micro can move into same same league as the traditional desktop .NET development. And hopefully some of what is in in the framework will be of benefit to the community.

 

Kind regards,

Jason.


Buffer OVFLW not being caught by try/catch

11 November 2015 - 07:41 PM

Hi,

 

I'm getting a 'Buffer OVFLW' message being logged to the console window. I have a general try/catch block at the application level, but it appears that this error is not being caught by the try/catch block. Can someone explain how this could happen? 

 

 try

 {

    var serviceManager = new ServiceManager();

    serviceManager.Run();

  }

  catch (Exception ex)

  {

     Debug.Print(ex.StackTrace);

  } 

 

And from the logging output (console window) I see it as:

 

2015-11-11 17:32:02.288 | 14 | FileSystemLogger | File matches pattern. File: '\SD\data\tosend\20151111173150715.data'.
Buffer OVFLW
Buffer OVFLW
 
It appears that it isn't being caught as I'd expect - I wanted to see what the stack trace was to work out what was causing the software to fail.

General support from Secret labs

10 November 2015 - 09:10 AM

A general question to the community...

 

Is there anyone else other than Chris from SecretLabs that monitors the forum and interacts with the community? Or is it literally just one person supporting the entire community (from the manufacturers perspective)?

 

Thanks,

Jason.

 


Corruption in forum post

09 November 2015 - 10:22 AM

Chris,the following post seems to have become corrupt.

 

http://forums.netdui...ing-filedelete/

 

Thanks,

Jason.


ND3 SD Filestream.Read() seems to become broken

08 November 2015 - 11:24 PM

Hi,

 

I'm seeing some odd behaviour sometimes when reading off an SD card. I have a dedicated thread that reads data to be sent, and reads it off the SD and into a MemoryStream, before being transmitted via an AMQP connection.

 

The MSDN documentation implies that the Read operation will leave the underlying stream at the position that the previous FileStream.Read() left it at. However I am seeing situations where it appears to be going backwards, but apparently only on certain files.

 

The FileStream has been opened only for reading, with no share allowed for any other process. Attached below is a snapshot of the logging file. The structure is:   Timestamp | Thread Id | Logical component name | Log message

 

2015-11-08 23:00:31.128 | 16 | DataTransferService | Started processing file - FileSize: '20151108225110431.data'

2015-11-08 23:00:31.185 | 16 | DataTransferService | File is within allowable size. FileSize: '554'

2015-11-08 23:00:31.274 | 16 | DataTransferService | Reading filestream. Loop: 1, BytesRead: 400, Position: 400

2015-11-08 23:00:31.358 | 16 | DataTransferService | Reading filestream. Loop: 2, BytesRead: 400, Position: 246

2015-11-08 23:00:31.440 | 16 | DataTransferService | Reading filestream. Loop: 3, BytesRead: 400, Position: 92

2015-11-08 23:00:31.526 | 16 | DataTransferService | Reading filestream. Loop: 4, BytesRead: 400, Position: 400

2015-11-08 23:00:31.582 | 16 | DataTransferService | Reading filestream. Loop: 5, BytesRead: 400, Position: 246

2015-11-08 23:00:31.667 | 16 | DataTransferService | Reading filestream. Loop: 6, BytesRead: 400, Position: 92

 

The relevant code where this is being detected is as follows (where m_BufferSize defaults to 512):

 

 ...

 byte[] buffer = new byte[m_BufferSize];

 ...

 

 using (var stream = m_FileHelper.OpenStreamForRead(m_Configuration.TargetPath, fileName, m_BufferSize))

 {

   int index = 1;

   int offset = 0;

   int bytesRead = 0;

 

   while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0)

   {

     LogDebug("Reading filestream. Loop: {0}, BytesRead: {1}, Position: {2}", index, bytesRead, stream.Position);

     memoryStream.Write(buffer, 0, bytesRead);

 

     index++;

    }

  }

 

Anyone else come across this odd behaviour?


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.