-
Notifications
You must be signed in to change notification settings - Fork 0
USB Static Setup
This step is optional as it is slightly more difficult and there may be some variance depending on the hardware used. In step ‘3C' of the Installation Guide, it is explained that the user must manually confirm the reader map and the location of the corresponding readers before starting as they may change if they are unplugged. In order to make sure the readers and reader map always map to each other correctly, one can assign static USB names. If the following steps are completed the user need not worry about checking the reader map in the future , so long as it is done correctly.
Start with all readers unplugged.
-
Plug first reader in and run command $ udevadm info --name=/dev/tty/USB0 You will see all information associated with whatever device is currently USB0
-
Keep results from step 1 open, plug in another reader and this time run $ udevadm info –name=/dev/tty/USB1, keeping the results
-
Now, you must cross reference the results from the first two commands, there should be a couple attributes that are same. In our case {idVendor} and {idProduct} were the same for both rfid readers steps 1 and 2. We will use this combination of idVendor and idProduct later.
-
Again, you must cross reference the results from steps 1 and 2, this time looking for an attribute that is present in both usb0 and usb1 but holds DIFFERENT values. We selected {serial}. This will be used to discriminate between readers
-
At this point you should have identified the following: Two attributes that are the same on every reader {idVendor} and {idProduct} and one attribute that is unique to every reader {serial}
-
Find the {serial} of all remaining readers using the above method
-
Now create the following file if it doesn’t exist: /etc/udev/rules.d/99-usb-serial.rules
And add this line:
SUBSYSTEM=="tty", ATTRS{idVendor}=="", ATTRS{idProduct}=="", ATTRS{serial}=="", SYMLINK+="BottomRight"
Filling in the blank double quotes with each attribute of one of your associated readers. Symlink is just a nicknamed for the reader. We use TopL topR bottomL botomR because our readers are placed in the corners. This must be done four times (one for each reader)
-
To load the changes Run the command $ sudo udevadm trigger
-
To verify this worked $ ls -l /dev/ | greb USB
If it worked, you should see that all devices (USB0, USB1, USB2, USB3) Are pointed too by their associated nickname/symlink Now simply change lines 39-42 in record.py replacing “/dev/…” with your symlinks in quotes. If further details are needed see this: https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name