|
From: <ni...@us...> - 2010-11-12 08:59:33
|
Revision: 111
http://openautomation.svn.sourceforge.net/openautomation/?rev=111&view=rev
Author: nilss1
Date: 2010-11-12 08:59:20 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
set loglevel for failed reads to info
Modified Paths:
--------------
PyWireGate/trunk/owfs_connector/OWFS_Connector.py
PyWireGate/trunk/owfs_connector/connection.py
Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py
===================================================================
--- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-11 17:37:13 UTC (rev 110)
+++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-12 08:59:20 UTC (rev 111)
@@ -24,7 +24,7 @@
class owfs_connector(Connector):
CONNECTOR_NAME = 'OWFS Connector'
- CONNECTOR_VERSION = 0.1
+ CONNECTOR_VERSION = 0.2
CONNECTOR_LOGNAME = 'owfs_connector'
def __init__(self,parent, instanceName):
self._parent = parent
@@ -51,7 +51,7 @@
self.issensor = re.compile(r"[0-9][0-9]\x2E[0-9a-fA-F]+")
self.isbus = re.compile(r"\x2Fbus\x2E([0-9])+$", re.MULTILINE)
- owfsdir = str(connection).split( )[3][1:-17]
+ owfsdir = re.findall("from \x27(.*)\x2F",str(connection))[0]
## Sensors and their interfaces
self.debug("Read ini file from %s" % owfsdir+"/sensors.ini")
sensorconfig = self.WG.readConfig(owfsdir+"/sensors.ini")
@@ -225,19 +225,21 @@
owfspath = "/uncached/%s/%s%s" % (sensor,get,resolution)
self.debug("Reading from path %s" % owfspath)
+ data = False
try:
## read uncached and put into local-list
data = self.owfs.read(owfspath)
- try:
- self.mutex.acquire()
- self.busmaster[busname]['sensors'][sensor][get] = data
- finally:
- self.mutex.release()
except:
## ignore all OWFS Errors
- self.WG.errorlog("Reading from path %s failed" % owfspath)
+ #self.WG.errorlog("Reading from path %s failed" % owfspath)
+ self.log("Reading from path %s failed" % owfspath)
+
+ try:
+ self.mutex.acquire()
+ self.busmaster[busname]['sensors'][sensor][get] = data
+ finally:
+ self.mutex.release()
## make an id for the sensor (OW:28.043242a32_temperature
-
try:
## only if there is any Data update it in the DATASTORE
if self.busmaster[busname]['sensors'][sensor][get]:
Modified: PyWireGate/trunk/owfs_connector/connection.py
===================================================================
--- PyWireGate/trunk/owfs_connector/connection.py 2010-11-11 17:37:13 UTC (rev 110)
+++ PyWireGate/trunk/owfs_connector/connection.py 2010-11-12 08:59:20 UTC (rev 111)
@@ -152,7 +152,6 @@
if payload_len >= 0:
data = s.recv(payload_len)
return self.toNumber(data[:data_len])
- break
else:
# ping response
return None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|