Running gimx on multiple ps4 - error reading ps4 control

Need help? Ask here and someone will help
Post Reply
djmulko
Posts: 4
Joined: Sun Jan 22, 2017 4:02 pm

Running gimx on multiple ps4 - error reading ps4 control

Post by djmulko »

Hey guys,

Is there any chance to control two PS4 consoles using one raspberry pi? My current setup looks like this:
2 x ps 4, 2 x ds4, 2 x bluetooth dongles(both with different address).

// sorry for a little mess up here, please look at the details I've posted below.

Any idea, what can I do to make it work? Thanks in advance.
Last edited by djmulko on Sun Jan 22, 2017 11:49 pm, edited 2 times in total.
djmulko
Posts: 4
Joined: Sun Jan 22, 2017 4:02 pm

Re: Running gimx on multiple ps4 - error reading ps4 control

Post by djmulko »

Code: Select all

gimx --config Dualshock4.xml  --type DS4 --hci 0 --bdaddr PS4_1_MAC --type DS4 --hci 2 --bdaddr PS4_2_MAC  --status
global option -c with value `Dualshock4.xml'
controller #1: option -t with value `DS4'
controller #1: option -h with value `0'
controller #1: option -b with value `PS4_1_MAC'
now reading arguments for controller #2
controller #2: option -t with value `DS4'
controller #2: option -h with value `2'
controller #2: option -b with value `PS4_2_MAC'
now reading arguments for controller #3
status flag is set
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
accepted connection from PAD_1 (psm: 0x0001)
connecting with hci0 = 00:1A:7D:DA:71:13 to PS4_1_MAC psm 0x0011
connecting with hci0 = 00:1A:7D:DA:71:13 to PS4_1_MAC psm 0x0013
accepted connection from PAD_1 (psm: 0x0011)
accepted connection from PAD_1 (psm: 0x0013)
0 1485126875.325368, lstick x (-4), lstick y (-4), rstick x (-123), finger1 x (1857), finger1 y (-454), finger2 x (2625), finger2 y (-453), r2 (15), finger1 (1), finger2 (1)
0 1485126875.345199, lstick x (-4), lstick y (-4), rstick x (-123), finger1 x (897), finger2 x (1665), l2 (129), r2 (1), finger1 (1), finger2 (1)
0 1485126875.355196, lstick x (-4), lstick y (-4), rstick x (-123), finger1 x (897), finger2 x (1665), l2 (129), r2 (1), finger1 (1), finger2 (1)
0 1485126875.375192, lstick x (-4), lstick y (-4), rstick x (-123), finger1 x (-1919), finger1 y (-5), finger2 x (-1919), finger2 y (-6), l2 (32), r2 (246), finger1 (1), finger2 (1)
0 1485126875.395192, lstick x (-4), lstick y (-4), rstick x (-4), rstick y (-4)
accepted connection from PAD_2 (psm: 0x0001)
connecting with hci2 = 00:1A:7D:DA:71:02 to PS4_2_MAC psm 0x0011
connecting with hci2 = 00:1A:7D:DA:71:02 to PS4_2_MAC psm 0x0013
accepted connection from PAD_2 (psm: 0x0011)
accepted connection from PAD_2 (psm: 0x0013)
1 1485126886.705218, finger1 x (-959), finger1 y (-347), finger2 x (-959), finger2 y (-459)
error reading ps4 control
error reading ps4 control
error reading ps4 control
error reading ps4 control
error reading ps4 control
https://github.com/matlo/GIMX/blob/5e2b ... ds4.c#L412

Trying to run two gimx instances simultaneously using two different bluetooth dongles ends up with:

Code: Select all

bind: Address already device use
please stop the bluetooth service
when I try to start second instance.
https://github.com/matlo/GIMX/blob/5e2b ... uez.c#L646
djmulko
Posts: 4
Joined: Sun Jan 22, 2017 4:02 pm

Re: Running gimx on multiple ps4 - error reading ps4 control

Post by djmulko »

Little update. I've discovered that running gimx with command below, allows me to physically use only one gamepad with PS4 which bdaddr appears in command first. In this case - PS4_1_MAC. Second gamepad shows up in second PS4, but it doesn't send any inputs. The only way to send anything is to send gimx events to 127.0.0.1:9002.

Code: Select all

gimx --config Dualshock4.xml  --src 127.0.0.1:9001 --type DS4 --hci 0 --bdaddr PS4_1_MAC --src 127.0.0.1:9002 --type DS4 --hci 2 --bdaddr PS4_2_MAC  --status
Moreover I've seen that I could use any DS4, no matter if it was paired using hci1 or 2. Is this intentional?
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Running gimx on multiple ps4 - error reading ps4 control

Post by Matlo »

Sorry for the response delay.

Yes, it was intentional that any DS4 connecting to any bluetooth adapter can be used with any controller instance.
Having a bluetooth adapter for each bluetooth connection theoretically allows to push the refresh rate higher.

I think there is a problem when listening to incoming connections: only the first bluetooth adapter seems to be considered.
GIMX creator
djmulko
Posts: 4
Joined: Sun Jan 22, 2017 4:02 pm

Re: Running gimx on multiple ps4 - error reading ps4 control

Post by djmulko »

Hey Matlo, amazing job, thanks! Everything is working now.
I also send little pull request to your repo. Code was always pointing to first element of states array. https://github.com/matlo/GIMX/pull/440/files
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Running gimx on multiple ps4 - error reading ps4 control

Post by Matlo »

Thanks!
GIMX creator
Post Reply