Startup Instructions:

Required software: Linux Ubuntu 22.04 and Docker 20.10.

Hardware:

  1. Plug a USB mouse into your computer

  2. Run $lsusb in the terminal. Find your mouse listed and take note of its Bus and Device number. image

  3. 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. image

  4. cd to /dev/input/by-id and run $ls. Find and take note of your device name, you will need it later on. image

Software:

  1. Clone this repo
  2. Open src/usbMouseTest.py and edit the idVendor and idProduct to be the same as the output from step 3 in the Hardware steps.
  3. 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).
  4. cd into docker_usb_test/docker
  5. Run $docker compose up -d to build the container
  6. Run $docker exec -it docker-docker_usb_test-1 bash to enter the container
  7. cd into src and run python3 useMouseTest.py. As it runs, jiggle your mouse around.
  8. 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.