dataloggin in CSV or txt ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

dataloggin in CSV or txt ?

AdrienB
Is there a way (or where) to create a log file with the reading with a specific format such as:
date; time; CO2 reading; Rh reading; ....

I cant find the .py file to edit ....
Reply | Threaded
Open this post in threaded view
|

Re: dataloggin in CSV or txt ?

AlfredC
Administrator
I see a couple of options here:
1) livDB process writes measurements into a sqlite3 DB in file /home/pi/liv/livDB/livDB.py  (line 159 - 164  in https://github.com/FirstCypress/LiV/blob/S_development/software/liv/livDB/livDB.py )

The measurement data is stored into a few local variables: str(timestamp), DBtemperatureString, DBhumidityString, DBairPressureString, DBco2String . You can add your own Python code in livDB.py and write that data into your csv file.

2) The data is stored into liv.db file under /home/pi/liv/livDB. You can look at the data with:
>sqlite3 liv.db
> select * from Measurements;
You can write your own code as a separate Python process that reads the data from the db and converts it into the format of your choice (csv file, etc...)
 
You can find a brief description of software architecture here: http://liv-pi-forum.1124721.n5.nabble.com/LiV-a-brief-software-guide-f67.html (item 3 refers to livDB).













Reply | Threaded
Open this post in threaded view
|

Re: dataloggin in CSV or txt ?

AdrienB
Thanks for that.
I will certainly look into option 1 and will post the code once it is working.
I find easier to process data afterwards as I need to import them in Libre office calc or similar software.

Thanks for pointing out the .py file and variables !