Return of the Nanode thermometer

10Jan13

It’s almost a year since I built my Nanode thermometer, and it looks like another really cold snap is headed towards the UK – perhaps snow over the weekend.

NanodeWebTemp

I’ve not had it set up for a little while, as the TMP36 sensor was reclaimed for a project that put Scratch and an Arduino together to create an on screen fire breathing dragon when hot breath hit the sensor. I’ve also more recently used the sensor with the Quick2Wire Analogue board.

This time I wanted to record data from the Nanode so that I could do some charts later on. I could have done this by modifying the sketch to use MQTT or post data to Pachube Cosm or similar, but I took the path of least resistance and wrote a couple of scripts to scrape from the existing app:

get_temp.sh uses lynx and some sed to strip the temperature reading from the cruft around it:

lynx -nonumbers -dump http://nanode.swos.local | grep Temperature | sed s/'Temperature: '// | sed -e 's/^[ \t]*//'

loop.sh prints a formatted date and time to a (CSV) text file followed by the temperature from get_temp.sh:

#!/bin/bash
while :
do
 printf %s "$(date '+%Y%m%d%H%M')" >> temp && echo -n ',' >> temp && ./get_temp.sh >> temp
 sleep 1800
done

I’m running loop.sh in a screen so that I don’t need a persistent connection to the VM. I’ll update with charts if any of them turn out to be interesting (e.g. a steep overnight drop or something like that).



No Responses Yet to “Return of the Nanode thermometer”

  1. Leave a Comment

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.