Many PS4 drivers may know this:
U have an expensive wheel at home which refuses to work on PS4. In my case it's a Logitech G27 wheel.
But thanks to @Matlo's amazing project 'Gimx' there's a solution to that problem.
In this tutorial i'll focus on G27 connected to PS4 through a Raspberry Pi (powerd by PS4) using a minimal amount of hardware and cables.
(I'll tell you which changes are needed for other wheels at the appropiate parts of the tutorial)
I've succesfully tested this on a Pi1 and a Pi3 as well !
The tutorial looks very long on first view... but that's because my intention was to make it noob proved as much as possible and therefore it's very detailed... and long.
The advanced users might forgive me that.
OK... LET'S GET STARTED !
A) NEEDED HARDWARE
1. 'Raspberry Pi' (let's call it just 'Pi') + Case + PSU + SD-Card(>=4GB)
(All available Pi modells(with the exception of the 'Pi Zero') should work... I'm using the old modell B)
2. A 'Teensy 2.0' or 'Teensy++ 2.0' let's call it just 'Teensy') - ATTENTION: Teensy 3.0 isn't compatible !
_ (A 'Teensy' is kind of a Micro-PC... I have 'Teensy++ 2.0')
3. Wheel Logitech G27
4. Dualshock 4 Controller
5. HDMI-cable, USB-to-MiniUSB cable, USB-to-MicroUSB cable
6. A 2.2 kOhm and a 3.3 kOhm resistor
7. A 3-way and two 2-way '2.54mm 1 Row Straight PCB Socket Through Hole Socket Strip' ->
8. A push button ->
9. A soldering iron for electronics, 6 colored cables, solder with flux core
10.Hot glue gun
The above resistor combination is just a suggestion. In fact u can use any combination of resitors as long as their values divides as about 3:2.
But u always have to connect the smaller one to the GND solder point of the 'Teensy'
Note 2 (for the ones who wanna now WHY):
Background for the usage of the 2 resistors is that the 'Teensy' outputs 5V signals while the 'Pi' expects 3.3V signals on it's input.
To avoid that the 'Pi' gets damaged through the 'overvoltage' 2 resistors (connected in row) are used to divide the voltage (5V/3.3V~3:2)
B) NEEDED SKILLS
2. EVEN MORE PATIENCE
3. Minimal solder skills
4. No fear to fight a bit with Linux on command line (i assume i'm by far not a linux expert as well)
C) NEEDED SOFTWARE
Software for 'Teensy'
1. 'Teensy Loader App' -> http://www.pjrc.com/teensy/teensy.exe
2. Gimx-Firmware for the 'Teensy' -> https://github.com/matlo/GIMX-firmwares/releases/latest
Software for 'Pi'
1. 'Win32 Disk Imager' -> https://sourceforge.net/settings/mirror ... nstall.exe
2. 'Raspian Jessie Light' -> https://www.raspberrypi.org/downloads/raspbian/
3. 'Putty' -> https://the.earth.li/~sgtatham/putty/la ... /putty.exe
HARDWARE PART I
1. Put some solder on the connectors of the Socket Strips
2. Strip the ends of the 4 colored cables and put some solder on them
3. Here's a picture of what needs to be soldered:
ATTENTION: The labeling of the resistors on the picture are swapped by mistake ! (thx @htusa31 and @matlo for the hint)
a) Put the black(GND), red(D2) and orange(+5V/VCC) cable through the holes from frontside and solder them on backside.
b) Solder the 3.3 kOhm resistor at the solder point of the black cable
c) Solder the 2.2 kOhm resistor at D3 solder point of the 'Teensy'
d) Solder the 2 resistors at where they cross
e) Solder the white cable to the crossing point.
f) Put some tape under the crossing point to avoid electrical shortcuts
g) Solder the cables to the Socket Strips (Make sure u use the same color order like in picture)
Note: I'll explain why the orange cable is optional later
THE "Shutdown Button"
1. Solder 2 cables to the connectors of the push button (blue & gray in picture... see Section G)
2. Solder the other ends of the 2 cables to a 2-way socket strip
E) FLASHING THE 'Teensy'
1. Connect the 'Teensy' via USB-to-MiniUSB cable with PC and wait until driver is installed
2. Start the 'Teensy Loader App'
3. You'll see a window with a greyed out picture of the 'Teensy'
4. Now press the little button on the 'Teensy' and the picture gets solid (='Teensy' is now in flash-mode)
5. From the firmware download for the 'Teensy' open up the 'EMUG29PS4'-folder
6a.For 'Teensy 2.0' : Drag'n'drop the 'atmega32u4.hex'-file onto the picture of the 'Teensy'.
6b.For 'Teensy++ 2.0' : Drag'n'drop the 'at90usb1286.hex'-file onto the picture of the 'Teensy'.
__(You should see the filename of the '*.hex'-file at the lower part of the window)
7. Press the down pointing green arrow button to flash the 'Teensy'
__(You should now see a 'Download Complete' at the lower part of the window)
8. Press the right pointing green arrow button to reboot the 'Teensy'
9. Close 'Teensy Loader App' and disconnect 'Teensy' from PC
F) SETTING UP THE 'Pi'
Because this part makes a lot of work i advise you only start this when u have enough time!
Alternativly here's an ready-to-flash image of my SD:
A 2GB SD card is required at least and u need to
- expand the file system via 'sudo raspi-config'
- change the ethernet-config to fit your local network (check chapter "GIVING 'Pi' A STATIC IP" below) .
FLASHING 'RASPIAN'-IMAGE TO SD
1. Place the SD in the cardreader on PC and start 'Win32 Disk Imager'
2. Click on the little folder symbol and select the 'xxxx-xx-xx-raspbian-jessie-lite.img'-file
3. Select the correct drive letter for your SD under 'Device' (in most cases it's already selected)
4. Click the 'Write'-button and wait until the image has been written to SD
5. Close 'Win32 Disk Imager' and remove SD
CONNECTING 'Pi' FOR SETUP PROCEDURE
1. Place SD into card slot on the 'Pi'
2. Connect the 'Pi' via HDMI-cable with your TV (or monitor or whatever u might use) and select the correct channel.
3. Connect the 'Pi' via network-cable with your home network
4. Connect the 'Pi'-PSU with the 'Pi'
5. Now the 'Pi' boots showing a lot of text output
6. Wait until this constant flow of messages comes to an end and u see the login prompt
CONTROLLING 'Pi' VIA PC
All of the following can also be done via a keyboard connected to the 'Pi'. But in this case u have to type in everthing instead of using copy'n'paste as described in the appendix.
And this is pretty to much work and also a unneeded source of producing failures.
1. At around the middle of your screen u'll see a line 'My IP address is 192.168.x.y' ... Remember this IP-address !
2. Start 'Putty' at PC
3. At 'Host Name (or IP address)' enter the IP-address
4. At 'Saved Sessions' enter a name for the 'Pi' (eg 'XIMP Pi') and click the 'Save'-button
5. Double click at 'XIMP Pi' and confirm the following message window
6. You will now see a DOS-like window and you need to enter login and password (pi & raspberry)
__(Keep in mind that Linux differs between capital and small letters !)
7. Now you can enter commands (For Linux noobs i advice to now have a look at the APPENDIX at the lower part of the tutorial)
GIVING 'Pi' A STATIC IP
Each time you boot the 'Pi' it get's an IP from your router. But this IP might not always be the same and because of this you need to have a look which IP it has gotten each time you boot it up
and enter the new IP in 'Putty' so it can successfully establish a connection.
Because this is very ugly it's nessessary to give the 'Pi' a static IP.
1. Finding Gateway-IP(=Router-IP) : Enter "route -n" -> You'll see your Gateway-IP in the first line (eg 192.168.1.1)
2. "sudo nano /etc/network/interfaces"
3. Replace the line "iface eth0 inet manual" with this:
Code: Select all
# Ethernet auto etho allow-hotplug eth0 iface eth0 inet static address <Pi-IP> netmask 255.255.255.0 gateway <Gateway-IP> dns-nameservers 18.104.22.168
__Replace '<Gateway-IP>' with your Gateway-IP (see above)
4. Save and quit (see APPENDIX)
5. To disable the DHCP-client and TriggerHappy services enter the following commands one by one:
Code: Select all
sudo service dhcpcd stop sudo systemctl disable dhcpcd sudo service triggerhappy stop sudo update-rc.d triggerhappy disable sudo reboot
1. "sudo raspi-config"
2. Select 'Advanced Options' -> 'A8 Serial' -> 'No' -> 'Ok'
3. 'Finish' -> 'Yes'
4. Wait for reboot and log into 'Pi' with 'Putty'
5. To fully update the 'Pi' enter the following commands one by one:
Code: Select all
sudo apt-get update && sudo apt-get upgrade sudo apt-get install rpi-update sudo rpi-update sudo reboot
6. Wait for reboot and log into 'Pi' with 'Putty'
7. "sudo nano /boot/config.txt"
8. Scroll down to the very end and just above the line 'enable_uart=0' insert the line 'dtoverlay=pi3-disable-bt'
9. Change the line 'enable_uart=0' to 'enable_uart=1'
10.Add 'init_uart_clock=8000000' just below the line 'enable_uart=1'
11.Save and quit
INSTALL 'GIMX' AND MAKE IT AUTOSTART
1. Enter the following commands one by one:
Code: Select all
wget http://gimx.fr/download/gimx-raspbian -O gimx.deb sudo sudo dpkg -i gimx.deb sudo apt-get -f install sudo nano /etc/systemd/system/gimx.service
2. Insert the following text block via copy'n'paste:
Code: Select all
[Unit] Description=GIMX After=syslog.target network.target [Service] User=pi Type=simple ExecStart=/usr/bin/gimx -p /dev/ttyAMA0 -c LogitechG27_G29.xml --nograb Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
4. "sudo systemctl daemon-reload"
5. "sudo systemctl enable gimx && sudo systemctl start gimx"
1. In order to add the appropiate wheel configuration enter the following commands one by one:
Code: Select all
cd /home/pi mkdir .gimx cd .gimx mkdir config cd config sudo nano LogitechG27_G29.xml
3. Mark the text from '<?xml version="1.0" encoding="UTF-8"?>' to '</root>' and copy'n'paste it to the 'nano'-window
4. Save and quit
If you would like to use another wheel then have a look at https://github.com/matlo/GIMX-configura ... ster/Linux.
Here u'll find configuration files for other wheels. Look for files ending with 'G29.xml'.
You'll need to change the following lines in the tutorial:
- 'sudo nano LogitechG27_G29.xml'
- 'ExecStart=/usr/bin/gimx -p /dev/ttyAMA0 -c LogitechG27_G29.xml --nograb'
SHUTDOWN THROUGH BUTTON
It's not a good idea to cut off power from the 'Pi' because sooner or later this will kill your SD.
To prevent this we'll use a 'Shutdown Button' to power down the 'Pi' savely.
1. In order to create a small python script for shutting down the 'Pi' when 'Shutdown Button' is pressed enter the following commands one by one:
Code: Select all
cd /home/pi mkdir Scripts cd Scripts sudo nano shutdown_pi.py
Code: Select all
#!/bin/python # Simple script for shutting down the raspberry Pi at the press of a button. # by Inderpreet Singh import RPi.GPIO as GPIO import time import os # Use the Broadcom SOC Pin numbers # Setup the Pin with Internal pullups enabled and PIN in reading mode. GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.IN, pull_up_down = GPIO.PUD_UP) # Our function on what to do when the button is pressed def Shutdown(channel): os.system("sudo init 0") # Add our function to execute when the button pressed event happens GPIO.add_event_detect(18, GPIO.FALLING, callback = Shutdown, bouncetime = 2000) # Now wait! while 1: time.sleep(1)
4. "sudo nano /etc/rc.local"
5. Scroll down and just before the line "#fi' insert a new line : "sudo python /home/pi/Scripts/shutdown_pi.py &"
6. Save and quit
7. "sudo init 0" (This command will shut down the 'Pi')
After step 3 i recommend to try the shutdown script (before putting it in autostart) with : "sudo python /home/pi/Scripts/shutdown_pi.py".
Of course u need to connect at least the shutdown button to the 'Pi' (see section G)
HARDWARE PART II:
G) PUTTING EVERYTHING TOGETHER
'Teensy' connected with GPIO of the 'Pi'
The row of pins at the edge of 'Pi' PCB are enumerated with even the numbers 2,4,6... starting at the 'corner' (top left in the picture)
Code: Select all
+----+--------+--------+ | Pi | Teensy | Kabel | +----+--------+--------+ | 2 | +5V | orange | | 6 | GND | black | | 8 | D2 | red | | 10 | X | white | +----+--------+--------+ X = Crossing point of the 2 resistors
This shows the 'Teensy' clued to the case top of the 'Pi' (Make a hole for the MiniUSB-connector of the 'Teensy' first)
"Shutdown Button" connected to pin 12 and 14 of 'Pi' GPIO via blue and gray cable
Everything's ready... you see the default power connector of the 'Pi and above it u see the MiniUSB-connector of the 'Teensy'
Some of the pics are older ones and that's why there's no "Shutdown Button"
POWERING VIA PS4... ARE YOU SERIOUS ?
Some might ask themself if this isn't to much for a PS4, but the PS4 has USB3 which is capable to provide up to 900mA. Even a Pi3 uses only ~750mA on full load of the 4 cores.
I'm pretty sure GIMX is far far away from producing such a heavy load and/or uses all 4 cores. Also the connected USB devices (wheel and DS4) will not drain much power if any.
But anyway... if you don't like that idea you can simply unplug the orange cable from the 'Pi' and power it up using the PSU.
H) HOW TO USE
1. Power off PS4
2. Connect the 'Pi' via USB with your wheel and a DS4
3. Connect the 'Pi' via 'Teensy'-MiniUSB-connector with PS4
4. Power on PS4
5. Now focus on DS4's LED until it flashes yellow (this might take around 2-3 minutes)
6. Now press the leftmost orange button on the wheel (=PS-button)
7. Now you sould be able to navigate through PS4's menu with wheels D-pad and even all other buttons should be functional
8. Press the "Shutdown Button" and wait until only red LED on the 'Pi' is on. Then shutdown PS4
COPY AND PASTE
Differences and Cooperations of Copy'n'Paste at Windows and Linux:
- Windows: I assume everbody here nows how Copy'n'Paste is done at windows
- Linux: 'Copy' = Mark text / 'Paste'= Right mouse click
If u like to copy'n'paste the text 'Rudi is stupid' into the commandline at 'Putty' then...
Mark the text 'Rudi is stupid' -> right mouse click on marked text -> 'Copy' -> right mouse click at 'Putty'-console window
!!! Doing so u can copy'n'paste everything in the tutorial !!!
(You can also use this technique the other way around)
WORKING WITH 'nano' TEXTEDITOR
- Copy'n'Paste : Works here the same as described above
- Move cursor : Use cursor keys
- Save text and quit 'nano' : Press 'Strg' + 'x' -> 'Y' -> 'ENTER'
_(Do this if tutorial tells you to 'Save and quit')
@Everyone using this tutorial:
I've thought about providing a SD card image... but my upload bandwidth is soooo lame i regret from this idea.
So... if anyone can do this i guess it would be much appreciated by the community. (But leave out the 'static ip'-part because your ip most likely doesn't work in others network)
When everything is working for you i STRONGLY advice to make a backup of the SD with 'Win32 Disk Imager'
When trying to power the 'Pi' via Teensy with only a USB-PSU (instead of a PS4) the 'Pi' refuses to boot... have no idea why !?
So... if u wanna boot without PS4 power it through the "normal" Pi-MicroUSB-Port.
As a last word let me say :
BIG THX TO @Matlo FOR HIS AMAZING TOOL
Also THX to @cortega1 for helping me finding some misspellings and failures in the tutorial. His videos inspired me... check it out here: http://gimx.fr/forum/viewtopic.php?f=10&t=1675