Startup Instructions:
Required software: Linux Ubuntu 22.04 and Docker 20.10.
Hardware:
-
Plug a USB mouse into your computer
-
Run $lsusb in the terminal. Find your mouse listed and take note of its Bus and Device number.
-
Run $lsusb -D /dev/bus/usb/<YOUR MOUSE'S BUS ID>/<YOUR MOUSE'S DEVICE ID>. This will give you information about the device, including its vendor ID and product ID. You will need the vendor ID and product ID later on.
-
cd to /dev/input/by-id and run $ls. Find and take note of your device name, you will need it later on.
Software:
- Clone this repo
- Open src/usbMouseTest.py and edit the idVendor and idProduct to be the same as the output from step 3 in the Hardware steps.
- Open docker/docker-compose.yml and replace "usb-SINOWEALTH_Game_Mouse-if01-event-kbd" with the name of your device from step 4 in the Hardware steps (Note: "usb-SINOWEALTH_Game_Mouse-if01-event-kbd" occurs twice in the dockerfile, replace both occurances with your device name).
- cd into docker_usb_test/docker
- Run $docker compose up -d to build the container
- Run $docker exec -it docker-docker_usb_test-1 bash to enter the container
- cd into src and run python3 useMouseTest.py. As it runs, jiggle your mouse around.
- You will see a bytestream of data print out to the terminal in a few seconds. If you do not jiggle your mouse, the read process may time out.