Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

 

Image AddedImage Added

 

 

 

 

Image Added

 

 

#Every 5 minutes (but not on the hour!!) check if the python script has crashed, if it has then restart
5,10,15,20,25,30,35,40,45,50,55 * * * * pgrep python3 || (python3 /home/atlasmon/mon/readTemp.py)
#Every 12 hours, 2 minutes before the scripts get killed, plot them
58 23,11 * * * python3 /home/atlasmon/mon/quickPlot.py
#Every 12 hours, on the hour, run teh script to push file to google drive and email
0 0,12 * * * source /home/atlasmon/mon/uploadToDrive.sh
0 0,12 * * * python3 /home/atlasmon/mon/sendEmail.py
#Every 12 hours, 2 min the hour, kill any mon script still running
2 0,12 * * * pgrep python3 && ( kill $(pgrep python3) ) 
#Every 12 hours, 3 minute after the hour, restart the python script
3 0,12 * * * python3 /home/atlasmon/mon/readTemp.py

 

 

The output log created by the script has the following format:

unixTime	RoomTempThermOut	 ColdTherm1	ColdTherm2	ColdTher3	Avg(ColdTherm1,ColdTherm3)
  • The first column is simply unix time. This is parsed into a readable format in plots and adjusted for the pst timezone.
  • The second column is the measured temperature of the thermistor outside the freezer, next to the labjack (see picture).
  • The third and fifth columns are tmperature readings from thermistors at the bottom of the freezer (the coldest part). Their readings are averaged in the sixth column.
  • The fourth column is the temperature reading from the thermistor near the top of the freezer volume. This is typically a few degrees warmer than the other 2. Only the sixth column temperature reding is used to trigger the alarm sequence. For example:

This script sets up an smtp client with gmail and sends an email to a specific user list (line 25), telling them both the time/date of the email according to the monitoring computer, and attaching the logfile and most recent temperature plot. The subject field also has the word urgent. For example: SendEmail.py is largely the same but with a different send list, no urgent in the subject line, and a different text body.

This script takes the latest entry in the logs folder and plots the three columns with the cold thermocouple readings against the parsed unix time. For example:

The two thermocouples at the bottom of the freezer have their temperature readings plotted with a dashed line, whilst their average is a solid line. The temperature reading of the thermocouple near the top of the freezer is plotted with a dot-dash line. The temperature of the thermocouple outside of the freezer is not plotted.

The plot is saved to the img/ dir with a filename that corresponds to the unixtime of the log script: #unixTime_plot.pdf.

The next scripts are concerned with monitoring and backup.

...

 

 

Image Added

 

Image Added

 

 

Image Added

 

Image Added

Reads all ADC thermistor inputs once and discplays their measured temp, the raw voltage readings, the temp without CJC, and the CJC temp. Can be run to quickly debug but wil crash if another monitoring script is already accessing labJack at the same time.