Skip to content

ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type #39

@mikics

Description

@mikics

Hi, I'm trying to use pyhidapi for controlling a Digital Micromirror Device. I'm trying to send to the device its stop command, but I receive the following error:

CRITICAL:root:Unhandled exception:Traceback (most recent call last):
File "C:\Users\OPT\anaconda3\envs\ScopeFoundry\lib\site-packages\ScopeFoundry\hardware.py", line 208, in enable_connection
raise err
File "C:\Users\OPT\anaconda3\envs\ScopeFoundry\lib\site-packages\ScopeFoundry\hardware.py", line 204, in enable_connection
self.connect()
File "D:\LabPrograms\ScopeFoundry_POLIMI\DMD_ScopeFoundry\DMDHardware.py", line 57, in connect
self.dmd.stopsequence()
File "D:\LabPrograms\ScopeFoundry_POLIMI\DMD_ScopeFoundry\DMDDeviceHID.py", line 171, in stopsequence
self.command('w',0x00,0x1a,0x24,[0])
File "D:\LabPrograms\ScopeFoundry_POLIMI\DMD_ScopeFoundry\DMDDeviceHID.py", line 69, in command
self.device.write(buffer)
File "C:\Users\OPT\anaconda3\envs\ScopeFoundry\lib\site-packages\hid_init.py", line 155, in write
return self.__hidcall(hidapi.hid_write, self._dev, data, len(data))
File "C:\Users\OPT\anaconda3\envs\ScopeFoundry\lib\site-packages\hid_init
.py", line 142, in _hidcall
ret = function(*args, **kwargs)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type

The arguments that I pass at ret = function(*args, **kwargs) are in this figure (*args and **kwargs).
image

Why do I get this error? How can I solve it? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions