Freeze Mon

Raspberry Pi based freezer temperature monitor:
  • DS18B20 sensor
  • send temp to server one per minute
  • Server displays this, if browsed
  • if temp goes outside range, raspi sends text warning
  • if server loses contact with raspi, server sends text

-- BenDugan - 02 Oct 2017

Key bits of code from here.

So far:
  • set up rpi zero, added sensor, confirmed it reads temps automatically after power up
  • set up shared key so rpi can ssh to elvo

  • scp temp file from rpi to elvo every 5 (?) minutes
    • what happens is ssh fails?
    • run scp from bash or from python?
  • cat into log file in case net breaks
  • write program on elvo to
    • convert file to time & temp, cat to end of data log
    • detect alarm conditions, send emails (texts)

-- BenDugan - 08 Oct 2017

Most of above working now, except:

  • detect alarm conditions, send emails (texts)


  • add browser output for time now and graph of recent time

-- BenDugan - 10 Oct 2017

The rpi has disconnected at least twice and not reconnected automatically. The #1 thing this shows is the need to test it here at length before putting it at St Mary's, because there it will be hard to reset and it will be sending warnings that will get annoying. The first time I saw this it happened after ~ 2hours and I thought it might have been a DHCP lease thing, so I changed a setting related to that in the dhcp conf file. Since then it worked for a few days, and I thought that was it. But this morning I see that it stopped at 12:30 yesterday (I think that's after lunch).

Did it keep logging data?

Can I log in now with a keyboard and monitor to debug the network connection?

-- BenDugan - 14 Oct 2017

I had a problem where I had two crontabs running: one for user bdugan and the other for the superuser. Sometimes they stepped on each other and the temperature graph would not update. But for the last two days the display has not updated although the temperatures have continued to be logged. I just ran 'tmon' as su and it did run gnuplot correctly and created the graph, so what happened before? (I think the gnuplot command line was missing the leading directory info so it ran when I tested it from that directory. - Actually, I think it was the missing directory info in the plot_script file.)

Also, I could not ssh to the rpi this morning. It might have been on the network but at a changed DHCP address -- I didn't think to check that until after I rebooted it.

-- BenDugan - 29 Oct 2017

Moving Servers

This has been on 'elvo' and I'm moving it to 'elf', which has been a testbed for a while in order to upgrade the OS to Ubuntu 16.04. foswiki and owncloud are working on elf now and those are the main things. What is needed on the server to support this temperature monitor?

  • crontab entries
  • python scripts
  • bash scripts
  • gnuplot scripts
  • files
    • ~/plot_data
    • ~/temperature_now - ephemeral: single point, gets appended to temperature_log based on crontab
    • ~/temperature_log
    • ~/t.png - output from gnuplot, updated based on crontab, gets copied into /var/www/uchc
    • /var/www/uchc/index.html
    • /var/www/uchc/t.png (copied from ~t.png)

The plot is viewed by browsing to So the apache config needs:

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases

  # Index file and Document Root (where the public files are located)
  DirectoryIndex /var/www/uchc/index.html
  DocumentRoot /var/www/uchc

  # Log file locations
  LogLevel warn
  ErrorLog  /home/bdugan/public/wiki/log/error.log
  CustomLog /home/bdugan/public/wiki/log/access.log combined


Topic attachments
I Attachment Action Size Date Who Comment
ctabEXT ctab manage 1 K 24 Jan 2018 - 22:01 BenDugan  
plot_dataEXT plot_data manage 59 K 24 Jan 2018 - 22:01 BenDugan  
plot_scriptEXT plot_script manage 157 bytes 24 Jan 2018 - 22:02 BenDugan  
temperature_logEXT temperature_log manage 342 K 24 Jan 2018 - 22:04 BenDugan  
tmonEXT tmon manage 278 bytes 24 Jan 2018 - 22:04 BenDugan  
tmon2EXT tmon2 manage 438 bytes 24 Jan 2018 - 22:02 BenDugan  
Topic revision: r6 - 24 Jan 2018, BenDugan
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback