Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oserror open failed. #9

Open
hippylover opened this issue Aug 20, 2023 · 1 comment
Open

oserror open failed. #9

hippylover opened this issue Aug 20, 2023 · 1 comment

Comments

@hippylover
Copy link

02:09:26 kris ~/unit_ut61eplus-main $ python readDMM.py 
Traceback (most recent call last):
  File "/home/kris/unit_ut61eplus-main/readDMM.py", line 9, in <module>
    dmm = UT61EPLUS()
          ^^^^^^^^^^^
  File "/home/kris/unit_ut61eplus-main/ut61eplus/ut61eplus.py", line 313, in __init__
    self.dev.open(self.CP2110_VID, self.CP2110_PID)
  File "hid.pyx", line 142, in hid.device.open
OSError: open failed

i have the library installed https://github.com/trezor/cython-hidapi through archlinux package manager

@euandekock
Copy link

There are a couple of potential issues here.

1: Permissions, try running it with sudo to check if it works then. If it does, then you need to add a rule to your udev system to give normal users permission.

Add a file in /etc/udev/rules.d
EG: /etc/udev/rules.d/99-unit-ut61e-plus-udev.rules

And put in the following lines:

# Uni-T UT61E+ CP2110 HID Device
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea80", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"

or in my case (See 2 below):

# Uni-T UT61E+ CP2110 HID Device
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e429", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"

2: The USB Vendor and Product are different. I just received my Uni-T UT61E+ today, and it has a different vendor and product info from that in the code.

Use the lsusb command to see what devioces are plugged in:

lsusb

...
Bus 003 Device 009: ID 1a86:e429 QinHeng Electronics WCH UART TO KB-MS_V1.6
...

If your vendor and product numbers are different to the default values, you will need to edit the python file in ut61eplus/ut61eplus.py and change these variables to match your unit, and make sure that the option 1 values match the vendor and product.

class UT61EPLUS:

    #CP2110_VID = 0x10c4
    #CP2110_PID = 0xEA80
    CP2110_VID = 0x1A86
    CP2110_PID = 0xE429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants