-
Edit mysql.c and change your database user credentials.
-
Edit main.c and change the path to the digitemp file behind "#define PATHTOTEMPFILE"
-
Compile with mysql header files. Use gcc or cc.
gcc main.c mysql.c -o temptosql -L/usr/local/include/mysql -L/usr/local/lib/mysql/ -lmysqlclient
-
Run digitemp in crontab as often as you want the data (ex: every 5min):
*/5 * * * * /usr/sbin/digitemp_DS9097 -aq -c /etc/digitemp.conf > /tmp/digitemp
- This assumes you have set up digitemp to save the config to /etc/digitemp.conf:
- /usr/sbin/digitemp_DS9097 -i -s /dev/cuau1 -q -c /etc/digitemp.conf
-
Run the file you compiled in crontab, execute at the same time as above:
*/5 * * * * /path/to/compiled/program/temptosql
-
Notifications
You must be signed in to change notification settings - Fork 0
marcusnilsen/TempToSQL
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Read temperatures from a digitemp output file and insert to a DB
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published