Thorlabs MDT69xx USB Configuration¶
Problem
The USB chip in the Thorlabs MDT69xx series (e.g., MDT693B) may identify as a Human Interface Device (HID).
If the usbhid kernel driver binds to it, the device cannot be accessed via a serial interface, rendering it non-functional.
Solution: udev Rule
Identify Vendor and Product IDs
Run the following command to list all USB devices and locate the Thorlabs device:
lsusbExample output:
Bus 001 Device 003: ID xxxx:xxxx Thorlabs MDT693B
Note the
xxxxvalues foridVendorandidProduct.Find the USB Kernel Path
Use
udevadmto inspect the device attributes and locate the kernel path (e.g.,1-8:1.0):udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/XXX/YYY)
Replace
XXXandYYYwith the bus and device numbers fromlsusb. This command will print a lot of information. You are looking for a line like:looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/0003:046A:B090.0002/hidraw/hidraw1':
Here, the
1-8:1.0is what you are looking for.Create the udev Rule
Edit or create a new udev rules file (e.g.,
/etc/udev/rules.d/99-thorlabs-piezo.rules) and add the following rule:# Thorlabs piezo controller MDT693B ACTION=="add", DRIVERS=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx", SYMLINK+="USB_PIEZO_CTRL_1", RUN+="echo -n 'kernel_path' > /sys/bus/usb/drivers/usbhid/unbind"
Replace:
xxxxwith the Vendor and Product IDs from Step 1.kernel_pathwith the USB kernel path from Step 2 (e.g.,1-5.1.2.3:1.0).
Reload udev Rules
Apply the changes by reloading the udev rules:
sudo udevadm control --reload-rules sudo udevadm trigger --action add