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

2020-08-28 Thread Martin Patzak
 Stefano, thank you for the summary, most appreciated  ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers

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

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

2020-08-27 Thread Mail Lists
Hi Guys, I’m pretty “late to the party” but In April this year I upgraded my RPi to the latest Debian packages to read all my DS28EA00 sensors and ran into issues with some of the sensor subfields had disappeared, namely “temphigh” And “templow” and needed to patch the source code and rebuild

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

2020-08-27 Thread Mick Sulley
Yes I have struggled with that as well.  I have discovered how to do it, but I don't really understand why. The answer seems to be that to write a 1 you need     owproxy.write('device_id' + '/PIO.BYTE, b'1') so you need to write the byte value of the string 1, not the byte value of the

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

2020-08-27 Thread Dennis Putnam
Hi Martin, See embedded comments. On 8/27/2020 2:56 AM, Martin Patzak wrote: > > what does *onOff.to_bytes(1,byteorder=sys.byteorder)) *evaluate to? Is > that resulting in a byte-value? I am not familiar with this... This seems to be the crux of the problem. After a lot of testing it appears to

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

2020-08-27 Thread Martin Patzak
... did you try Mick's sample program? > import pyownet > > DevAddress = '*3A.0BE14D00*' > owp = pyownet.protocol.proxy(persistent=True) > owp.write('/DevAddress/PIO.BYTE',b'0') > print('PIO.BYTE = ', owp.read('/uncached/DevAddress/PIO.BYTE')) > print('sensed.BYTE = ',

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

2020-08-26 Thread Dennis Putnam
I have rewritten my code to use pyownet but am now nearly back where I started. I have the following code: *owproxy.write('/3A.'+blower.id_+'/PIO.BYTE',onOff.to_bytes(1,byteorder=sys.byteorder)) *That statement gives me the following error: *pyownet.protocol.OwnetError: [Errno 22] legacy -

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

2020-08-24 Thread Martin Patzak
> It is a  little ironic that in the owfs suite of programs the module > called owfs it the only one you really should not use. yes, I second that. That was confusing to hear in the beginning. If felt so intuitive... Maybe it should not be part of the standard package at all? > With Python3 the

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

2020-08-24 Thread Tomasz Torcz
On Mon, Aug 24, 2020 at 09:57:58AM -0400, Dennis Putnam wrote: > I have the following python 3 code: > > *fn='/mnt/1wire/3A.'+blower.id_+'/PIO.BYTE'** > **with open(fn,'wb') as fh:** > **   fh.write(onOff.to_bytes(1,byteorder=sys.byteorder)) > > *This produces the error: > > *OSError: [Errno

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

2020-08-24 Thread Mick Sulley
Yes I would second that.  It is a  little ironic that in the owfs suite of programs the module called owfs it the only one you really should not use.  Basically hte best way is to run owserver which talks to all the devices, and then your python code talks to owserver. I have been using

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

2020-08-24 Thread Dennis Putnam
Hi Laurent, I have not. I am a OWFS noob so I don't know what either of those are/do. I only read an article that indicated I should use BYTE. On 8/24/2020 12:34 PM, Laurent FAILLIE via Owfs-developers wrote: > Hi, > > I'm controlling several things using DS2406 or DS2408 thru OWFS/Fuse > (from

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

2020-08-24 Thread Laurent FAILLIE via Owfs-developers
Hi, I'm controlling several things using DS2406 or DS2408 thru OWFS/Fuse (from C code but it's the same), and it's working pretty well for years.I.e: * Some explanations (in French) : Commande d'actionneurs par 1-wire | | | | Commande d'actionneurs par 1-wire Par DS2406 | | | * my

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

2020-08-24 Thread Martin Patzak
For python I would highly recommend you use the library *pyownet *by Stefano Miccoli /https://github.com/miccoli/pyownet/ /using Fuse can lead to weird problems... (not saying that it is the reason in your specific case) or you can use the buil-in functions in owserver  owread/owwrite/owdir