#!/bin/bash # # Copyright (c) 2018 leopold@shdx.org # Author: Der_Leopold # # This script tries to read sensor values from a 1wire bus and writes the results # and a timestamp to a file. It is intended to be executed periodically, for # example via crontab. # # Retry up to n times if the reading fails RETRY=3 # Number of seconds to wait between retries DELAY=2 # Specify the temperature range where you expect the sensors will be operating # This is simply used as a safeguard to detect implausible sensor readings MINTEMP=-30 MAXTEMP=40 # Interface that is connected to the 1wire bus USETTY=/dev/ttyUSB0 # Location of the digittemp config file with data about the sensors DIGITEMPCONF="/etc/digitemp.conf" # Command to use for reading the sensors CMD="sudo /usr/bin/digitemp_DS9097" CMDOPTS=" -q -s $USETTY -c $DIGITEMPCONF" # Define sensors that should be queried # Format: [