[WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Sun Apr 07, 2019 12:08 am
by LeBrevinois
Hi,
I'm building a analog handbrake for sim racing on PS4.
Source AMSTUDIO :
So far I've got
- Rpi Zero H
- Compatible Bluetooth dongle (CSR8510 chipset Orico BTA-403)
- Installed gimx (6.11 AMRv6) on Rpi (Linux 9 stretch , Debian 9.4)
- Usb OTG hub (Markerspot)
- Paired dongle with PS4 (using gimx-ps4-helper.sh script as mentioned here : http://gimx.fr/wiki/index.php?title=Command_line) ==> linkkeys created
I've used my PRO MICRO card as a Teensy to get it paired by flashing it with EMUPS4PAIRING atmega32u4.hex file.
Then I reflashed it (Ive got only one PRO MICRO card) to an analog potentiometer (linear) which is know recognized as Throttle axis on Windows as the AMSTUDIO youtube video file described it.
When I plug the controller on the RPI it is detected as an usb device and using "jstest" I can see the axis level moving as I move the linear potentiometer.
Question 1 : once the "linkkeys" are created and as long as I do not change the DS4 pairing (by repaiting with e PS4) I do not have to modify them ? I mean as I flashed my PRO MICRO to an Throttle Axis so I can't re do it each time I wanna play... [MAJ] : it seems the case as I've got it working
Question 2 : What is the right order to start things up ?
What I do is : Start PS4 > Start Rpi with bluetooth dongle > launch gimx command line > presse the PS buton on the DS4 > DS4 blink then white light stays ON > RPI display message as "can't connect to PSM"
Any tips ? [MAJ] : I've redone the gimx-ps4-helper.sh and it seems ok now !
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Sun Apr 07, 2019 4:01 pm
by LeBrevinois
By the way here is my jstest /dev/input/js0 output showing Buton 0 (which I added on PIN2) and Axis 6 is responding correctly (pin A0)
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Sun Apr 07, 2019 5:37 pm
by LeBrevinois
Ok I got it running, as soon as I press the DS4 PS button the PS4 sees it and ask me to validate the users using the device
Unfortunatly I can't find out how to validate (normally with X 'cross' button)
So far I've tried to map my ProMicro Arduino Button 0 (pin2) with the following :
Any ideas ?
Is it possible to get the DS4 that I used to get BT passtrought to get the X cross buton to work ?
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Fri Apr 12, 2019 5:52 am
by Matlo
Editing the configuration with a text editor is not recommended. Use gimx-config instead.
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Tue Apr 16, 2019 6:19 pm
by LeBrevinois
Matlo wrote: ↑Fri Apr 12, 2019 5:52 am
Editing the configuration with a text editor is not recommended. Use gimx-config instead.
Hi Matlo thanks for your reply.
I'm on Rpi and in command line only...
I dont't know if I can lauch gimx-config on Rpi... (EDIT) ... which is on raspian-stretch so no GUI... And if I do it on Windows gimx-config the ID are not the same : Axis is 7 but un Rpi it's 6... (EDIT)
BTW as mentionned in my previous thread I found out that the name of the device was not the right one :
pi@raspberrypi:~ $ jstest --select /dev/input/js0
Driver version is 2.1.0.
Joystick (Arduino LLC Arduino Micro) has 12 axes (X, Y, Z, Rx, Ry, Rz, Throttle, Rudder, Hat0X, Hat0Y, Hat1X, Hat1Y)
(...)
Event: type 130, time 5688710, number 6, value -32767
==> "Arduino LLC Arduino Micro" is the complete right name (and not just "Arduino Micro") and my axis is the ID 6.
So far now I've got it working but it seems my mapping is not right.
The buttons are recognized but my axis 6 (which goes from -32767 to 32767) and mapped to R2 is not.
pi@raspberrypi:~ $ sudo gimx -t DS4 -c promicro.xml -h 0 -b FC:01:7C:CF:92:CA
controller #1: option -t with value `DS4'
global option -c with value `promicro.xml'
controller #1: option -h with value `0'
controller #1: option -b with value `FC:01:7C:CF:92:CA'
now reading arguments for controller #2
using default refresh period: 10.00ms
Warning: can't open macro directory /root//.gimx//macros/
listening on psm: 0x0001
listening on psm: 0x0011
listening on psm: 0x0013
1555437965.603133 timer fired 2 times...
1555437971.096729 timer fired 2 times...
Any ideas ?
Cheers and good work !
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Thu Apr 18, 2019 8:02 pm
by Matlo
At this step you are supposed to press the PS button on the Dualshock 4, that should have previously been paired with the BT module/dongle.
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Posted: Thu Apr 18, 2019 8:57 pm
by LeBrevinois
Matlo wrote: ↑Thu Apr 18, 2019 8:02 pm
At this step you are supposed to press the PS button on the Dualshock 4, that should have previously been paired with the BT module/dongle.
Yeap it does work when I press PS on the DS4, my problem is the axis which I set to R2 is not recognized (but butons are OK).
Maybe something about the multiplier / exponent or the correction (low_value, low_coef, high_value and high_coef) ?
What are the values expected for R2 button ? 0 to 255 ?
Cheers
Fred
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro