Netduino home hardware projects downloads community

Jump to content

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

[Concept] Library for logging, debugging, and simple data analysis

libraries debugging data analysis statistics logging

  • Please log in to reply
1 reply to this topic

#1 Captain Colon

Captain Colon

    New Member

  • Members
  • Pip
  • 2 posts

Posted 04 March 2013 - 11:13 PM

I apologize in advance if this reads thought process is very "bouncy" and tends to jump around between seemingly random topics.  If anything seems muddled/unclear just point it out and I'll try to clarify :)




From what I've seen, the majority of the programmable microcontroller crowd are programmers (often with little/no experience working with electronics) who wanted to make their code do "real" things; things that they could see with their eyes e.g. robots.  I come from the other side of the coin - as a guitarist and composer of electronic music I have a lot of experience with analog electronics and other hardware, but not so much on the software side.  I've been trying to come up with ideas for projects where I can effectively learn .NETMF while making something useful...I'm one of those people that almost immediately get bored with "hello world" type exercises that outline concepts but in the end don't actually do anything useful.  This idea just popped into my head on the way home from getting my car inspected and has me excited enough to actually work on it ;)  I have tons of other ideas but they generally require a significant financial investment that I currently can't afford...this is something that I can not only do for free, but that I can apply to future projects.


I'd like to create a library specifically for people like me who don't have a background in programming.  For me, absolutely nothing is more fun than debugging...taking something that doesn't work and making it work is something I could stay up doing for days straight (and have done many times :)).  Most people don't share my enthusiasm for the process and merely find it obnoxious and frustrating.  They don't like tracing wires, slogging through log files and parsing data trying to find what went wrong; they just want it to work.  Even if you do enjoy it, why wouldn't you want a library that makes it faster and easier?




The goal of this library (as with any library, I suppose) would be to take a lot of the "grunt work" out of the process of writing code to record and analyze data.  As an example, say you wanted to make a simple device that rings a bell when someone comes in the door (like at every store ever).  This library would handle watching for changes, recording them, and also some basic functions for retrieving and analyzing data without having to actually take the device offline and plug it into your computer.  For instance, you could see how many times the sensor has been triggered since the device was last turned on, how many people have passed through in a given time period, etc.  Combined with a simple touchscreen interface on the device, you could have easy, immediate access to metrics like what days/times of day are the most active and require additional staffing, or exactly what times the guy who stole something went in and out so you know which part of the CCTV tape to look at.  Developers would be able to implement this functionality quickly and efficiently with simple, intuitive commands/methods.  This makes their code shorter and cleaner, and less code means less time spent searching for bugs that need to be squished, which means more time available for adding and improving features.  Implemented properly, I think it would be one of those libraries that you never knew you even wanted but once you've used it you wonder how you ever got anything done without it.


Potential Features:


    [*]Ability to log only desired events - essentially the ability to filter only the data you need.  This would be useful for everything from being a debugging tool (have a nice concise error log that could help you find the problem without needing to dig through a giant dump file) to being the entire purpose of the device (tracking and logging how some variable changes over time)



    [*]Ability to access records by various criteria - the state of a variable at a certain time, or all the times a variable had a certain value



    [*]Basic analysis of data without the need for third-party software - combined with a simple interface, the end user would be able to check things like the average value of a variable over a given period of time, how many times that variable changed, the min/max values for a time period, the average magnitude of a change



    I've only had this idea for a grand total of about two hours but I think that's a pretty expansive feature set and a good initial goal.  I think the real challenge will be getting this stuff in a package that's small and efficient enough that it could be used on any .NETMF platform in any application.


    Right now I'm obviously still in the very early stages of design, trying to figure out exactly what this is going to do.  I'm posting this thread in hopes of getting a brainstorming session where I can better nail down the requirements, so I'm asking you guys: what kind of features would you want in a library like this?  What are the biggest, most annoying/frustrating/boring problems in your development process that you hate dealing with?  What kinds of features would you want in a library like this?

#2 JerseyTechGuy


    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 05 March 2013 - 01:07 PM

Well, I'll be coming at this from a different perspective.  I am one of the "Minority" who started as an Electronic Engineer, Learned Web Design and Application Design and has been doing both for 20+ years.  I am old school in the fact that while I have a degree in CEET, I don't believe whole-heartedly in in Certifications and Degrees without the Skills to back it.  I have hired many a person over the years who could spew terms like a dictionary with a spigot but you barely program or design themselves into keeping the job.


I learned the hard way... by doing, by tinkering and also by reading, researching and studying... basically putting in the effort and realizing the end result is worth the time spent and there are no shortcuts to be had that bring personal value and satisfaction.


I know there are people that discover these Microcontrollers like the Netduino and say, I wish I could have a device that could turn on my lamp when it gets dark outside.  Well, with the Netduino you can build that if you are willing to spend the time to learn about the Netduino, C# and how simple electronics works.  There is knowledge and value to be gained by building it along with personal satisfaction.  If people simply want to shortcut it and get it running ASAP taking all the shortcuts, why not simply by an X10 remote and an X10 Lamp controller.  You will be able to still control that lamp, it's ready to go and will probably be cheaper than making it yourself.


Now I'm not saying to build everything from the ground up and force the users to code everything.  I have made and sold many modules for DotNetNuke, Custom .NET controls, breakout boards for sensors all of these which are meant to save time.  This is the idea behind the libraries.  If you are going to design a set of libraries it should be done with a methodical approach.  Research what libraries are out there for the Netduino already.  Stefan, Mario, Fabien and many others have libraries already out there with quite a few great features and drivers.  Look at the gaps that need to be filled. Design the libraries in a way where they are usable and extensible to allow the user to implement it as well as expand it. Then provide clear documentation for the classes for the end users providing examples and instructions.  While this shows how to make it work, it still puts the work back on the user to plumb it all together.


So, I few ideas... I've read about frustration on a few forums. Things users have asked for as far as "has anyone written this yet" and here are a few suggestions based on that.  These are classes I had to write for myself on my own .NET Netduino projects.

  • Simple Data Logging - Ability to easily log data to an SD card.  Could be Fixed Text, Could be XML, Could Provide Both.  Make it simple enough to handle basic logging needs but robust enough for advanced users to do something like pass a collection of objects and have it automatically deserialize the collection to the log files.
  • Error handling - A global error handling class which not only is able to handle errors properly but can also take advantage of the Simple Data Logging class and log the errors to a log file.  Keep it extensible so a user could add in functionality to email or tweet an error using a 3rd party class like Stefan's SMTP or Fabien's Twitter classes.
  • Menu System - This could be a tricky one because you need to take into account the different types of display mechanisms, or simply design it to work with Character LCDs but design it in a way where users could enhance it to work with their displays.  I had to design a Menu System for my project that had a Parent/Child relation menu system.  Allowed me to use a simple setup of an Up/Down/Enter button or in a more complex case Up/Down/Left/Right/Enter from a 5 way joystick or tactile button.  The menu system should be configurable to the Screen to allow the user to specify things like; Show on 1 line, 2 line, etc basically how you will see the list of menu items. Easily allow a user to specify what an item click does (ie: Execute a method vs going to a child item).  Have the ability to drive the Menu through code like an array or even from an XML file on the SD Card.

So these are a few of my thoughts, opinions, ideas.  I hope my 2 cents is worth 2 cents.  Good luck with the project and welcome to the Netduino Forums!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.