I have a device, a Bk Precision Power Supply I added to my Ubuntu VM according to the instructions found here: https://github.com/vpatron/bk9201_python_demo
The purpose is to control the power supply via Python. I can't see the device via lsusb and the Python script reflects this. The script lists USB devices and the power supply isn't listed. The script is from the link above:
rm = visa.ResourceManager()
for line in rm.list_resources():
print line
This is what I created, according to the instructions in the link above:
sudo nano /etc/udev/rules.d/22-bk-9200-power-supply.rules
# B&K 920x Power Supply, give read/write permissions to group plugdev
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="ffff", ATTRS{idProduct}=="9200", GROUP="plugdev", MODE="0660"
Here is my dmesg output showing the device connected when unplugged and plugged back in:
[ 76.864850] usb 2-2.2: USB disconnect, device number 4
[ 79.292148] usb 2-2.2: new full-speed USB device number 5 using uhci_hcd
[ 79.572402] usb 2-2.2: New USB device found, idVendor=2ec7, idProduct=9200, bcdDevice= 0.01
[ 79.572403] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 79.572404] usb 2-2.2: Product: 9202B
[ 79.572405] usb 2-2.2: Manufacturer: B&K Precision
[ 79.572405] usb 2-2.2: SerialNumber: 800888011776710025
This is the end of the usb-devices output, showing the pwr supply connected:
T: Bus=02 Lev=02 Prnt=03 Port=01 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=2ec7 ProdID=9200 Rev=00.01
S: Manufacturer=B&K Precision
S: Product=9202B
S: SerialNumber=800888011776710025
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 3 Cls=fe(app. ) Sub=03 Prot=01 Driver=usbtmc
I tried changing the subsystem in the rule to tty instead of USB. No change. I tried changing ownership permissions on the file. No change. I tried adding the rules to another existing rule file: 70-snap.core.rules. No change. The USB device is definitely connected to the VM. I also tried changing the the rule from 0660 to 0666 to gain ful lread/write permissions but no change. It looks like it comes up in lsusb in a full machine (not a vm). When plugged into this machine, while I get lsusb, the power supply is still not recognized by the script. Will have to investigate this as possibly a separate issue.