Arduino Communications - SQLite

From Combustory
(Difference between revisions)
Jump to: navigation, search
Line 17: Line 17:
 
==Linux==
 
==Linux==
 
Ok, well I am starting with Linux. Why? Well.... Linux is smooth! It treats all devices like files. Meaning once you know how to open a file in Linux, you basically know how to access any device. How great is that? Someone was thinking when they created that idea. The operating system drivers are made to make this possible. So in the case of a serial port all you have to do is an stty command to set the transmission rates and the communications parameters and BOOM... like magic a serial port can be treated like a file. This allows you to use common commands that are used on files on a serial port.
 
Ok, well I am starting with Linux. Why? Well.... Linux is smooth! It treats all devices like files. Meaning once you know how to open a file in Linux, you basically know how to access any device. How great is that? Someone was thinking when they created that idea. The operating system drivers are made to make this possible. So in the case of a serial port all you have to do is an stty command to set the transmission rates and the communications parameters and BOOM... like magic a serial port can be treated like a file. This allows you to use common commands that are used on files on a serial port.
 +
 +
===Data Slam Method===
 +
The goal here is to push out all the data of the Arduino as fast as we can and load it into the database. To do that use this Arduino Sketch:
 +
 +
<source lang="c">
 +
 +
</source>
 +
<source lang="bash">
 +
 +
 +
</source>
 +
 
==Windows==
 
==Windows==
  

Revision as of 02:32, 23 January 2012

Welcome to Combustory


Any questions or comments:

  • Send them to - combustor@combustory.com

Contents

Summary

When writing code these days it is silly to not use a database to manage your data. It significantly cuts the amount of code needed to manage data. So why not just collect the Arduino output directly into a database and allow any software access to the database?

This article shows you how to use a database to collect Arduino data directly from the serial port and place the data into an SQLite database using scripts. This article will provide examples for Linux and Windows.

Technical Assumptions

  • Users are familiar with programming the Arduino
  • Users know how to install and use SQLite (Most Linux computers have it by default)
  • It would be helpful to be knowledgeable about bash scripting

Linux

Ok, well I am starting with Linux. Why? Well.... Linux is smooth! It treats all devices like files. Meaning once you know how to open a file in Linux, you basically know how to access any device. How great is that? Someone was thinking when they created that idea. The operating system drivers are made to make this possible. So in the case of a serial port all you have to do is an stty command to set the transmission rates and the communications parameters and BOOM... like magic a serial port can be treated like a file. This allows you to use common commands that are used on files on a serial port.

Data Slam Method

The goal here is to push out all the data of the Arduino as fast as we can and load it into the database. To do that use this Arduino Sketch:

 
 

Windows

Personal tools
Sponsers
Your Ad Here
Your Ad Here