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.
Photo

Data format on SD Card


  • Please log in to reply
2 replies to this topic

#1 RodWS

RodWS

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 November 2012 - 11:07 AM

Hi I'm in the early stages of planning a project that will use several netduino's to log and send data up to a main server for various clients to browse. I want to store data to a log in an interim fashion on the SD card - after a set period of time a chunk of older data is deleted to always allow for constant storage. Each device has a handful of sensors sampling data between every second or every minute so keeping say 72 hours of data is not that large - a CSV test sample was <5MB for 24 hours so the SD card has plenty in hand. I want to transfer the data in the log to the server in batches every 60 seconds (about <4Kb), and I want to use JSON to serialise the data up to the main server using a web service. One other thing I'd like to do is remotely view the log on the SD card on any device, I'm not sure if this is possible I don't plan to set the netduino's up as webserver's just push the data up. I am wondering what format I should store the data log in ? Write it straight to JSON or use XML and convert to JSON using JSON.NET or similar ? As I write this logging directly to JSON seems obvious but just thinking about reading the data remotely, would XML offer more flexibility or maybe simply CSV - I'll be looking at the data in column/row fashion to check for consistent readings and any problems from a sensor, etc. Any recommendations appreciated.

#2 jimox

jimox

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 27 November 2012 - 02:28 PM

Welcome to the forums! I personally would store it as JSON. Since you already plan on having code to do the JSON serialization I don't see any point in using up more space for XML serialization or CSV parsing. In addition JSON is more compact than XML so it will use less space in your log file. The only benefit I see for CSV would be an even further reduced storage size but since you said overall it won't be that large then I would think the benefits of JSON would outweigh that. As for remotely connecting to the netduino to view the file. I don't see how you could do this without at minimum setting up a service to listen for requests to view the file. However if you have the code space it is pretty easy to spawn a thread to listen for requests on a port and respond.

#3 RodWS

RodWS

    New Member

  • Members
  • Pip
  • 2 posts

Posted 28 November 2012 - 09:44 AM

Thanks for the welcome. Yes it's does seem logical to store the data in JSON. In which case JSON.NET looks to me a good tool to use. Will have to do some reading on how to write a log file from sensor data, doesn't seem as much info. about as on XML. I would be looking at browsng the data on the netduino, sort of in an administrative / maintenance role - maybe if they were setup as servers this would be another option. Likely will be prototyping on more than one and exploring the different options over the next few months, will keep you posted...




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.