This is the homepage for Digitemp with built-in MySQL support.
At this time (2002-11-20), the version of digitemp with MySQL support is based off of
Digitemp 2.6.1.
This site is dedicated to Brian Lane's Digitemp with my MySQL support addition.
I have modified Digitemp version 2.6.1 with an extra command line argument '-e'.
When this version of digitemp is run with the -e option './digitemp -e' it will
read the '.digitemprc_mysql' config file, and insert the data into a mysql table.
Here is an example of some inserted data:
mysql> select * from temps order by time_date desc limit 1;
+--------+--------+--------+------------------+---------------------+
| sensor | temp_c | temp_f | sensor_serial | time_date |
+--------+--------+--------+------------------+---------------------+
| 1 | 20.125 | 68.225 | 10DDDD47000800D7 | 2002-11-19 15:06:59 |
+--------+--------+--------+------------------+---------------------+
1 row in set (0.00 sec)
Here is what the general table should look like:
mysql> describe temps;
+---------------+----------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+----------+------+-----+---------------------+-------+
| sensor | int(3) | | | 0 | |
| temp_c | float | | | 0 | |
| temp_f | float | | | 0 | |
| sensor_serial | char(24) | | | | |
| time_date | datetime | | | 0000-00-00 00:00:00 | |
+---------------+----------+------+-----+---------------------+-------+
5 rows in set (0.00 sec)
And, here is the create_table() command to make the table:
create table temps (
sensor int(3),
temp_c int,
temp_f int,
sensor_serial char(24),
time_date datetime
);
BTW: I did notice that there is Perl MySQL support in the digitemp 2.6.1
distribution, but I just wanted digitemp to do it itself.
I hope someone finds this useful :)
|