#!/usr/bin/env python3 | |
import os | |
import sys | |
try: | |
import usb.core | |
import usb.util | |
except ImportError: | |
print("First, install the pyusb module with PIP or your package manager.") | |
else: | |
if os.geteuid() != 0: | |
print("You need to run this script with sudo") | |
sys.exit() | |
dev = usb.core.find(find_all=True) | |
for d in dev: | |
if d.idVendor == 0x045e and d.idProduct == 0x028e: | |
d.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14) | |
finally: | |
sys.exit() |
@itsSagarBro
Two options.
sudo apt install python3-pyusb
sudo pip3 install pyusb
@amardhruva I have tried the xpad kernel driver and can confirm it fixes the problem without having to run the workaround script.
Thank you! I've tried everything on the net and this fixed my controller being detected but not outputting anything on Kali Linux 6.0.0
Unfortunately this script does nothing in my G-LAB Thorium Gamepad (detected as Shanwan Android gamepad), even when usb ids are 25a7:fa23 :-(
Hi @dnmodder, Could you give me a clue of how to extract the required hex sequence from the wireshark usb capture? I suppose control sequence must be among the Configuration Requests I read in my capture file, but I do not know what values are.
Also works well on Ubuntu Budgie 22.04.3 LTS - Kernel 6.2.0-26-generic
Make sure to sudo apt install python3-usb
first and run the script with sudo
I also have to run xboxdrv
(and let it run) beforehand
You da man
I'm facing the same problem, Please tell me how you managed to fix this issue.