-
Notifications
You must be signed in to change notification settings - Fork 43
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
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type #39
Comments
IE, |
Even with your suggestion, the error still remains. Other solutions? |
without seeing the code in question and/or the resulting datatype being passed to
|
I have the same problem. import hid
vid = 0xFEED# Change it for your device
pid = 0x6060# Change it for your device
h = hid.Device(vid, pid)
h.send_feature_report('\x66\x44') ArgumentError Traceback (most recent call last) ~/anaconda3/lib/python3.6/site-packages/hid/init.py in send_feature_report(self, data) ~/anaconda3/lib/python3.6/site-packages/hid/init.py in __hidcall(self, function, *args, **kwargs) ArgumentError: argument 2: <class 'TypeError'>: wrong type |
can you try |
Here's an example:
I think it would be helpful if something like this was added to the readme @apmorton |
Thank you very much for all your answers, I was able to communicate in another way (without using pyhidapi). I think that for the correct understanding of the functions, adding some examples to the readme like @tunstek suggested could be totally useful. |
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).
Why do I get this error? How can I solve it? Thank you.
The text was updated successfully, but these errors were encountered: