How To Automatically Update Your Temperature Graphs

Log week 2008-11-12 21:06

Here’s a bit more explanation on how to run the temperature logging system I described earlier.
The system automatically stores the value of its sensors every five minutes using the crontab function in Linux. crontab is a schedule of recurring things to be done in the form of commands to be run on the system. There’s different crontab’s for different users. In this particular NSLU2 system I’m running crontab commands as root user. As far as I remember it was necessary to do that to have sufficient rights on the system.
To see what is in your crontab at the moment, run this command:

crontab -l

where -l is for list only. Use -e for editing your crontab:

crontab -e

This will start a default editor, in my case ‘nano’, so that you can make changes to your list.

crontab -l on this system gives this output:

# m h  dom mon dow   command
*/5 * * * * /home/thomas/happyfarming/update_temp_2.sh &> /dev/null
*/5 * * * * /home/thomas/happyfarming/upload_temps.sh

m: Minute. “/5″ means every five minutes.
h: Hour
command: Command to be executed. I run the update_temp_2.sh script every five minutes. “&> /dev/null” takes the output from this command and discards it, so that I don’t get a mail every five minutes.
* means at every value, i.e. minute is 1 through 60 or hour is 1 through 24 etc.

The other command or script I run is upload_temps.sh. This will upload the graphs to this website, making them available in posts.

This is what my upload_temps.sh script looks like:

#!/bin/bash
sleep 30
lftp -u USER,PASSWORD SERVER <<EOF
cd /images/
lcd /home/thomas/happyfarming/
put log_h.png
put log_d.png
put log_w.png
put log_m.png
put log_y.png
quit 0
EOF

using FTP to upload the files.

Sea Buckthorn Juice

Sea buckthorn

This is not actually “grow your own food”, more like gather your own food. It came in through the back door from my in-laws, so it was not something I was seeking consciously. My girlfriend has family in Sweden and they were visiting Denmark. I don’t know if this is typical for Denmark, but they found a lot of Sea buckthorn (Hippophae L.), which they made juice from. Apparently this is very valuable stuff, so they were glad they could take much of it with them home.

My in-laws combed the local coastline and they found lots of bushes of Sea buckthorn. It’s supposed to be one of those healthy superfoods, like blackcurrant, blackberry and such. We got some of the juice and I’m beginning to like it. It took a while to figure out what it taste like, but it’s very much like oranges, plain and simple. So is the color. When shaken it also looks like orange juice, but left still the buckthorn will part like oil on water. We mix it with water, 1 part juice and 6 parts water. The raw Sea buckthorn juice is made with special equipment that can be carried around when picking the berries.

Soil Temperature Logging

Temperature log week

The soil temperature sensor is now in the ground and measurements have been coming in for days now. I have placed the NSLU2 computer in the windowsill and laid an Ethernet cable out to the raised beds. The scripts for this logging functionality are available here:

make_temps_2.sh

update_temp_2.sh

owfs is used as interface to the 1-wire network.

As expected the soil temperature is changing slower than the air temperature. Sometimes the soil temperature continues to go up while the air temperature is dropping. Maybe the soil temperature is determined by the amount of sun reaching the ground and the air temperature follows the wind, but I don’t know.

I actually thought that the soil temperature would be more stable, like 7 deg. C +/- 2 (45 deg. F) or something, but that is not the case here. Until now it has been in the range 3 to 7 deg. C (37 to 45 deg. F) and it seems like it would easily go below 0 deg. C (32 deg. F) given enough hours with air temperature below -5 deg. C (23 deg. F). On a second thought it might be true that a few meters down the soil temperature would be rather stable. But then it’s not soil anymore, right?

Anyway, it’s time to plant some garlic. We have some Chinese ones in the kitchen. They’ve traveled about 7000 km (4300 miles) … Geez, what were we thinking?