Setfano, or anyone else who can help. I installed pyownet and got it working and I have been developing my code for several days, but this evening it has stopped working. I have gone back to your basic instructions and this is what I see -
control@pi-test:~ $ python Python 2.7.9 (default, Mar 8 2015, 00:52:26) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pyownet.protocol import proxy >>> owp = proxy(host='localhost') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/pyownet/protocol.py", line 729, in proxy raise ConnError(*lasterr) pyownet.protocol.ConnError: [Errno 111] Connection refused >>> It happened after I restarted the server with sudo service owserver restart I have rebooted since but it is still the same. Any idea what the problem may be? Thanks Mick On 28/07/16 10:50, Stefano Miccoli wrote: > Shameless self-promotion: you should use pyownet, which is documented at > http://pyownet.readthedocs.io/en/latest/ > > If you already have an owserver running on your localhost you can start with > > $ pip install pyownet > $ python >>>> from pyownet.protocol import proxy >>>> owp = proxy(host='localhost') >>>> owp.dir() > ['/10.000010EF0000/', '/05.000005FA0100/', '/26.000026D90200/', > '/01.000001FE0300/', '/43.000043BC0400/'] >>>> float(owp.read('/26.000026D90200/temperature')) > 4.0 > > The idea is to have a proxy object, whose methods correspond to the ownet > operations (dir, read, write, ping, present, etc.) Calls to the proxy methods > are lightweight, while creation of the proxy object is a little more costly, > so please resiste to the temptation of calling > > pyownet.protocol.proxy().dir() > > but always create a proxy object at program initialisation and reuse it > throughout your script. > > Stefano > >> On 27 Jul 2016, at 21:26, Mick Sulley <m...@sulley.info> wrote: >> >> Looking at converting my current Python code from owfs to ow-shell. I >> have found a few different Python bindings, any opinions on which one to >> use? Also there does not seem to be much documentation on any of them, >> can anyone point me in the right direction? >> >> Thanks >> >> Mick >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Owfs-developers mailing list >> Owfs-developers@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/owfs-developers > > ------------------------------------------------------------------------------ > _______________________________________________ > Owfs-developers mailing list > Owfs-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/owfs-developers ------------------------------------------------------------------------------ _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers