Skip to content
Browse files

Added data dictionary and changed tables

  • Loading branch information...
1 parent de2bae6 commit 883b07fa8870ece0ebf0b9316c593a6de4657fff @aardalo committed
Showing with 52 additions and 9 deletions.
  1. +50 −7 README
  2. +2 −2 envsensor/envsensor.ino
View
57 README
@@ -90,20 +90,63 @@ Hardware [LAMP]
---------------
Any LAMP server - could be a Synology NAS (my setup) or e.g. a Amazon EC2
server (small ... free for a year).
+
+Database
+========
+Data Dictionary for MySQL database "power" on localhost
+You must have db config file "dbconfig.php" in same dir as sql*.php:
+
+ <?php
+ $user="insert database username";
+ $password="insert password for user";
+ $database="database name";
+ $table="meter table name";
+ ?>
+
+meter
+-----
+Table comments: power meter loggdata
+
+Column Type Null Default
+----------- ----------- ------- -----------------
+timestamp timestamp No CURRENT_TIMESTAMP
+count int(11) No
+kwhh float No
+utelys
+------
+Table comments: lysmåling ute
+
+Column Type Null Default
+----------- ----------- ------- -----------------
+timestamp timestamp No CURRENT_TIMESTAMP
+value float No
+
+utetemp
+-------
+Table comments: utetemperatur
+
+Column Type Null Default
+----------- ----------- ------- -----------------
+timestamp timestamp No CURRENT_TIMESTAMP
+value float No
+
Revision History
================
+20.03.2012 Added database description
+ Modified environmental sensor to save data to separate tables to make life
+ easyer for my Synology 410 - it was peaking CPU due to inefficient queries
07.03.2012 Fixed minor bugs and added support for "temp" table on MySQL server
- Also modified the gw to support "wellformed" GETs that will be
- sent directly to the LAMP server.
- Fixed graphs so that they grow correctly if missing datapoints.
- Added environmental monitor that logs light and temperature
+ Also modified the gw to support "wellformed" GETs that will be
+ sent directly to the LAMP server.
+ Fixed graphs so that they grow correctly if missing datapoints.
+ Added environmental monitor that logs light and temperature
29.02.2012 Added MySQL support. web/sql*.php is called from index.php
- Added Xbee to Ethernet GW
+ Added Xbee to Ethernet GW
05.02.2012 Revised web pages to dynamically update without reload - still rough
- but closer...
+ but closer...
01.02.2012 Added web pages in php using Google Chart. Inspired by code created
- by https://github.com/HNygard
+ by https://github.com/HNygard
01.02.2012 Initial version - experimental level - all input highly appreciated
To-do
View
4 envsensor/envsensor.ino
@@ -34,14 +34,14 @@ void loop(){
// Check the temperature
float celsius = getTemperature(); // Read the I2C temp sensor
dtostrf(celsius,0,2,temp); // convert float to string, left orientation, 2 decimals
- loggString = "GET /sql/?table=temp&sensor=utetemp&value=" + String(temp) + " HTTP/1.0"; // assemble logg command to XBEE to ETH GW
+ loggString = "GET /sql/?table=utetemp&value=" + String(temp) + " HTTP/1.0"; // assemble logg command to XBEE to ETH GW
Serial.println(loggString); // put it out on the XBEE network
delay(1000);
// Check the ambient light using the LDR
int ldr = analogRead(A3);
- loggString = "GET /sql/?table=temp&sensor=lys&value=" + String(ldr) + " HTTP/1.0";
+ loggString = "GET /sql/?table=utelys&value=" + String(ldr) + " HTTP/1.0";
Serial.println(loggString);
}
}

0 comments on commit 883b07f

Please sign in to comment.
Something went wrong with that request. Please try again.