Posted by davidpaulmiller
What steps will reproduce the problem? Symptom: After some time, an exception is thrown via python in both script and http (I presume)
Set Temp: 45 Cellar Temp: 46 Cellar temp: Too Warm
Set Temp: 45 Cellar Temp: 46 Cellar temp: Too Warm Traceback (most recent call last): File "/mnt/data/cellar/cellar.py", line 33, in <module> cellar_temp = "%.0f" % (Cellar.getFahrenheit()) File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.6.0-py3.2-linux-armv6l.egg/webiopi/devices/sensor/__init__.py", line 118, in getFahrenheit return self.__getFahrenheit__() File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.6.0-py3.2-linux-armv6l.egg/webiopi/devices/sensor/onewiretemp.py", line 34, in __getFahrenheit__ return self.Celsius2Fahrenheit() File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.6.0-py3.2-linux-armv6l.egg/webiopi/devices/sensor/__init__.py", line 93, in Celsius2Fahrenheit return value * 1.8 + 32
WebIOPi version used? => 0.6.0 Python version used? => 3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy) => Raspbian Wheezy
Raspberry Pi board revision? (1 or 2) => 2
For Javascript side bugs, Browser? => N/A
Please provide any additional information below.
#
#
import webiopi import time import sys import os
GPIO = webiopi.GPIO sys.path.append("/mnt/data/cellar/") from webiopi.devices.sensor import DS18B20
GPIO.setFunction(23, GPIO.OUT) GPIO.output(23, GPIO.LOW) GPIO.output(7, GPIO.LOW)
Cellar = DS18B20 (slave="28-0000043a6d18") loop = 1
while loop == 1: GPIO.output(7, GPIO.HIGH) cellar_temp = "%.0f" % (Cellar.getFahrenheit())
fo = open("/mnt/data/cellar/set\_temp.txt", "r")
set\_temp = fo.read(2);
fo.close()
print ('\n' + "Set Temp: " + set\_temp)
print ("Cellar Temp: " + cellar\_temp)
if cellar\_temp > set\_temp:
print ("Cellar temp: Too Warm")
GPIO.output(23, GPIO.HIGH)
else:
print ("Cellar temp: Too Cold")
GPIO.output(23, GPIO.LOW)
time.sleep (5)
GPIO.output(7, GPIO.LOW)
time.sleep (5)
GPIO.output(7, GPIO.HIGH)
time.sleep (5)
GPIO.output(7, GPIO.LOW)
time.sleep (5)
GPIO.output(7, GPIO.HIGH)
time.sleep (5)
GPIO.output(7, GPIO.LOW)
time.sleep (5)
GPIO.output(7, GPIO.HIGH)
@webiopi.macro def Temp(arg0):
return ("%s" % (cellar\_temp))
Posted by trouch
see issue 68