Monday, January 13, 2014

Real-Time Data Aquisition online Graph (Arduino)






Introductions:

Its been  a while that we had posted here the different tutorials ,DIY ,How-tos that discussed  embedded system.But this time we'll be dealing with web programming  and  simple database to log  data  and graph the  corresponding informations  on the web.We also solicited tips and ideas about web programming  especially Java-scripting; and I would like to mention them: Sir Tito,Richard and Sir Val as my buddy of  experts in the said field. 

Besides, we've crawled the net to select which available graphing tools are easy to used and offer a lot of features . As we google all the tips & tricks pertaining to  this topic, it seems that geeks have their  different scheme and designs how they graph data in the internet.Well, it depends  upon us which of which tutorials meet our appetite to do internet of  things-web data logging. By downloading all the resources , I came up with a simple technique on how to classify procedures   graphing/charting  data on-line either simple or complicated.

A very good tips & trick to simplify the said system is to render  the design and task into three procedures of simple open or close control system; and these are the following:

Input ---------------------------------------> Process -------------------------------------> Output

Input/s . These are the source of signals analogue /digital coming from your sensors or transducer .
In our discussion , temperature ,humidity ,light sensor signals.All these inputs are being feed trough an I/O communication port (rs232,i2C ,SPI ) of microcontroler (Arduino) .Our MCU will handles channelling and  protocols before we proceed into the stage of processing. 

Process. A stage where  we contained , modify , grouped and the conversion of  various  formats of data .In this stage ,data type were already identified ,yet web protocols will decode it as as series of string like format of data. 
In our discussion , data will be populated , stored and polled from MySql and update of its database sets only to the first row id.  PHP script will  echo rows of data queried by JavaScript .This row of data  from record set will be parsed inside the html program .Therefore polled data serve as the parameter being process as a substitute to the  coordinates of lines to be plot in the chart.

Outputs. A stage where data is being interpreted  and results to a sensible and definitive informations.It could be further used as reference to the previous stages.In our discussion , we simply plot the data and produce a meaningful graph or chart.

So what are we waiting for? Get the code and start running until we can think another ideas that required us web programming and on-line data logging.Please follow  the tutorials as enumerated below.

Cheers!


Note:
You may use the myC.c to simulate inputs from MySQL so that  we can run the program without MCU at first.



Requirements:

Software:
Linux OS : Fedora/Ubunto
Flot library (http://code.google.com/p/flot/)
PHP5 /JavaScript
APACHE
MYSQL

simpleFlot.zip  https://attachment.fbsbx.com/file_download.php?id=249896215178478&eid=ASulqPMaOsMEgZ1Thyo7RyqP-tVtElXuHqI-CToU6gi3MqouQbuXZARcHfM-gQ4zNIA&ext=1389676849&hash=ASsPAh2tYL_2Cn2o

Hardware:
PC Server: Xitrix i7 (optional)
MCU -Arduino Mega 2560


Objectives:
1) To store  data coming from an Arduino based sensors  using mysql
2) To poll stored data from mysql using PHP and JavaScript
3) To display the chart or graph o real-time data acquisition  online

Methodology:
1) Download or installed all required softwares
root@localhost# yum install httpd* mysqld* php5*

3)Getting  flot files
root@localhost# wget  http://www.flotcharts.org/downloads/flot-0.8.2.zip
root@localhost# unzip flot-0x.x.zip
root@locahost# cd /flot/examples/realtime/

4) Data base using MySQL
...create database
mysql> create database sensorDB;
mysql> use sensorDB;

..create table
mysql> create table sensorData ( A integer not null, B integer not null);

..populate data
mysql> insert into sensorData(sensorid,Light) values(1,45);

..check simple schema
mysql> describe sensorData;

..check stored data
mysql> select *from  sensorData;


5) Simulating data inputs in MySql using C
 Compiling myC.c
root@localhost# gcc -Wall -o myC myC.c  `mysql_config --cflags --libs`
root@localhost# ./myC


Details:

Details(0) Download site for flot software


















Details(1) Web directory and files 
















Details(2) C program for MySQL
















Details(3) PHP script to poll data from MySql



















Details(4) JavaScript using Flot graphics libraries
 













Detail(5) CSS code



















Details(6) Simulating input to mysql-C program







Detail(7) Web real-time chart/graph demo
video

Remarks:





Conclusions:
A simple start of graphing  data online

Saturday, January 4, 2014

RK3188(MK802IV) Bootloading & Installing Linux-PicUntu



CS898 RK3188 Quad Core (1.8Ghz) : ceoOutlets


Introductions:
So now  I got a quad-core TV stick please bare with me the excitement of hacking this gadget.Just recently , I did the tweaking of   previous dual-core mini-stick OS from android to Linux and exploring its kernel was in-fact a great challenge of cracking skills-fortunately there were hints on the net.




Requirements:
PicUntu-1.4.5 -https://github.com/aloksinha2001/Linux3188/blob/master/picuntu-kernel-4.5.img
PicUntu file system-http://www.g8.net/download/picuntu-4-4.tgz
rkflashtool  GUI based Linux-https://github.com/linuxerwang/rkflashkit
rkflashtool  CLI based Linux -https://github.com/Galland/rkflashtool_rk3066
cs898 MK809/RK3188 mini PC stick


Objectives:
To install and boot Linux in the RK3188 mini PC-stick
To implement embedded single PC board with quad-core
To re-customized the size of Picunto software.


References:
1) http://www.freaktab.com/showthread.php?6930-PicUntu-4-4-Rootfile-system
2)http://www.freaktab.com/showthread.php?6803-Linux-for-RK3188-based-TV-boxes/page6

Details:


Details(1) Finding a new device ID 















Details(1.a) rkflashkit GitHub site -"Galland"





















Details(2.b): RKFlashTool CLI  based
























Details(2.c) Dump 3K3188 parameters





Details(3.a): Rkflashkit GitHub site -"linuxwang "


















Details(3.b): selecting binary file for RKFlashTool GUI based





















Details(3):Installed rkflasher appeared in the software center
 






















Details(3) RKFlasher gui


















.. to be continued....

Remarks:








Conclusions: