python-ivi / python-usbtmc

Provides a USBTMC driver for controlling instruments over USB
MIT License
162 stars 70 forks source link

Agilent U2701A remains in DFU mode (PID=2818) #42

Open ahmetonat opened 7 years ago

ahmetonat commented 7 years ago

I am trying to get an Agilent U2701A to run under -Ubuntu 16.04, -python 2.7.12, -pyusb V1.0.2. -python-usbtmc V0.8

Executing the commands below, I get:

import usbtmc instr=usbtmc.Instrument(0x0957,0x2818) print(instr.ask("*IDN?"))

Traceback (most recent call last):

File "", line 1, in

File "usbtmc/usbtmc.py", line 770, in ask self.write(message, encoding) File "usbtmc/usbtmc.py", line 750, in write self.write_raw(str(message).encode(encoding)) File "usbtmc/usbtmc.py", line 616, in write_raw self.open() File "usbtmc/usbtmc.py", line 369, in open serial = self.device.serial_number File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 830, in serial_number self._serial_number = util.get_string(self, self.iSerialNumber) File "/usr/local/lib/python2.7/dist-packages/usb/util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

This initializer does not seem to take the device out of DFU mode, as the PID of the device remains at 2818, and does not change to 2918, shown by lsusb after the above.

However, I can get as far as:

print(usbtmc.list_devices()) [<DEVICE ID 0957:2818 on Bus 001 Address 009>]

I have read and followed the issue: "Agilent U2702A USB scope support" But that seems to relate to U2702A, and not U2701A. Could it be that:

  1. U2702A has a different command sequence to take it out of DFU mode than U2701A?
  2. Older firmware version on my scope ignores the code to take it out of DFU mode? (it has sat idle for about 10 years)

It is difficult for me to access a Windows computer, but will do if necessary to get Wireshark report. Thanks for the answers.

Thanks for any answers.