Closed EsMtt closed 7 years ago
You are experiencing a server side-error, i.e. the server replies to your read request with an OWFS error code, in your example with error 22.
It is expected behaviour that the read
method raises a OwnetError
exception to signal the server-side error, so your code should include some form of error handling, typically within an except
clause:
try:
sensorTemp = float(owproxy0.read(sensor + 'temperature'))
except protocol.OwnetError as err:
# error handling code here
If the error is only sporadic, may be the best strategy is simply to repeat the read after a small interval of time. (And sorry, I have no clue on what causes a 22 error on owserver.)
Closing, since this problem is not related to pyownet.
I wrote a program to read sensor data from multiple RPis with OWFS and the latest pyownet. The reading repeats itself with the help of an threading timer every 1 to 3 seconds (similar to https://stackoverflow.com/questions/12435211/python-threading-timer-repeat-function-every-n-seconds/24488061#24488061). After an irregular number of iterations the program fails with the error:
As I said before, the number of
Exception in thread Thread-76:
is variable. I connect to owserver withand also tried
which causes the same issue. After that I can restart the code and after some time it will throw the same error.
On the single board computers Raspbian Jessie, kernel version 3.4.112 and OWFS 2.9p8 are used. The program runs on Ubuntu 16.04 LTS.
Thank you in advance for your answer.