3. livDB

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

3. livDB

AlfredC
Administrator
This post was updated on .
livDB process reads measurements from sensors and writes them into a sqlite DB (liv.db)
livDB Python code resides under "/home/pi/liv/livDB"
livDB uses existing open source code from Adafruit to access DHT22 and BMP180 sensors.

When livDB process starts, it first reads parameters from "livDB.config" file. After that, it initialises sensors, connects to liv.db and enters an infinite loop that reads sensor measurements, writes the values into liv.db and sleeps for 2 minutes (this is a configurable value) before it starts the new reading cycle.

You can test the sensors following the instructions: http://liv-pi-forum.1124721.n5.nabble.com/Testing-all-sensors-tc31.html

You can view logs in real time with: "tail -f livDB.log"

Here is how you can re-create liv.db: http://liv-pi-forum.1124721.n5.nabble.com/Clean-up-LiV-Measurements-DB-tc14.html

Suggested topics: 
- sqlite db, read config files in Python