Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-30 Thread Colin Reese
in Reese <mailto:colin.re...@gmail.com>> > > Date: 03/29/2014 1:32 PM (GMT-05:00) > > To: "OWFS (One-wire file system) discussion and help" > > <mailto:owfs-developers@lists.sourceforge.net>> > > Subject: Re: [Owfs-developers]

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-30 Thread Paul Alfille
message > > From: Colin Reese > > Date: 03/29/2014 1:32 PM (GMT-05:00) > > To: "OWFS (One-wire file system) discussion and help" > > > > Subject: Re: [Owfs-developers] ow Python makes sensors disappear > > > > > > Well, this isn

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-29 Thread Colin Reese
file system) discussion and help" > > Subject: Re: [Owfs-developers] ow Python makes sensors disappear > > > Well, this isn't quite over yet. Still randomly crapping out. > > Can someone please help me debug this? > > Thanks, > Colin > > > On 3/

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-29 Thread Colin Reese
Original message > From: Colin Reese > Date: 03/29/2014 1:32 PM (GMT-05:00) > To: "OWFS (One-wire file system) discussion and help" > > Subject: Re: [Owfs-developers] ow Python makes sensors disappear > > > Well, this isn't quite over yet. Still rand

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-29 Thread Colin Reese
nt via the Samsung Galaxy S™ III, an AT&T 4G LTE smartphone > > > > Original message > From: Colin Reese > Date: 03/29/2014 1:32 PM (GMT-05:00) > To: "OWFS (One-wire file system) discussion and help" > > Subject: Re: [Owfs-developers

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-29 Thread paul.alfille
ssion and help" Subject: Re: [Owfs-developers] ow Python makes sensors disappear Well, this isn't quite over yet. Still randomly crapping out. Can someone please help me debug this? Thanks, Colin On 3/28/2014 16:52, Colin Reese wrote: > and ... drum roll ... the answer was to re

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-29 Thread Colin Reese
Well, this isn't quite over yet. Still randomly crapping out. Can someone please help me debug this? Thanks, Colin On 3/28/2014 16:52, Colin Reese wrote: > and ... drum roll ... the answer was to remove all double quotes from > sqlite query preparation statements in the calling script, escaping

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
and ... drum roll ... the answer was to remove all double quotes from sqlite query preparation statements in the calling script, escaping included single quotes. I don't understand it, but it fixed it. Colin On 3/28/2014 15:55, Stefano Miccoli wrote: > Try running > > owserver --debug > > a

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
ON attempted restart after error, I get the following, but no additional messages from owfs or owserver on read fails. For what it's worth, I've duplicated this on another master with a different sensor. Same OS image cloned some time ago. DEBUG: ow_daemon.c:(166) main thread id = 306948558

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Stefano Miccoli
Try running owserver --debug and watch for error messages. S. On 28 Mar 2014, at 23:33, Colin Reese wrote: > I've no idea where to even start on this. > > > On 3/28/2014 14:49, Stefano Miccoli wrote: >> This error is entirely on the owserver side... owpython and the friends >> seem not to

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
I've no idea where to even start on this. On 3/28/2014 14:49, Stefano Miccoli wrote: > This error is entirely on the owserver side... owpython and the friends > seem not to be responsible. > >> pyownet.protocol.OwnetError > > exceptions are raised when the remote owserver answers with an error >

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Stefano Miccoli
This error is entirely on the owserver side... owpython and the friends seem not to be responsible. > pyownet.protocol.OwnetError exceptions are raised when the remote owserver answers with an error code, in this case -5, that according to owserver --help=error is 5. legacy - IO error you

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Got it. Fixed within functions/methods. I'll look at passing the reference around later. On 3/28/2014 14:42, Stefano Miccoli wrote: > I would avoid calls like > > OwnetProxy(host).read(prop).strip() > > you should reuse the proxy object between calls: > > __init__(self, ) > self.proxy =

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Stefano Miccoli
I would avoid calls like OwnetProxy(host).read(prop).strip() you should reuse the proxy object between calls: __init__(self, ) self.proxy = OwnetProxy(host) def method(self, ...) self.proxy.read(prop).strip() There is a cost in creating the proxy object, but no significant resource

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Stefano Miccoli
Yes you are right: while there is some experimental code that implements the idea of a "sensor" with attributes corresponding to values this is still very experimental. Nevertheless the low level approach is not so much different: from pyownet

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
And I've now successfully duplicated the error in pyownet: File "/usr/lib/iicontrollibs/cupid/owfslib.py", line 27, in owbuslist for dir in OwnetProxy(host).dir(): File "/usr/lib/iicontrollibs/resource/pyownet/protocol.py", line 408, in dir raise OwnetError(-ret, self.errmess[-ret]

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Ok, after becoming thoroughly annoyed with owpython, I wrote around pyownet. See the first three functions/classes. I did not install pyownet, but located it in a subdirectory. I will add sufficient attribution when I get a minute. Let me know what you think. https://github.com/iinnovations/iic

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Stefano, For me, this is all I need to list all my sensors, and have a similar routine to read values: import ow import pilib querylist = [] ow.init('localhost:4304') sensorlist = ow.Sensor('/').sensorList() for sensor in sensorlist: querylist.append(

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Ok, this is truly bizarre. I narrowed it down to the inclusion of a statement that does will cause ow.init to fail as described, even when the code is not run. The offensive statements were the creation of strings for sqlite queries, such as : querylist.append('insert into inputs values(\'' +

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
I use owpython to connect to owserver: ow.init('localhost:4304') The reason (at the moment) is that owpython does everything I need to do and I've built code around it. On 3/28/2014 10:57, Stefano Miccoli wrote: > Is there a reason for using ow (which is a SWIG binding of the owlib C > API) and

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Michael Markstaller
Which busmaster(s) and owfs-Version are you using? Michael -- ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Stefano Miccoli
Is there a reason for using ow (which is a SWIG binding of the owlib C API) and not ownet (which is a pure python implementation of the ownet protocol)? If you do not have to access the bus master directly from python but you have an owserver running, I would suggest using instead ownet, or even

[Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Hell all, I've run into an interesting error that results in sensors disappearing altogether, resulting in the error: File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 271, in __init__ self.useCache( self._useCache ) File "/usr/lib/python2.7/dist-packages/ow/__init__.py", l

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
2.9p1 and DS2483 It has been absolutely bulletproof up until now. Still is if I run the script as a standalone. On 3/28/2014 09:00, Michael Markstaller wrote: > Which busmaster(s) and owfs-Version are you using? > > Michael > >

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Well, this works, so it's something else in that calling script: https://github.com/iinnovations/iicontrollibs/blob/master/cupid/mytest.py On 3/28/2014 09:00, Michael Markstaller wrote: > Which busmaster(s) and owfs-Version are you using? > > Michael > > --

Re: [Owfs-developers] ow Python makes sensors disappear

2014-03-28 Thread Colin Reese
Here is the script: https://github.com/iinnovations/iicontrollibs/blob/master/cupid/owfslib.py And the calling script (see line 123) https://github.com/iinnovations/iicontrollibs/blob/master/cupid/updateio.py Everything in the first script is debugged to not do anything except print the id of