USB – Device serial number
With this python script you can retrieve serialnumber from USB devices (if present), you need to install pyusb first:
sudo pip install pyusb
Please note: You must run the python script with SUDO in front, otherwise you have no access to the devices and may result in an error!
1 2 3 4 5 6 |
import usb # Get HID serialnumber dev = usb.core.find(idVendor=0x1eab, idProduct=0x1a22) serial = usb.util.get_string(dev, dev.iSerialNumber) print "serial: " + serial |