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

SQLite


  • Please log in to reply
15 replies to this topic

#1 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 03 August 2011 - 10:28 PM

Does anyone know if it is possible to install SQLite on a microSD card and then access the database engine using the .NET Micro Framework from my Netduino Plus? I need to add a database to my Netduino Plus project and I do not want to have to run a web server/database on a separate computer. I need the database access to be self-contained on the MCU's SD card. If there is any way to do this, even if it is not using SQLite but some other database engine, please let me know. I would rather not use flat files for storage.

#2 bradygaster

bradygaster

    Member

  • Members
  • PipPip
  • 15 posts

Posted 04 August 2011 - 12:54 AM

that'd be SO awesome.

#3 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 04 August 2011 - 01:04 AM

Would it? :) If I figure it out I'll let you know. I've done extensive searches and don't see any reference to this, but maybe there's someone out there who knows.

#4 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 04 August 2011 - 01:20 AM

This ChipworX module has built-in Sqlite support: http://www.saelig.com/NMFP/NMF010.htm I bet the Netduino doesn't have enough processing power to handle database access.

#5 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 04 August 2011 - 01:24 AM

There's also this little reference to 32-bit MCU's and Sqlite: http://www.microchip...ms/m469667.aspx

#6 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 04 August 2011 - 01:33 AM

Hmmm, I think I just figured it out. :D

#7 Adam Clifford

Adam Clifford

    Member

  • Members
  • PipPip
  • 18 posts

Posted 04 August 2011 - 12:58 PM

please do tell :)

#8 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 August 2011 - 01:09 PM

Even creating a kind of "driver" using native code, the tiniest footprint for the SQLite is about 200K. If you are able to squeeze both the MF, the SQLite and leaving at least a dozen of free bytes for the user, I think would be a miracle!
AFAIK, the SQLite for small devs could be considered without additional frameworks like the MF.

Althoung is not the same, why not the protocol-buffers?
Cheers
Biggest fault of Netduino? It runs by electricity.

#9 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 04 August 2011 - 01:35 PM

Well unfortunately it didn't work. I tried using this: http://system.data.s.../www/index.wiki, and it looked like it was going to work, but because .Net MF doesn't provide access to System.Data.*, the code doesn't actually load onto the Netduino. Mario, protocol-buffers is an interesting idea, although I'd really like to get Sqlite working. But it sounds like I would have to work a miracle. :D

#10 davidlt

davidlt

    Member

  • Members
  • PipPip
  • 23 posts

Posted 07 August 2011 - 06:14 AM

There is a compete managed code (C#) implementation of SQLite3. Current ported version is 3.7.7.1. More details on: http://code.google.c.../csharp-sqlite/ It might require additional porting to .NET MF, but I think it was already ported to .NET CF. And the next thing is the size of the code and memory footprint. You might need to optimize it or drop some features. I am looking for the same thing, to have small database on .NET MF, but I haven't yet tried to compile the code. Or we could design some very limited database solution, SQL or NoSQL.

#11 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 18 August 2011 - 12:27 AM

So how about this: could I run Puppy Linux (http://puppylinux.org) headless on the microSD card, along with a LAMP stack and then somehow query the LAMP stack from the Netduino using C# code? I'm thinking of having the Netduino make a port 80 request to a php page running on the Apache web server on the Linux install, querying the MySQL database via php and then returning the results as a string to the Netduino. :) If anyone knows how to do this or thinks it would work, please let me know.

#12 St. Cyr

St. Cyr

    New Member

  • Members
  • Pip
  • 1 posts

Posted 17 November 2012 - 12:10 PM

Hello everyone. I'm new the forum and to Netduino. SQLite is touted as the perfect database for applications such as these however I have yet to find anything about using it with .NET. Anyone? I would like to store data gathered on an sd card in a database.

#13 mbyamukama

mbyamukama

    Member

  • Members
  • PipPip
  • 16 posts

Posted 30 January 2013 - 07:57 AM

A custom DataTable class that is serializable can be useful for most storage applications. Simply serialize the the object to an SD card. If the application frequently updates data, you may wish to load the datatable each time the device starts and serialize after every few updates. Not so cool but very good and secure for non data-intensive applications.



#14 HiredMind

HiredMind

    Member

  • Members
  • PipPip
  • 25 posts

Posted 30 January 2013 - 06:59 PM

So how about this: could I run Puppy Linux (http://puppylinux.org) headless on the microSD card, along with a LAMP stack and then somehow query the LAMP stack from the Netduino using C# code? I'm thinking of having the Netduino make a port 80 request to a php page running on the Apache web server on the Linux install, querying the MySQL database via php and then returning the results as a string to the Netduino. Posted Image If anyone knows how to do this or thinks it would work, please let me know.

 

I think you're over-complicating things.  If I understand correctly, you're talking about 5 levels of abstraction above.  What's your end goal?  If you lay out your project end-to-end here, we might be able to find a simple way to do it. 

 

What kind of data are you storing?

How often does it change?

How relational is it?

 

You might be able to use XML serialization or something, depending on the answers to these questions.


  • NeonMika / Markus VV. likes this

#15 StefanUSMC

StefanUSMC

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts
  • LocationWisconsin, USA

Posted 30 January 2013 - 10:42 PM

I also have been looking for SQL support, but as client. I attempted to bring over the GHI code, but ND does not seem to have the resources to pull it off. Is anyone here familiar with how to connect to a SQL server as a client? I ended up having to host a PHP to get the job done, but if I can get that type of thing running on a ND it would be much nicer.



#16 HiredMind

HiredMind

    Member

  • Members
  • PipPip
  • 25 posts

Posted 31 January 2013 - 04:26 PM

I also have been looking for SQL support, but as client. I attempted to bring over the GHI code, but ND does not seem to have the resources to pull it off. Is anyone here familiar with how to connect to a SQL server as a client? I ended up having to host a PHP to get the job done, but if I can get that type of thing running on a ND it would be much nicer.

 

I've looked at the SQL server native protocol a few times.  It would be difficult to implement in a netduino - requires a full parser and such.  It also would lock you in to SQL Server.

 

I think you did the right thing with an intermediate PHP layer.  I think the only way to improve would be to try an implementation of Odata.  It maps pretty well onto a simple database schema, allowing for schema changes without changing the intermediate level.  And you'd be able to re-use that with any Odata service - your Windows Forms, WPF, and Silverlight and Netduino code could all use the same service!  FTW!






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.