question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Error: The device has no langid"

See original GitHub issue

I am attempting to connect to a Tektronix DPO 2002B oscilloscope using PyVISA and PyUSB, and when I attempt to run:

address = 'USB0::0x0699::0x0399::<serial>::INSTR'

import visa #import pyVISA
rm = visa.ResourceManager('@py')

print rm.list_resources()
#scope = rm.open_resource(address) #open the oscilloscope
#print scope.query('*IDN?')

I get the error of:

Traceback (most recent call last):

  File "<ipython-input-3-8d9e627f2f5d>", line 1, in <module>
    runfile('/home/iago/Documents/Code/test_connection_tektronix.py', wdir='/home/iago/Documents/Code')

  File "/home/iago/anaconda2/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile
    execfile(filename, namespace)

  File "/home/iago/anaconda2/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 81, in execfile
    builtins.execfile(filename, *where)

  File "/home/iago/Documents/Code/test_connection_tektronix.py", line 20, in <module>
    print rm.list_resources()

  File "/home/iago/anaconda2/lib/python2.7/site-packages/pyvisa/highlevel.py", line 1560, in list_resources
    return self.visalib.list_resources(self.session, query)

  File "/home/iago/anaconda2/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 231, in list_resources
    for key, st in sessions.Session.iter_valid_session_classes()], [])

  File "/home/iago/anaconda2/lib/python2.7/site-packages/pyvisa-py/usb.py", line 169, in list_resources
    serial_number=dev.serial_number,

  File "/home/iago/anaconda2/lib/python2.7/site-packages/usb/core.py", line 830, in serial_number
    self._serial_number = util.get_string(self, self.iSerialNumber)

  File "/home/iago/anaconda2/lib/python2.7/site-packages/usb/util.py", line 315, in get_string
    raise ValueError("The device has no langid")

ValueError: The device has no langid

This same problem arises from attempting to use open_resource(address) I was able to successfully connect to a LeCroy oscilloscope over TCP/IP, which leads me to believe there is likely an issue with the langid element from PyVISA, since in the file “util.py” in PyUSB, the value of dev.langids is empty (called in line 311).

Thank you for your help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
rakanshacommented, Jun 29, 2016

When I edited a file, infact created a file “99-garmin.rules” in /etc/udev/rules.d , with the following content: SUBSYSTEM==“usb”, MODE=“0666”, GROUP=“usbusers” I no longer got the same error

0reactions
MatthieuDartiailhcommented, Sep 6, 2020

This is now documented in PyVISA-py

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: The device has no langid · Issue #139 - GitHub
The most common cause for ValueError: The device has no langid is simply lack of permission to access the device. Try running your...
Read more >
The device has no langid - ChipWhisperer Software
Basically, it means that Windows can see and do all the USB setup it needs for the device, but it won't let libusb...
Read more >
Troubleshooting — PyFtdi documentation - GitHub Pages
“Error: The device has no langid”¶. On Linux, it usually comes from the same installation issue as the Access denied error: the current...
Read more >
The device has no langid - pyusb-users@lists.sourceforge.net
Hi, I am a user of pyOCD, and I am having an issue related to pyusb which is what the former uses for...
Read more >
ws28xx: ValueError: The device has no langid (debian in LXC)
I've just tried to get my ws28xx running on a debian installation running in a LXC on a QNAP NAS. dmesg shows the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found