You are not logged in.

#1 2018-03-16 01:44:51

schmidtbag
Member
From: NH, USA
Registered: 2011-02-08
Posts: 337

Dualshock 3 Shanwan Controller and Bluetooth

I have this DS3 controller that, despite the Sony branding and solid construction, is a Chinese clone (lsusb identifies it as a Sony product, but dmesg says its from Shanwan).  The controller works perfectly fine over USB, but I can't seem to get it to connect via Bluetooth.

I tried plugging it in via USB, unplugged it, and scan.  When doing this, I do see a Bluetooth address pop up, but I can't connect to it.  From the AUR, I've tried installing sixpair, but that, along with other packages (like bluez-ps3) requires an outdated version of Bluez.

This guide hasn't helped:
https://wiki.archlinux.org/index.php/Ga … controller

Any suggestions?

Offline

#2 2018-03-16 10:14:39

Dreamkey
Member
Registered: 2010-08-28
Posts: 45

Re: Dualshock 3 Shanwan Controller and Bluetooth

First you need to pair your controller (write your computer's bluetooth address inside the controller) through a USB cable, I believe I use sixpair too but I can confirm later.
Then I found the gentoo wiki more detailed on how to use bluez to pair it (but you do need to have bluez-ps3 to use a clone): https://wiki.gentoo.org/wiki/Sony_DualShock#DualShock_3

PS: the 4.16 kernel will have a fix for the clones rumbling when you connect them to USB, you can install the dkms-hid-sony-shanwan package in the meantime.

Last edited by Dreamkey (2018-03-16 10:17:06)

Offline

#3 2018-03-16 15:12:48

schmidtbag
Member
From: NH, USA
Registered: 2011-02-08
Posts: 337

Re: Dualshock 3 Shanwan Controller and Bluetooth

The problem is sixpair and bluez-ps3 don't work on the current version of Bluez.  I saw the Gentoo guide and that too depends on an older version of Bluez.  So, I don't appear to have a way to connect using the current generation of Bluez.

I don't have the USB rumbling issue, so no worries there (I think I'm already running the 4.16 kernel).

Last edited by schmidtbag (2018-03-16 15:13:43)

Offline

#4 2018-03-16 21:35:56

Dreamkey
Member
Registered: 2010-08-28
Posts: 45

Re: Dualshock 3 Shanwan Controller and Bluetooth

bluez-ps3 is bluez, it's patched with the 5 patches you can find here (numbers 11 to 15). It was made by someone who sent them to the bluez mailing list, if I remember correctly it was the 3rd RFC; but I don't know why it was never merged.
They don't apply anymore since bluez v5.46, so if you absolutely need its last version there is no solutions yet.

But if you want to give a try, here is what I do when they won't connect to my computer (I believe bluetoothctl saved my previous settings):

$ sudo systemctl start bluetooth && sudo btmgmt power on
hci0 class of device changed: 0x00010c
hci0 Set Powered complete, settings: powered bondable ssp br/edr le secure-conn 

$  sudo sixpair 
Current Bluetooth master: 00:00:00:00:00:00
Setting master bd_addr to 11:22:33:44:55:66

I'm curious if your controller works fine afterwards, because right now I have some troubles to use them: https://bbs.archlinux.org/viewtopic.php?id=235409

Offline

#5 2018-03-16 22:23:38

progandy
Member
Registered: 2012-05-17
Posts: 5,209

Re: Dualshock 3 Shanwan Controller and Bluetooth

@Dreamkey: psyke83 on retropie.org.uk claims that shanwan controllers work since bluez 5.48 https://retropie.org.uk/forum/post/134988
At least patch 12 and 13 seem to be included:
https://git.kernel.org/pub/scm/bluetoot … 72e6e1d39f
https://git.kernel.org/pub/scm/bluetoot … 0e317f1e08

Last edited by progandy (2018-03-16 22:32:27)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2018-03-17 00:57:52

Dreamkey
Member
Registered: 2010-08-28
Posts: 45

Re: Dualshock 3 Shanwan Controller and Bluetooth

@progandy: thanks! When I was seeing new release of bluez I was checking if the patches were applied, and I stayed on v5.45 when I couldn't apply them anymore.
I just updated bluez (v5.49) and my controllers work like before, so @schmidtbag you should be able to use it too.

I still have the mapping issue, but I will check later the backports psyke83 did.

Offline

#7 2018-03-17 01:34:12

schmidtbag
Member
From: NH, USA
Registered: 2011-02-08
Posts: 337

Re: Dualshock 3 Shanwan Controller and Bluetooth

Hmm I wasn't aware the Sixaxis was so oddly picky about how it needed to be paired, at least the first time around.  Seems to be easy to re-connect afterwords.

Sixpair didn't seem to do anything for me; following the Gentoo guide worked after installing "bluez-ps3".  I also needed to install hcitool, since the newer versions of Bluez don't use that.  I don't especially like that I have to use this outdated bluez, but, at least it seems to be working with no negative side effects.  At least for my gaming PC, the only thing I use Bluetooth for are gamepads, so for now I think I'm all set.

I may try experimenting with this a little bit, because now I have a clearer understanding of what exactly is going on in order for the controller to connect.  It seems that it's not so much the computer pairs with the controller, but rather the controller pairs with the computer.  I'm not sure if there's anything else I depend on in the bluez-ps3 package, but I wonder if I could use Arch's normal bluez package (which in turn means the hcitool package gets broken), while doing the following:
1.  Plug the controller in via USB.
2.  Using whatever Bluetooth control panel (in my case, blueman), and set my PC to discoverable.
3.  Unplug the USB cord.
4.  There should be a prompt for authorization (say yes).
5.  Trust the controller after being paired.
That should, in theory, allow me to make a first-time connection without any special tools, older versions of bluez, or CLI commands.

Also, for me the controller seems to be mapped out perfectly fine.

Last edited by schmidtbag (2018-03-17 01:35:13)

Offline

#8 2018-03-17 02:05:37

schmidtbag
Member
From: NH, USA
Registered: 2011-02-08
Posts: 337

Re: Dualshock 3 Shanwan Controller and Bluetooth

Hmm interesting little tidbit that I accidentally discovered - you can control the gamepad's LEDs individually via shell scripts.  For example if you want to turn on the "2" LED, you can do:
echo "1" > /sys/class/leds/XXXX\:XXXX\:XXXX.XXXX\:\:sony2/brightness
Replace the Xs with whatever your controller's address is (bear in mind, it seems to change every time the controller is connected).
Change the 1 to a 0 to turn the LED off.

Since I personally intend to use the Sixaxis for "player 2", I created a udev rule that would automatically change the LED to 2 whenever the controller connects.

Last edited by schmidtbag (2018-03-17 02:47:40)

Offline

Board footer

Powered by FluxBB