#Python DigiTemp Metricfire connector
This program queries temperature sensors and upload the data to metricfire via its python API. It will run until terminated by ctrl-c. Alternatively have a look at the --once and --quiet command line switches to run under cron.
- You need to have [Digitemp] installed and working.
- To run the included unit tests, you need [Fabric] installed.
I've written a blog post tutorial on how to solder suitable DS18S20 sensors to the serial port of a computer. Also there is this tutorial which I found most useful.
The various runtime parameters are set in config.py. The api-key can also be specified in an own file. The various configuration parameters are documented in config.py itself.
- --once : Run only once and exit after uploading the data.
- --quiet : Don't output anything below ERROR level.
The following line can be entered into your crontab (hint: run crontab -e
)
and will have cron call the script once per minute. Errors during execution
will show up in your syslog and will usually be sent to you via email.
* * * * * cd PATH_WHERE_YOU_CHECKED_OUT; ./main.py --quiet --once;
You can run the included unit tests, by calling fab test
in the top level
directory. However you need mock version >= 0.8 for the tests to run.