[WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
[WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
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 !
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 !
Last edited by LeBrevinois on Sun Apr 07, 2019 8:12 pm, edited 2 times in total.
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
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)
Code: Select all
Axes: 0: 0 1: 0 2: 0 3:-32767 4:-32767 5:-32767 6: 9120 7:-32767 8: 0 9: 0 10: 0 11: 0
Buttons: 0:on 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9:off 10:off 11:off 12:off 13:off 14:off 15:off 16:off 17:off 18:off 19:off 20:off 21:
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
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 :
or
Any ideas ?
Is it possible to get the DS4 that I used to get BT passtrought to get the X cross buton to work ?
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 :
Code: Select all
<button id="cross" label="PS">
<device type="joystick" id="0" name="Arduino Micro"/>
<event type="button" id="0"/>
</button>
Code: Select all
<button id="abs_axis_9" label="PS">
<device type="joystick" id="0" name="Arduino Micro"/>
<event type="button" id="0"/>
</button>
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
Editing the configuration with a text editor is not recommended. Use gimx-config instead.
GIMX creator
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
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 :
Code: Select all
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
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.
Here is my promicro.xml config file :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<root>
<controller id="1" dpi="0" type="DS4">
<configuration id="1">
<trigger type="" id="" name="" button_id="" switch_back="no" delay="0"/>
<mouse_options_list/>
<intensity_list/>
<button_map>
<button id="abs_axis_2" label="PS">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="button" id="1"/>
</button>
<button id="abs_axis_9" label="X">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="button" id="0"/>
</button>
<button id="abs_axis_4" label="Right">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="button" id="2"/>
</button>
<button id="abs_axis_6" label="Left">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="button" id="3"/>
</button>
</button_map>
<axis_map>
<axis id="rel_axis_14" label="r2">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="axis" id="6" dead_zone="0" multiplier="0.008" exponent="1.00" shape="" />
</axis>
</axis_map>
<joystick_corrections_list>
<correction low_value="32767" low_coef="-8191" high_value="0" high_coef="0">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="axis" id="6"/>
</correction>
</joystick_corrections_list>
</configuration>
</controller>
</root>
Code: Select all
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...
Cheers and good work !
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
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.
GIMX creator
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
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
- rest = 32767, full = -32767: low_value = 32767, low_coef = -8192, high_value = 0, high_coef = 0
- rest = -32767, full = 32767: low_value = -32767, low_coef = 0, high_value = -32767, high_coef = 8192
- rest = 32767 full = 0: low_value = 32767, low_coef = -16384, high_value = 0, high_coef = 0
- rest = -32767 full = 0: low_value = -32767, low_coef = 0, high_value = -32767, high_coef = 16384
- rest = 0 full = 32767: no correction needed
- rest = 0 full = -32767: set the sensitivity to -0.008 instead of 0.008
GIMX creator
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
I'm bit confused to be honnest...
>> low_value = -32767, low_coef = 0, high_value = -32767, high_coef = 8192
Fred
So as my range stands from -32676 to 32767 I have to set this settings :Matlo wrote: ↑Fri Apr 19, 2019 6:35 am
- rest = 32767, full = -32767: low_value = 32767, low_coef = -8192, high_value = 0, high_coef = 0
- rest = -32767, full = 32767: low_value = -32767, low_coef = 0, high_value = -32767, high_coef = 8192
- rest = 32767 full = 0: low_value = 32767, low_coef = -16384, high_value = 0, high_coef = 0
- rest = -32767 full = 0: low_value = -32767, low_coef = 0, high_value = -32767, high_coef = 16384
- rest = 0 full = 32767: no correction needed
- rest = 0 full = -32767: set the sensitivity to -0.008 instead of 0.008
>> low_value = -32767, low_coef = 0, high_value = -32767, high_coef = 8192
Fred
-
- Posts: 14
- Joined: Thu Mar 14, 2019 8:12 am
Re: [WIP : DIY PS4 Handbrake] Rpi Zero H + Bluetooth + Pro Micro
Yeap it worked !
I did some test using the --status inline command option and it does exactly as planned !
Thank you for your feed back !
Here is the focus on the config XML file :
An PS4 screenshot from Gran Turismo Sport with smoking tires ! :
![Image](https://lh3.googleusercontent.com/H9T0wgsb4eCdIpqVt_yTOKcWQNFx6xK2YbFv0K9Cm27CQ5AXWVhR5MZvE9sYyFG4E7GPHGFEVBQC8lA6iHQFW7yqZ8_JU1lAin2DRzYL8Pojs50C6UW6xXEMtac9rgDgC3DitlFsLFR3xWeIj59eWETQh6D6JLb8FHKH5faDyK2cH6a_v45Z55NOYQ7Il5sCQZ5PgAyRP9uvTK7rrrHdBakLRrTV5jDEQpAaOp3hmIcrq-kpTZ_nXEWgHeUgDc1m8_wyld97vSLhsJ8jEN0NLTw_177gSbsv2Vg85M9SYGqJ4KKXEJgn9iQPSTwlc7-ocd-mLxBAa2Lbs5LjZSn_ETU2eT-1UQi4z0w_MJZtVi8dmhFqnpN3NREBveSx3tlU2leDIopGQX8iQvt-Ne9rte-qvRliBOiYMPZksc2CTKa0nBeZl-XavhSsTdLiRRh6SBuynJVl6U3toqTeelm24QwBsQSmFs7LKTBFDpd9CDxwcsX916mC727MaA5_JBZNveMKXSbUEvhVF7C5n6E83BkPjWKGfZ06DRY-x43JG9OVl8bgjRUPfUt0kNeChyiSWIjQUS76PXsnjM6TyxRBZVvhfm8fInCq76pEnU-4ethRc3YaYSatv265VLb7bPctlBNLyjFEKEnpWlLkx4tVSr5yqlFo8TEr=w1636-h920-no)
An WIP hardware setting :
![Image](https://lh3.googleusercontent.com/zlN_W_brK-FEfFadz4gNWgvi5h7VYy2SdXgM2nG87UvJ5MQdPnryCH-_OoOcR2MgHOyRM7baj5tvsGhmC_G9EzXtLJyJfm2ivCMG8Qh7oD0WdT5UmV2OGbLxheEzLtxwnRYaChHnPg_pbJYvC37aDEKlAvQrS1zz--tOT_dTp3fP92RK9dROWcqE7gKd31du86l3iNjyO7SXMMBcFtX1SBlBWHbGQDr9Dw21OJkXso1bXtnKngPzK8dM1vO7MBsgaU8aUFNKKyINXm2qXka1dRIOYD4T-awTHYTXpnY1ESCK3JiDE4O6jwVjBRp0-C5yJcOs4z_f4vlIdb9SJ-c4vTMlodV8fPF-4OK52qvUFkM8A-H1d68gKLYE-KWKgw8p8mw1eANkTQ-ucq8kU_k-EK_KNeE67S0Jn14WFnMlMPBGuVGAhLF_JQ3tjkctC9M3BgcC7r_njbntLNvL1oaCr3i8UTysiobIJAh3mVhdcI2K27fLuJoCImzh803HD8mI-ok-TcemZgepwN1tuk-Yo-V5deQVzrfIRndHWBzZp_msfTXEUTMn31Oan8GDrmF1RRVRnd_PgP6IKKdHCimUi098PAoqND1MqfqS7bb06zuGY32fi5efiBnzxPUD3DtxMHdfxCv8Wg7zJ29eAXF0W8aZVKFq0qye=w692-h920-no)
Next step : buy an Hydraulic Handbrake from amazon and fit the linear pot inside !
![Image](https://lh3.googleusercontent.com/AVfFnF_CfBVRJTcvSP4nt8_3CPKQ4dAWGReyRotn1fCG4_0dS8ZCFfxs7UNmpqzEb2V1I5BhLPFAmC3rOVp8dpYDawxc9TSAhR0oageHz3CHfzbkKlztUpYwnJLc4-Q0IwoEOcaje2uLqOw4gPIc-fEgpmVia8ynh7lruYQUEJlNM6o2j-6oFaik19DNzyxHKCj9JLLfbrCky1UlK5XaKSZR-Xo3LmnTnRv47LGxPSwZ0zz1txhnh3Zi3C7K5Z54SZLfUdM_bb_llup-oS8A3XM9uYA8sfSefzEExnxcP3tSsNtU-9WUGqsYre4pnqVeuORVFxRiXMOOePxc5UqYOZKnrHNs7TOrl0ZQhMD2Q1U5PiOLAZBlXhl-4ZrdRfC1vd_zVUpP-ibR1gKeGdQVTYuaF8d7AmBJUMyV7MHjBzjZ1MyFbdzFR-ODPzMFKXtYt0ItaLXLENtbybv4vwhyDNWiCB3HfVCdrVEV2FY4aBiI47Ei1iKddJRewKvEgWcsSZLU6Cl378RKDU_4t9Aarzfj5M3kYguuZyIU5QpqSPVpGUTjHYQNaivI_Z5JJ-B6zzf4wRvx9LYgz1XCtDAldvowbKi31CgFlWeOhClwaGHuSePprVXYcAgRmg58C9gtQPf96qal5_z6AppePZLAorw8TDlZUUpq=s500-no)
This is going to be great !
Happy Gimx user![Smile :)](./images/smilies/icon_e_smile.gif)
I did some test using the --status inline command option and it does exactly as planned !
Thank you for your feed back !
Here is the focus on the config XML file :
Code: Select all
<axis_map>
<axis id="abs_axis_14" label="throttle">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="axis" id="6" dead_zone="0" multiplier="0.008" exponent="1.0" shape=""/>
</axis>
</axis_map>
<joystick_corrections_list>
<correction low_value="-32767" low_coef="0" high_value="-32767" high_coef="8192">
<device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
<event type="axis" id="6"/>
</correction>
</joystick_corrections_list>
An WIP hardware setting :
Next step : buy an Hydraulic Handbrake from amazon and fit the linear pot inside !
This is going to be great !
Happy Gimx user
![Smile :)](./images/smilies/icon_e_smile.gif)