Hallo
I have 2to3 by foub.py and changed the code in
fousb.py in line 1174 for Python 3.7.3
def _read_usb_block(self, address):
addr1 = (address // 256) & 0xff
addr2 = address & 0xff
self.devh.controlMsg(usb.TYPE_CLASS + usb.RECIP_INTERFACE,
0x0000009,
[0xA1,addr1,addr2,0x20,0xA1,addr1,addr2,0x20],
0x0000200,
0x0000000,
1000)
data = self.devh.interruptRead(self.usb_endpoint,
self.usb_read_size, # bytes to read
int(self.timeout*1000))
return list(data)
and in line 1198
def _write_usb(self, address, data):
addr1 = (address // 256) & 0xff
addr2 = address & 0xff
buf = [0xA2,addr1,addr2,0x20,0xA2,data,0,0x20]
result = self.devh.controlMsg(
usb.ENDPOINT_OUT + usb.TYPE_CLASS + usb.RECIP_INTERFACE,
usb.REQ_SET_CONFIGURATION, # 0x09
buf,
value = 0x200,
index = 0,
timeout = int(self.timeout*1000))
if result != len(buf):
return False
buf = self._read_usb_bytes(8)
if buf is None:
return False
for byte in buf:
if byte != 0xA5:
return False
return True
otherwise the operator "/" will be interpreted incorrectly, it must be
right "//"
and it works
Hartmut
--
You received this message because you are subscribed to the Google Groups
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/b0991b3e-fe96-4d44-aa0a-a09233bb0460%40googlegroups.com.