#!/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() |
@lumin4ry you can use the new xpad driver itself instead of using the script.
(FIXED)when i try to execute the script it tells me to install the pyusb module even tho i installed it already. i don't know whats wrong
I install pyusb then i do "python fixcontroller.py" and then it says ''First, install the pyusb module with PIP or your package manager.''
I was using pythton 2.7 then i switch to python 3.8 and the it worked
If you are using ubuntu try installing using apt. That seems to work for me.
thank you so much for this fix.
Can confirm it makes my USB device 045e:028e work on Ubuntu 20.04 with kernel 5.15.0-52-generic
Both xpad
kernel module and xboxdrv
receive no events from the joystick until I run this fix, and then the controller works fine after.
@Breakthru have you tried using the updated xpad driver?
Try the one in paroj xpad repo with branch fantech. It has all the fixes for the game pad and needs more testing.
(FIXED)when i try to execute the script it tells me to install the pyusb module even tho i installed it already. i don't know whats wrong I install pyusb then i do "python fixcontroller.py" and then it says ''First, install the pyusb module with PIP or your package manager.''
I was using pythton 2.7 then i switch to python 3.8 and the it worked
I'm facing the same problem, Please tell me how you managed to fix this issue.
@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
thank you so much for this