Connecting Playstation 2 Controller via GPIO Pins
-
Hi everyone, I am currently setting up RetroPie on a new Raspberry Pi 5. I have been able to set up and successfully play games. I am now hoping to use an original Playstation 2 controller. I tried to install the "Gamecondriver" package from the RetroPie-Setup script in the "Manage Driver Packages" menu, but it seems that it is not yet available for the RPi5. Has anyone had any success connecting their Playstation controller to an RPi5 via the GPIO pins and using it for RetroPie? I have appropriate jumper wires and I know how to set up pull-up/pull-down resistors, etc. if necessary. Thanks in advance for any help!
-
The gamecondriver indeed has not been made compatible with the Pi5 and it may not work with recent RaspiOS kernels (6.6.x) even for other Pi models. However, the driver does not support the PS2 gamepads/controllers - it's not just a matter of setting up the GPIO communication, but also decoding/encoding the I/O protocol understood by the controller.
My advice is to get a PS2 to USB adapter (like this Raphnet converter, now out-of-stock though) and use it to connect you controller via USB. -
@mitu Thanks for your response. I will have to figure out a different way of connecting it. I am wondering if it would be possible to set up a Python script that would use a library for decoding the SPI protocol for the PS2 controller. Do you think it is feasible to have a Python script that would do so? In the past, I was able to use an Arduino library that could decode I/O from the PS2 controller, but I imagine it is not as easy with the RPi5.
-
@kylen12 said in Connecting Playstation 2 Controller via GPIO Pins:
Do you think it is feasible to have a Python script that would do so?
Probably yes, but I'm not famiiar with the SPI ecosystem on the PI. There's https://github.com/mholgatem/GPIOnext which is a simpler input simulation library (i.e. 1 GPIO line = 1 input/button) and can provide a starting point for the 'virtual' input device creation, but for the SPI part I'm afraid I have no idea.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.