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

2020-08-24 Thread Dennis Putnam
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 22] Invalid argument *The value of onOff will be either 1 or 0. In this particular

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 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 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 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 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 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