Step 5Software setup - data acquisition
As root on your linux machine:
1)
Run `digitemp -s /dev/ttyS0 -i -c /etc/digitemp.conf`
This creates the config file digitemp.conf with yoru sensors.
Watch the output to see what number the sensors get.
2)
Check the temperature with `digitemp -aq -c /etc/digitemp.conf`
3)
Dump the output data into a file. I dump to a file within apaches wwwroot, that way I can access the temperature from anywhere.
The command `digitemp -aq -c /etc/digitemp.conf > /var/www/digitemp.txt` puts the output of digitemp into the file digitemp.txt
4)
Automate this process:
type `crontab -e`, this opens roots crontab.
Type `* * * * * digitemp -aq -c /etc/digitemp.conf > /tmp/digitemp; mv /tmp/digitemp /var/www/digitemp.txt` into that file, and save it.
Run `crontab -l` to confirm that the crontab has been installed.
The reason I am piping the output into /tmp and then moving it to /var/www, is that digitemp uses a few seconds to compete its run. If you try to access the output while digitemp is running, you would get an incomplete file. This could mess up other scripts that read data from this file. (This is not included in the screenshot, forgot to do it)
Your weatherstation is now up and running.
Use the data to do whatever you like, graph it, use it to email in case of high/low temp, etc..
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|















































