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

No steup.py #8

Open
Eheran1 opened this issue Mar 20, 2023 · 1 comment
Open

No steup.py #8

Eheran1 opened this issue Mar 20, 2023 · 1 comment

Comments

@Eheran1
Copy link

Eheran1 commented Mar 20, 2023

How to install this library?

Command:
pip install git+https://github.com/ljakob/unit_ut61eplus.git

Result:
ERROR: git+https://github.com/ljakob/unit_ut61eplus.git does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

@Eheran1
Copy link
Author

Eheran1 commented Mar 31, 2023

Step 1: Download the library as .zip
Step 2: Extract in your working directory
Step 3: In your code you need to add this due to the non-installability of the library:

import sys
sys.path.append('C:/...working directory...')

So you can do step 4: from ut61eplus import UT61EPLUS

Step 5: Fix library:
A) import ctypes instead of from glibc import ctypes
B)

    def _readResponse(self) -> bytes:
        # pylint: disable=unsupported-assignment-operation,unsubscriptable-object
        state = 0  # 0=init 1=0xAB received 2=0xCD received 3=we have length
        data = bytes()
        buf: bytes = None
        index: int = None
        sum: int = 0
        numbytes = 19 # always read 19 Bytes https://www.mikrocontroller.net/attachment/556567/UT161B.pdf
        while True:
            # read data in bytes of 2 (1. is HID lenght, which always ready 1, so only one more byte after that)
            for i in range(0, numbytes): # 19 byte-pairs in total to read
                bytes_read = self.dev.read(2)
                data += bytes_read[1:] # discard the HID-lenght byte, we only need the 2. Byte with data
            
            # parse data
            b: int
            for b in data:

C) All of the bugs from here

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

1 participant