Hantek6022API
Hantek6022API copied to clipboard
error while running example_linux_continous_read.py
Hallo,
thanks for sharing your API.
I get an error, when running example_linux_continous_read.py
python example_linux_continous_read.py
Clearing FIFO and starting data transfer...
Stopping new transfers.
Snooze 1
Closing handle
Traceback (most recent call last):
File "example_linux_continous_read.py", line 68, in
So the device can not be accessed, from what I understand.. Any ideas how to solve the problem?
I think you need to install libusb, e.g.
sudo apt install libusb-1.0-0-dev
well, I have installed it, but it doesn't make any difference; the error comes only, when closing the handly, so I just moved the command to the end of the script.
Hello, python-libusb1 dev here.
@rpcope1:
Earlier this year I improved the interpreter exit situation by avoiding dependency on destructors, as they do not follow object references (ie, if object A references object B and both have __del__
methods, A.__del__
may still be invoked before B.__del__
). To avoid such interpreter-shutdown-time errors, you may want to either explicitly call USBContext.close
or use with
to manage the lifetime of USBContext
instance (which likely means using it to manage the lifetime of Oscilloscope
class with it and calling USBContext.close
from Oscilloscope.__exit__
).
File "build/bdist.linux-x86_64/egg/usb1.py", line 1113, in close File "build/bdist.linux-x86_64/egg/usb1.py", line 737, in cancel libusb1.USBError: LIBUSB_ERROR_NOT_FOUND [-5]
This is a bug in python-libusb1: while USBErrorNotFound
exception is caught in USBDeviceHandle.close
, it is USBError (the base exception class) which is raised in USBTransfer.close
.
This should be fixed by vpelletier/python-libusb1@7a4b8d8afc1d18a4c3ca1dc49975e3b40ae676a4 which I released today as 1.5.2 .
I'm getting the same error. I am running on Ubuntu, I tried with system python +python-libusb from official sources, pypi and github, and anaconda with python-libusb1 1.6.6. Uploading firmware seems to work.
OpenHantek also works.