Arduino only-based adapter (no PC needed)

Discuss everything to do with GIMX here
Post Reply
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Arduino only-based adapter (no PC needed)

Post by ThijsNL »

Hey,

First of all, big thanks to matlo creating this great piece of software!

After playing around with GIMX, it works perfectly for my Logitech Driving Force GT (G29 emulated) for F1 2018 on my PS4.
However, it was not very portable to my home TV. I thought a raspberry pi would solve the problem, but too many libusb timeouts
caused my forcefeedback to glitch as force did not reset to normal e.g.

Therefore i would think if it would be possible to make an Arduino only variant using the GIMX code from matlo, and having a working solution.
Perhaps if there is interest, i can tidy up the sources and put them online so anyone can make benefit of it (if matlo agrees).

Ingredients:

- Arduino atmega32u4 board (pro micro/leonardo) 16MHz/5V
- USB Host shield (or another board having a MAX3421E USB to SPI chip)
- Arduino one of the latest version (i am using 1.8.5)
- LUFA for Arduino (https://github.com/Palatis/Arduino-Lufa)
- USB Host shield library by Oleg Mazurov (Circuits@Home)
- GIMX Firmware sources from matlo (https://github.com/matlo/GIMX-firmwares)
- USB HUB (you need two ports, one for the wheel and another for the PS4 controller)

I cloned the G29EMUPS4 files, stripped the UART commands and implemented the USB Host function. I also had to rewrite a Serial class for debugging, as the Arduino stock serial class did not work for me using the LUFA library (it replaces some USB stacks in Arduino, probably also the HW serial port)

Currently working:
- Wheel is working on PS4, all buttons and pedals working
- Authenticate trough genuine controller
- PS4 Detects G29 wheel (Active with PS button)
- Driving Force GT wheel initiation working (exit compatible mode, enter Force GT mode)
- USB Hub support
- Mapping the buttons from DFGT to G29 report
- Forcefeedback working (thanks to the Logitech_Force_Feedback_Protocol_V1.5.pdf)

TODO:

- Allow configurations from GIMX configuration editor (COULD have)
- Allow other devices then Driving Force GT (or logitech wheels) (COULD HAVE)

Some pictures:
Image

And a video:


Image


-
Last edited by ThijsNL on Fri May 10, 2019 12:44 pm, edited 1 time in total.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Arduino only-based adapter (no PC needed)

Post by Matlo »

Well done :)
GIMX creator
Cybereu
Posts: 182
Joined: Sun Jul 10, 2011 1:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Cybereu »

Very nice project !
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

Thank you,

I will post an update once i get the Authentication thing done,
and make it also compatible with a Hori FPS pad. (got that one secondhand for 10 euro).

kind regards,

Mathijs
User avatar
bad_bo
Posts: 44
Joined: Wed Nov 16, 2016 5:14 pm
Location: Canada

Re: Arduino only-based adapter (no PC needed)

Post by bad_bo »

After so long of not playing on on my wheel on my PS4, and given that I moved my console to another area, is not easy to have a laptop or PC nearby, I am glad to see that there may be a GIMX lite version. Awesome!
So you you will be providing a tutorial for this, after you get permission and define your "to do" list?
thanks
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

ThijsNL
This is awesome :D I was wondering about if it was possible.

now im wondering about, if there's an stm32 (or other) Ic with 3 usb ports, i know that some stm32's have 2 ports, but i think it would be neat to have it all contained within one single mcu.

Other than that, how did you get it to work without the authentication being done?
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

Hey,

Got some update about the authentication.. I think i got it working!
Need to verify, but the challenge keeps repeating with incrementing counters.

UPDATE: Its verified working. After 255 minutes (Sequence counter 0xFF), still communication.
However this is with the Sony PS4 Controller (v2 that came with slim PS4).
My Hori pad FPS 4 somehow bails out after 17 minutes (Sequence counter 0x11)

Code: Select all

[PS4AuthDevice GetReport] Got 0xF1 report request SEQ=FF REP=0F
GetReport request F1 (need to spoof)
[PS4AuthDevice GetReport] Got 0xF1 report request SEQ=FF REP=10
GetReport request F1 (need to spoof)
[PS4AuthDevice GetReport] Got 0xF1 report request SEQ=FF REP=11
GetReport request F1 (need to spoof)
[PS4AuthDevice GetReport] Got 0xF1 report request SEQ=FF REP=12
GetReport request F1 (need to spoof)
GetReport request F3
SetReport request F0 (auth)
[PS4AuthDevice SetReport] Got 0xF0 report SEQ=00 REP=00
F0 00 00 00 96 1E 7D 22 19 35 83 57 AA C7 89 BC
57 02 E3 53 12 D8 DE 5B F0 2B 1E D0 FC 07 1D 19
90 27 F6 A3 7B 30 03 D1 12 E6 05 50 BC 09 A0 87
A0 14 D7 47 6B 49 50 D0 EC 8D 85 E6 E1 76 F5 68
Image

@Mysli0210: You can ignore the authentication challenge for a while (and be able to play a game), but the PS4 stops listening to your controller after ~ 8 minutes.

Also, a STM32 or LPC would work if it got at least one USB peripheral and one or two USB Host controller(s). There are quite rare to find (for normal prices).

For simplicity and pricing, i thought this Arduino leonardo/USB host shield would do the trick.
Last edited by ThijsNL on Fri May 10, 2019 4:12 pm, edited 4 times in total.
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

Wow that is awesome news!

i'll try to search the internet for an stm that does exactly just that :D
however could 2 of them connected via uart serve the same purpose?

BTW, the USB host shield, is that just connected to the ordinary io pins of the leonardo? ie. software usb?
Nevermind, i found out. its not :P

I found this:
https://www.aliexpress.com/item/Mini-US ... 97236.html

Could it maybe be paired with a pro micro, for a very small package?
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

Yes, i got both the pro micro and this usb shield as well. They are the same, but smaller package than the picture in my first post. They should be pin compatible, however, they dont seem to be stackable quite easilly.

Perhaps i'll design a PCB for it using both those two devices.

Image
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

Cool :D
is it a problem for the mini only to be 3.3v compatible? and is the pro micro you have the 3.3v version?

Also, if they aren't stackable, you could just make a long pcb so they sit end to end.
i think i'd just get some proto-pcb and start soldering, have i had the shield.
Post Reply