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 case the value is 1. The value of blower.id_ is 0BE14D000000. This is what that OWFS directory contains: *ls -l /mnt/1wire/3A.0BE14D000000* total 0 -r--r--r-- 1 root root 16 Aug 19 21:17 address -rw-rw-rw- 1 root root 256 Aug 19 21:17 alias -r--r--r-- 1 root root 2 Aug 19 21:17 crc8 -r--r--r-- 1 root root 2 Aug 19 21:17 family -r--r--r-- 1 root root 12 Aug 19 21:17 id -r--r--r-- 1 root root 16 Aug 19 21:17 locator -rw-rw-rw- 1 root root 1 Aug 19 21:17 PIO.A -rw-rw-rw- 1 root root 3 Aug 19 21:17 PIO.ALL -rw-rw-rw- 1 root root 1 Aug 19 21:17 PIO.B -rw-rw-rw- 1 root root 12 Aug 19 21:17 PIO.BYTE -r--r--r-- 1 root root 16 Aug 19 21:17 r_address -r--r--r-- 1 root root 12 Aug 19 21:17 r_id -r--r--r-- 1 root root 16 Aug 19 21:17 r_locator -r--r--r-- 1 root root 1 Aug 19 21:17 sensed.A -r--r--r-- 1 root root 3 Aug 19 21:17 sensed.ALL -r--r--r-- 1 root root 1 Aug 19 21:17 sensed.B -r--r--r-- 1 root root 12 Aug 19 21:17 sensed.BYTE -r--r--r-- 1 root root 32 Aug 19 21:17 type I cannot see anything wrong with the code or permissions and the error is so generic I don't know to what it refers. Can someone spot what is invalid or help me debug this problem? TIA. ****
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers