Skip to content

add support for MonogramCC devices #2

@thattommyhall

Description

@thattommyhall
Bus 001 Device 013: ID 0483:a2c5 STMicroelectronics Monogram Core Module

I tried setting it in ambit/controller

 class Device:
     def __init__(self, device_id, interface_id, index=0):
         vendor_id, product_id = device_id.split(':')
-        self.vendor_id = int(vendor_id, 16)
-        self.product_id = int(product_id, 16)
+        # self.vendor_id = int(vendor_id, 16)
+        # self.product_id = int(product_id, 16)
+        self.vendor_id = int("0483", 16)
+        self.product_id = int("a2c5", 16)

but then I get an error from pyusb

❯ ambit_console
[0] Choosing device at USB discovery index 0.
[0] Waiting for initial layout ...
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/core.py", line 223, in get_interface_and_endpoint
    return self._ep_info[endpoint_address]
KeyError: 5

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/home/thattommyhall/Dropbox/Projects/ambit/ambit/controller.py", line 264, in bulk_write_worker
    self.bulk_write(data)
  File "/home/thattommyhall/Dropbox/Projects/ambit/ambit/controller.py", line 277, in bulk_write
    self.handle.bulkWrite(
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/legacy.py", line 154, in bulkWrite
    return self.dev.write(endpoint, buffer, timeout)
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/core.py", line 940, in write
    intf, ep = self._ctx.setup_request(self, endpoint)
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/core.py", line 215, in setup_request
    intf, ep = self.get_interface_and_endpoint(device, endpoint_address)
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "/home/thattommyhall/Dropbox/Projects/ambit/.direnv/python-3.9.7/lib/python3.9/site-packages/usb/core.py", line 231, in get_interface_and_endpoint
    raise ValueError('Invalid endpoint address ' + hex(endpoint_address))
ValueError: Invalid endpoint address 0x5

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions