Simple HID communication with concept2 PM3 (macOS)
Posted: December 26th, 2023, 1:11 pm
I've tried a few commands without success to interface between my mac and a concept 3 PM3 connected to it. I can succesfully retrieve manufacturer, product, serial number but writing a command like 0x80 or 0x91 seems to return nothing. Am I missing something trivial? This is my code:
Code: Select all
import hid
from time import sleep
# List all connected HID devices
for device_dict in hid.enumerate():
keys = list(device_dict.keys())
keys.sort()
for key in keys:
print(f"{key}: {device_dict[key]}")
print()
vendor_id = 0x17a4
product_id = 0x0001
data = [0x91]
try:
with hid.Device(vendor_id, product_id) as h:
print(f'Device manufacturer: {h.manufacturer}')
print(f'Product: {h.product}')
print(f'Serial Number: {h.serial}')
h.write(bytes(data))
sleep(0.1)
data = h.read(64, timeout=1000)
if data:
print(data)
except Exception as e:
print(e)