[Solved] RPI Zero H + BT Dongle + PS4 + Joystick

Need help? Ask here and someone will help
Post Reply
LeBrevinois
Posts: 14
Joined: Thu Mar 14, 2019 8:12 am

[Solved] RPI Zero H + BT Dongle + PS4 + Joystick

Post by LeBrevinois »

Hi
I did a small small joystick with a Micro Pro (one axis + one buton) as the main idea is to do an analog handbrake.

I used a RPI Zero H + Usb otg hub + BT dongle

When I launch gimx and press the DS4 buton it does recognized it by displaying a new DS4 on the PS4 and asking which user to use with this DS4.

But the problem is I can't acknowledge the device as it asks to press X (accept) or O (cancel) but none of my mapping seems to work !

The micro Pro button use 2 PIN mapped to buton 0 with Arduino IDE.

The config XML for GIMX is the following :

Code: Select all

<button id="abs_axis_9" label="">
          <device type="joystick" id="0" name="Arduino micro"/>
          <event type="button" id="0"/>
        </button>
Any tips ?
Fred
Last edited by LeBrevinois on Wed Apr 10, 2019 11:03 pm, edited 2 times in total.
User avatar
kaiba_seto2004
Posts: 553
Joined: Sat Jul 15, 2017 9:15 am

Re: RPI Zero H + BT Dongle + PS4 + Joystick

Post by kaiba_seto2004 »

The easiest way is connect another keyboard to your RPi, create a config binding to this keyboard along with your mini board.
PS4 enthusiast.
LeBrevinois
Posts: 14
Joined: Thu Mar 14, 2019 8:12 am

Re: RPI Zero H + BT Dongle + PS4 + Joystick

Post by LeBrevinois »

kaiba_seto2004 wrote: Mon Apr 08, 2019 6:30 am The easiest way is connect another keyboard to your RPi, create a config binding to this keyboard along with your mini board.
Hi, thanks for the idea but it's only a temporary solution to add a keyboard to my RPI ?
My main idea was to have a portable solution without too much wires / devices :)

From my point of view, I just messed up with the mapping syntaxe probably but so far I can't find out where...

BTW I use 6.11 Gimx ... Not sure I can use a newer version on my RPI Zero....
LeBrevinois
Posts: 14
Joined: Thu Mar 14, 2019 8:12 am

Re: RPI Zero H + BT Dongle + PS4 + Joystick

Post by LeBrevinois »

Btw I updated gimx to latest version 7.12

I've got now a warning about joystick not found :

Code: Select all

Warning: joystick not found: Arduino SA 4
Here is le lsusb commande :

Code: Select all

pi@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 2341:8037 Arduino SA
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
In my config XML I put id 4 (Device 004 ?) :

Code: Select all

      <button_map>
        <button id="abs_axis_9" label="">
          <device type="joystick" id="4" name="Arduino SA"/>
          <event type="button" id="0"/>
        </button>
      </button_map>
What am I missing ?
Cheers
Fred
LeBrevinois
Posts: 14
Joined: Thu Mar 14, 2019 8:12 am

Re: RPI Zero H + BT Dongle + PS4 + Joystick

Post by LeBrevinois »

According to the source the warning is raised either because

- ginput_joystick_name(i) does not match the XML name attribut in <device type="joystick" id="4" name="Arduino SA"/>
or
- ginput_joystick_virtual_id(i) does not match the XML id attribut in <device type="joystick" id="4" name="Arduino SA"/>

But I can't fin where / what those 2 methods do (is it part of joystick libraries ?)

Any tips are welcome
Cheers
Fred
LeBrevinois
Posts: 14
Joined: Thu Mar 14, 2019 8:12 am

Re: RPI Zero H + BT Dongle + PS4 + Joystick

Post by LeBrevinois »

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)
This can give you the Joystick Name, in my case : Arduino LLC Arduino Micro

So no more Warning for me with the following config :

Code: Select all

        <button id="abs_axis_9" label="">
          <device type="joystick" id="0" name="Arduino LLC Arduino Micro"/>
          <event type="button" id="0"/>
        </button>
Post Reply