This is my first project on the raspberry and the first one utilizing Python.
Objective is to read multiple 1-wire sensors and store the temperatures in a Database.
As my raspberry is running headless (just power and LAN), the data needs to be presented by a web-server.
People starting with Databases may get some thoughts for their projects.
For the graphics: JPGRAPH
I am recommending to use MobaXterm for accessing the raspberry from a Windows PC.
much more convenient than putty
The program was written in Python and does contains the following files:
avrio.py the main program
avrio_database.py a module with all functions for the database
avrio_html.py creating a HTML file out of Python
avr-graph.php this PHP-Script is reading the database and generating a nice graph
avrio-writedb.sh a little shell script which called from cron job
If you execute avrio.py the first time, it ask for the main parameters and create a configuration file (avrio-config.txt), e.g. user/Pw for MySQL and paramters for the database.
Next it will create the database and the table.
If sensors are connected these are listed and added to the configuration file.
Utilizing the an editor like nano you need to assign the sensor to a location.
Starting the main program w/o any parameter will read the sensor and write the temprature into the database
> python avrio.py
Data can be displayed by various ways:
Using the command line and read the last three lines from the database
> python avrio.py -r 3
Calling a web site generated by the program:
> python avrio.py -w
open the html file in the browser http://192.168.178.60/avrweb/avr-single.html
Showing the graphic by opening the php code
Hardcopies can be found here: http://www.hoeser-medien.de/?p=291