Closed knuesel closed 1 year ago
There has been numerous report of issues with the USB part of pyvisa-py. A reasonable option to clean the code of spurious resets that may be the root cause of this has been discussed in https://github.com/pyvisa/pyvisa-py/issues/256#issuecomment-1102934510 but I had no time to follow up on it and others did not report anything. Could you have a look ?
Thanks for the pointer. Indeed I can get *IDN?
to work by commenting some of these lines. Here are some observations:
If both of these blocks are present I get a timeout error and the device freezes:
Same thing with the following two lines (even if the previous two blocks are commented):
(same traceback as above)
Same thing if I keep the two set_configuration
calls (even if the sest_interface_altsetting
(221) and reset
(292) are commented).
Finally if I keep the set_interface_altsetting
(221) and the second set_configuration
(216) I get a "Resource busy" error but the device doesn't freeze.
The following combinations seem to work fine (at least for multiple *IDN?
queries):
set_configuration
(216) and the reset
.set_interface_altsetting
and the reset
.although I still get a warning:
home/j/.local/lib/python3.10/site-packages/pyvisa_py/protocols/usbtmc.py:115: UserWarning: Unexpected MsgID format. Consider updating the device's firmware. See https://github.com/pyvisa/pyvisa-py/issues/20
It would be interesting to know if one of options 2-4 also works for @mwcmwc12 and @pfjarschel...
Thanks for looking into it. I will try to see if I can make a PR making the inheritance less buggy and we can try to see if that works for you.
I cannot reproduce with the 0.6.0 release. Thanks for fixing this!
Happy this old pain looks gone. I hope it is gone for good !
My SDG1032X freezes when I run the following:
PyVISA also hangs until I switch off the device. Then I get the following traceback:
There's probably a bug in the Siglent firmware because when I connect the device I see the following output from
dmesg
:(Note the errors in lines 2,3,4)
However it would be nice to have USB communication working with pyvisa-py (it works with NI-VISA under Windows and python-usbtmc on Linux).
Output of pyvisa-info
``` Machine Details: Platform ID: Linux-5.19.0-76051900-generic-x86_64-with-glibc2.35 Processor: x86_64 Python: Implementation: CPython Executable: /usr/bin/python3 Version: 3.10.4 Compiler: GCC 11.2.0 Bits: 64bit Build: Jun 29 2022 12:14:53 (#main) Unicode: UCS4 PyVISA Version: 1.12.0 Backends: ivi: Version: 1.12.0 (bundled with PyVISA) Binary library: Not found py: Version: 0.5.3 ASRL INSTR: Please install PySerial (>=3.0) to use this resource type. No module named 'serial' USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1 USB RAW: Available via PyUSB (1.2.1). Backend: libusb1 TCPIP INSTR: Available TCPIP SOCKET: Available GPIB INSTR: Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of funcionality. No module named 'gpib' ```