Re: [Owfs-developers] Write data with Python3 and pyownet

2020-10-14 Thread Stefano Miccoli via Owfs-developers
A more succinct way would be: str(x).encode() In fact the outer call to ‘bytes’ in 'bytes(str.encode(str(x)))' is a no-op, and python strings are objects which have an ‘encode' method, so no need call the class method ’str.encode’. Another possible way is f"{x:d}".encode() or "{:d}".forma

Re: [Owfs-developers] Writing to DS2413 Device with Python 3

2020-08-27 Thread Stefano Miccoli via Owfs-developers
I have no experience with the DS2413, but if I understand correctly the manual, here is a list of valid commands: owproxy.write('device_id' + '/PIO.A, b'1’) # A on owproxy.write('device_id' + '/PIO.A, b’0’) # A off owproxy.write('device_id' + '/PIO.B, b'1’) # B on owproxy.write('d

Re: [Owfs-developers] python code printing /statistics

2020-08-16 Thread Stefano Miccoli via Owfs-developers
wfs> unpacked into a new directory and tried to >>> follow the instructions in INSTALL, this is what I got - >>> >>> pi@pi4B:~/owfs/owfs-master $ ls >>> acinclude.m4COPYING Makefile.amRELEASE.md >>> AUTHORS COPYING.

Re: [Owfs-developers] python code printing /statistics

2020-08-16 Thread Stefano Miccoli via Owfs-developers
ile or directory > pi@pi4B:~/owfs/owfs-master $ > > I ran out of knowledge at this point. If you can tell me how to install it I > will test it out. > > Thanks > > Mick > > > > On 16/08/2020 17:29, Stefano Miccoli via Owfs-developers wrote: >> The CRC

Re: [Owfs-developers] python code printing /statistics

2020-08-16 Thread Stefano Miccoli via Owfs-developers
The CRC16 error could be related to https://github.com/owfs/owfs/issues/55 The version on master is already patched, and will be released in 3.2p4. If possible check if the current version on master works as expected. Stefano > On 16 Aug 2020, at 18:22,

[Owfs-developers] Release 3.2p4

2020-08-12 Thread Stefano Miccoli via Owfs-developers
Hi all, Having some spare time in may staycation, I’m drafting owfs release 3.2p4. After some testing I implemented GitHub Actions > and dropped MacOs fro

Re: [Owfs-developers] python code printing /statistics

2020-08-09 Thread Stefano Miccoli via Owfs-developers
Things I would try, in random order. - Try an ‘owdir /uncached ’ command before writing to simultaneous, just to refresh the owserver view of the devices on the bus. Maybe a single owdir command is faster that querying the sensors one at a time. - Do not use owserver aliases, use only bus addres

Re: [Owfs-developers] Simultaneous not working

2020-08-07 Thread Stefano Miccoli via Owfs-developers
> On 6 Aug 2020, at 21:42, Mick Sulley wrote: > > I did change to persistent and I didn't see a difference. > > Just a quick background. The persistent=True option is useful to shave a few milliseconds from each owserver query by not having to create and pull down a TCP socket and for limi

Re: [Owfs-developers] Simultaneous not working

2020-08-06 Thread Stefano Miccoli via Owfs-developers
Did you check if persistent=True makes any difference? > On 6 Aug 2020, at 16:21, Mick Sulley wrote: > > Well this gets more curious. I am now measuring the time for each read, > reading type, power and latesttemp. Time for all is generally < 0.1 seconds, > but then when I hit the slow loop

Re: [Owfs-developers] Simultaneous not working

2020-08-06 Thread Stefano Miccoli via Owfs-developers
I agree that using the “persistent” network object for the present use case could speed up things, see

Re: [Owfs-developers] Bugfixed release not the one for download?

2020-06-22 Thread Stefano Miccoli via Owfs-developers
There are a number of open pull requests and issues; I think we should first sort these out before thinking abut releasing a new version. Stefano > On 22 Jun 2020, at 22:10, Jan Kandziora wrote: > > Am 22.06.20 um 18:27 schrieb Gregg Levine: >> >> I decided to check to see if the project page

Re: [Owfs-developers] Balena.io & OWFS

2020-05-16 Thread Stefano Miccoli via Owfs-developers
> On 16 May 2020, at 12:49, Stefano Miccoli via Owfs-developers > wrote: > > The python code could also be improved a little bit, shortly I will post a > gist with some corrections. > Please, see at https://gist.github.com/miccoli/5a6fcb400e13a22873863df6d3b48c02 <ht

Re: [Owfs-developers] Balena.io & OWFS

2020-05-16 Thread Stefano Miccoli via Owfs-developers
I don’t think that the problem is in pyownet, but of course, since I’m the author of that package I’m biased. (In Neapolitan language there is a saying: "Ogne scarrafone è bello a mamma soja”) 'pyownet.protocol.ConnError: [Errno 111] Connection refused’ usually means that there is no ‘owserver

Re: [Owfs-developers] pyownet question

2019-11-10 Thread Stefano Miccoli via Owfs-developers
Strange situation: pyownet is talking to an owserver, all the handshakes go well, but owserver replies with error code 5. A few handy commands to debug the problem. 1) identify the process with which pyownet is speaking from python: >>> from pyownet.protocol import proxy >>> owp = proxy(host="l

Re: [Owfs-developers] Installing pyownet

2019-10-28 Thread Stefano Miccoli via Owfs-developers
There is little bit of confusion. The official OWFS bindings are - OW.py, based on SWIG wrapping the C API of libow - ownet.py, pure python owserver client you will find both in debian packages - python-ow, https://packages.debian.org/buster/python-ow

Re: [Owfs-developers] Installing pyownet

2019-10-27 Thread Stefano Miccoli via Owfs-developers
pyownet is only on pypi, not on debian: you have to use the virtualenv method. S. > On 27 Oct 2019, at 01:01, Mick Sulley wrote: > > I have a problem with that. I removed pyownet with > > sudo pip3 uninstall pyownet > > then I reinstalled with > > sudo apt install pyownet > > but t

Re: [Owfs-developers] Installing pyownet

2019-10-26 Thread Stefano Miccoli via Owfs-developers
Best practice is to isolate packages downloaded from pypi in a virtual environment, and do not mess with the system wide python installation. As a general rule always avoid “sudo pip install”, and only install system wide python packages via the distribution package manager (a

Re: [Owfs-developers] Python2.7 to 3

2019-10-14 Thread Stefano Miccoli via Owfs-developers
27; to any string when writing? > > Mick > > > > On 13/10/2019 21:25, Stefano Miccoli via Owfs-developers wrote: >> I had no time to stress test my installation, but let me add some thoughts >> here. >> >> The fact that failures are sporadic, and that

Re: [Owfs-developers] Python2.7 to 3

2019-10-13 Thread Stefano Miccoli via Owfs-developers
Can anyone >>> explain this behaviour? >>> On 10/10/2019 16:17, Mick Sulley wrote: >>>> Thanks Stefano, that makes it a bit clearer. However I have been playing >>>> around writing to an alias and I really don't understand what is happening. >>&

Re: [Owfs-developers] Python2.7 to 3

2019-10-10 Thread Stefano Miccoli via Owfs-developers
t;> >>> addr = '28.E3377A02/alias' >> >>> owp.read(addr).decode() >> 'xx' >> >>> owp.write(addr, 'T0'.encode()) >> >>> owp.read(addr).decode() >> 'xx' >> >>> owp.write(addr, '

Re: [Owfs-developers] Python2.7 to 3

2019-10-10 Thread Stefano Miccoli via Owfs-developers
I think that this is the correct place to ask, so I'll give a brief answer. In python2 you had "strings" and "unicode strings". Python2 "strings" were 1-byte sequences, so it was impossibile to represent UNICODE code points beyond the few ASCII ones; therefore the "unicode string" was introduced

Re: [Owfs-developers] owfs on Raspberry Buster

2019-09-17 Thread Stefano Miccoli via Owfs-developers
> On 17 Sep 2019, at 14:35, Robert Lagus wrote: > > I tried to start the ofserver with: > sudo systemctl restart owserver > Job for owserver.service failed because the service did not take the steps > required by its unit configuration. > See "systemctl status owserver.service" and "journalct

Re: [Owfs-developers] 1-wire hubs

2019-07-21 Thread Stefano Miccoli via Owfs-developers
I assume that by “1-wire hub” you are referring to a device that allows you to access several distinct physical 1-wire busses as a single logical bus. I think the hub as a point in which a single 1-wire bus “transparently” branches out into several physical distinct busses. In some cases you do

Re: [Owfs-developers] I just downloaded the OWFS source code from the new GIT location...

2019-07-21 Thread Stefano Miccoli via Owfs-developers
ne gregg.drw...@gmail.com > "This signature fought the Time Wars, time and again." > > On Wed, Jul 17, 2019 at 1:22 PM Stefano Miccoli via Owfs-developers > wrote: >> >> Can you please open an issue at https://github.com/owfs/owfs/issues with >> more details

Re: [Owfs-developers] I just downloaded the OWFS source code from the new GIT location...

2019-07-17 Thread Stefano Miccoli via Owfs-developers
Can you please open an issue at https://github.com/owfs/owfs/issues with more details? SM > On 16 Jul 2019, at 01:34, Gregg Levine wrote: > > Hello! > Okay I found and downloaded the OWS source code from the new GIT > location. But during the process of d

Re: [Owfs-developers] bus interface statistics

2019-07-14 Thread Stefano Miccoli via Owfs-developers
old reboot the RPi host. But maybe I’m mistaken here. S. > > On 13/07/2019 19:58, Stefano Miccoli via Owfs-developers wrote: >> >> >>> On 11 Jul 2019, at 23:10, Mick Sulley >> <mailto:m...@sulley.info>> wrote: >>> >>> The reason for the

Re: [Owfs-developers] bus interface statistics

2019-07-13 Thread Stefano Miccoli via Owfs-developers
> On 11 Jul 2019, at 23:10, Mick Sulley wrote: > > The reason for the question is that I still have random bus lockups and I am > considering creating something to power cycle the system, either on a time > basis, e.g. 3am each day, or based on some early warning detection from the > data in

Re: [Owfs-developers] python ow

2019-05-21 Thread Stefano Miccoli via Owfs-developers
Some time ago I wrote pyownet https://pyownet.readthedocs.io/en/latest/index.html to overcome some limitations of the official packages. The code is quite “stable” now, and does not have some of the fancy new features of trio-owfs (namely a

[Owfs-developers] owfs.org is down

2019-04-08 Thread Stefano Miccoli via Owfs-developers
Hi all: owfs.org is down, as reported in https://github.com/owfs/owfs/issues/35 Stefano___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/list

Re: [Owfs-developers] Suggestions of Microcontrollers for 1-wire use.

2019-02-21 Thread Stefano Miccoli via Owfs-developers
Quite an interesting discussion, please forgive me if I throw in my 1cent. We should not forget that normal RPis are educational boards, not meant for professional use. OS on a SD is a terrible idea, with regard to card corruption, but at least it is *impossible* to brick your board. Something

Re: [Owfs-developers] Many-port bus master

2018-11-15 Thread Stefano Miccoli via Owfs-developers
> On 15 Nov 2018, at 08:27, Alastair D'Silva wrote: > > > One question, my code has C99isms, which are fine for modern compilers as > they default to C99. Older compilers default to C90. > > I can fix this in 2 ways: > Easy way: add std=c99 to CFLAGS to force C99 mode > Hard(er) way: Remove

Re: [Owfs-developers] OWFS 3.2p3 released

2018-10-04 Thread Stefano Miccoli via Owfs-developers
🎉 thanks to Johan for the new release! The docker container is for sure useful, but much more would be a write-up of the release procedure itself, something like RELEASE.md in the project root. Stefano > On 3 Oct 2018, at 23:05, Johan Ström wrote: > > Hi everyone, > > it has been a while si

Re: [Owfs-developers] DS1921 time linux vs windows

2018-08-22 Thread Stefano Miccoli via Owfs-developers
Docs at page 7 of https://datasheets.maximintegrated.com/en/ds/DS1921H-DS1921Z.pdf are not very clear, but I would bet that 1 = Jan 2 = Feb … so that conversions at https://github.com/owfs/owfs/blob/ba66022f115909396a4b939f37e8