RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    SHANWAN / PS3 CONTROLLER Pi3 RETROPIE 3.6 BLUETOOTH SETUP

    Scheduled Pinned Locked Moved Help and Support
    255 Posts 33 Posters 220.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Wolfman100W
      Wolfman100
      last edited by

      I have now been digging around attempting to get the bluetooth controller in the Pi to see the PS3 controller at root level from the commandline using bluetoothctl following this guide:

      https://wiki.archlinux.org/index.php/bluetooth#Bluetoothctl

      The Pi does not see the PS3 controller when scanning for devices but every other bluetooth device around.This leads me to assume that one of two scenarios is ocurring:

      1)The Bluetooth in the PS3 controller is broken
      2)The Pi's Bluetooth needs sixpair to be running in order to see the PS3 controller

      If someone with more in-depth knowledge than me confirm whether either of these possibilities are true?

      luetzelL 1 Reply Last reply Reply Quote 0
      • luetzelL
        luetzel @Wolfman100
        last edited by luetzel

        @Wolfman100
        Howdy,
        I've been following this thread for quite a while and have some good news for you! It is now possible to pair PS3 controllers solely using bluez.

        Szymon Janc, one of the bluez developers made some patches for bluez, supporting Gasia and Shanwan PS3 clones. They can be found on github and were made for the OpenELEC.tv media centre, however they didn't make it to the master branch, yet.

        So here are instructions how to pair your PS3 controller using bluez:

        1. download the bluez-5.39 source from bluez.org
        2. apply the patches found on:
        github: https://github.com/OpenELEC/OpenELEC.tv/tree/openelec-7.0/packages/network/bluez/patches
        

        (when you download them manually, make sure to chose "raw mode" otherwise HTML tags will stay within the files, so that these patches can't be applied)
        3) edit bluez-5.39/src/bluetooh.ver and add the line:

         sdp_*;
        

        into the 'global' section. If you don't do it, the bluetoothd will not load the sixaxis plugin on startup because of undefined symbols
        UPDDATE:
        you can skip the above step if you download the already patched bluez source code from my github repo:

        git clone https://github.com/luetzel/bluez
        
        1. run configure, make, make install
              ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-sixaxis
              make -j3
              sudo make install
        

        (note: make sure to 'apt-get install' libical-dev and systemd-dev)
        5) run:

        sudo service bluetooth restart
        
        1. download QtSixA from http://qtsixa.sourceforge.net/ and follow the instructions in the INSTALL file; you will only need the 'sixpair' program in the 'utils' subdirectory. Change to the 'utils' dir and edit the Makefile: remove 'hcid_bin' from the line reading:
        all: tools hcid_bin
        

        then, do 'make'
        If the compilation was successful, you can find the 'sixpair' program in the 'bins' directory. If it doesn't compile, you're probably missing some header files (check the gcc output and install missing dev-packages).
        7) Connect your PS3 controller via USB to the Pi. Wait a few seconds until it starts to rumble. Then run:

        sudo ./sixpair
        

        If successful, you should see something like:

        Current Bluetooth master: DE:AD:BE:EF:00:00
        Setting master bd_addr to: 00:1F:81:00:06:20 
        

        (I also tried bluetoothctl for pairing, but it always requested a key-code, which one cannot enter using the controller)
        8) disconnect the controller from USB. Its LEDs start flashing. If the pairing is successful, only LED1 will stay on for controller 1 (LED2 for controller 2 and so on)
        9) If you have to pair bluetooth keyboards/mice, simply use the retropie-setup.sh for doing that.
        10) More detailed instructions can be found at at http://raspberryblog.de
        UPDATE:
        To validate these instructions, I tested them on my desktop PC under openSuSE/ Tumbleweed everything worked
        as expected and even KDE recognizes my controller as joystick :-D.

        Cheers,
        /luetzel

        Wolfman100W 1 Reply Last reply Reply Quote 0
        • Wolfman100W
          Wolfman100 @luetzel
          last edited by

          @luetzel Amazing!!

          Many thanks for contributing what looks to be some very useful information indeed to this thread.

          All the info seems pretty in-depth and thus will probably take a minute for me to get my head around as I'm only just past noob status to all of this Linux business!

          Will report back soon as.

          Thanks again for your very much appreciated input.

          1 Reply Last reply Reply Quote 0
          • Wolfman100W
            Wolfman100
            last edited by

            I have already stumbled...

            bluez.org doesn't seem to exit and I'm not exactly what patches to apply exactly and how to apply them.

            I should point out also that I don't even know what a Fork or Branch is!

            luetzelL 1 Reply Last reply Reply Quote 0
            • Wolfman100W
              Wolfman100
              last edited by

              luetzel

              I am now looking at your tutorial on your blog,that seems a lot clearer to me

              1 Reply Last reply Reply Quote 0
              • Wolfman100W
                Wolfman100
                last edited by

                I get the following returned when I try to download 'Bluez'...

                root@osmc://# sudo apt-get install wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.39.tar.xz
                Reading package lists... Done
                Building dependency tree
                Reading state information... Done
                E: Unable to locate package http
                E: Couldn't find any package by regex 'http://www.kernel.org/pub/linux/bluetooth'

                1 Reply Last reply Reply Quote 0
                • Wolfman100W
                  Wolfman100
                  last edited by

                  @luetzel

                  OK,I've managed to get to step 4 of your tutorial and now get this error when I try to configure:

                  configure: error: libical is required

                  luetzelL 1 Reply Last reply Reply Quote 0
                  • luetzelL
                    luetzel @Wolfman100
                    last edited by luetzel

                    @Wolfman100
                    some packages are missing on your pi. If you're receiving error messages like this, first, install 'aptitude'
                    with 'sudo apt-get install aptitude'. Then search for the dev-package that is missing, in your case libical:
                    'sudo aptitude search libical'. On my Pi, I get:

                    p libical-dbg - debugging symbols for libical
                    i libical-dev - iCalendar library implementation in C (development)
                    p libical-parser-html-perl - generates HTML calendars from iCalendars
                    p libical-parser-perl - module to parse iCalendar files into a data structure
                    p libical-parser-sax-perl - generates SAX events calendars from iCalendars
                    i A libical1a

                    i = installed
                    p = pending

                    make sure you have libical-dev installed (sudo apt-get install libical-dev) and you are good to go.
                    (Repeat for all dev-packages ./configure ... complains about)

                    1 Reply Last reply Reply Quote 0
                    • luetzelL
                      luetzel @Wolfman100
                      last edited by

                      @Wolfman100
                      sorry for that, I haven't noticed that links were not correctly converted. Now all links in my previous post should work.

                      Wolfman100W 2 Replies Last reply Reply Quote 0
                      • Wolfman100W
                        Wolfman100 @luetzel
                        last edited by

                        @luetzel

                        Thanks for the assistance...much much appreciated.I have now got to step 5 so let's see what happens..fingers crossed!

                        1 Reply Last reply Reply Quote 0
                        • Wolfman100W
                          Wolfman100 @luetzel
                          last edited by

                          @luetzel I get a 404 for the QtSixA link

                          luetzelL 1 Reply Last reply Reply Quote 0
                          • luetzelL
                            luetzel @Wolfman100
                            last edited by luetzel

                            @Wolfman100
                            Odd, you can download it over here:
                            https://sourceforge.net/projects/qtsixa/
                            Meanwhile I have updated the instructions in my previous post and blog.
                            I have also placed the patched bluez in my repo on github.

                            1 Reply Last reply Reply Quote 0
                            • Wolfman100W
                              Wolfman100
                              last edited by

                              I have now installed QtSixA and have run Sixpair:

                              root@osmc:/# sudo ./sixpair
                              Current Bluetooth master: b8:27:eb:a1:9b:7f
                              Setting master bd_addr to b8:27:eb:a1:9b:7f

                              As you can see above it seems to see my controller...but doesn't pair..

                              luetzelL 1 Reply Last reply Reply Quote 0
                              • luetzelL
                                luetzel @Wolfman100
                                last edited by luetzel

                                @Wolfman100
                                Are you sure that you correctly applied ALL patches for bluez? If not, try to download and install my
                                patched version from github.
                                Did you restart the bluetoohd/ reboot your pi after installation of bluez?

                                Does LED1 light up?

                                Can you post the output of 'dmesg' when your controller is connected via USB?

                                Wolfman100W 1 Reply Last reply Reply Quote 0
                                • Wolfman100W
                                  Wolfman100
                                  last edited by

                                  I'm pretty sure that all the patches were applied correctly...will double check

                                  1 Reply Last reply Reply Quote 0
                                  • Wolfman100W
                                    Wolfman100 @luetzel
                                    last edited by

                                    @luetzel

                                    Pastebin of dmesg output:

                                    http://pastebin.com/Lap42kFi

                                    and No LED 1 does not light up

                                    luetzelL 1 Reply Last reply Reply Quote 0
                                    • luetzelL
                                      luetzel
                                      last edited by

                                      ok, then you can try to check whats going on using 'sudo bluetoohctl'
                                      It should display all bluetooth devices:

                                      [NEW] Controller 00:1B:10:00:2A:EC raspi5 [default]
                                      [NEW] Device 01:B6:AD:7F:63:25 PLAYSTATION(R)3 Controller
                                      [NEW] Device 01:B6:52:85:63:25 PLAYSTATION(R)3 Controller
                                      [NEW] Device 20:73:AB:91:DD:6F Bluetooth V3.0 Keyboard

                                      with info 01:B6:AD:7F:63:25, I see:

                                      Device 01:B6:AD:7F:63:25
                                      Name: PLAYSTATION(R)3 Controller
                                      Alias: PLAYSTATION(R)3 Controller
                                      Class: 0x000540
                                      Icon: input-keyboard
                                      Paired: no
                                      Trusted: yes
                                      Blocked: no
                                      Connected: yes
                                      LegacyPairing: no
                                      UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
                                      Modalias: usb:v054Cp0268d0000

                                      check if your devices are 'trusted'

                                      Wolfman100W 1 Reply Last reply Reply Quote 0
                                      • luetzelL
                                        luetzel @Wolfman100
                                        last edited by

                                        @Wolfman100 said in SHANWAN / PS3 CONTROLLER Pi3 RETROPIE 3.6 BLUETOOTH SETUP:

                                        @luetzel

                                        Pastebin of dmesg output:

                                        http://pastebin.com/Lap42kFi

                                        and No LED 1 does not light up

                                        Hmm, thats exactly the same vendor and product id on your controller. I'm pretty sure that you should be able to pair your controller with the patched bluez.

                                        Wolfman100W 1 Reply Last reply Reply Quote 0
                                        • Wolfman100W
                                          Wolfman100
                                          last edited by

                                          I think their was a problem with the patches downloading,have rebuilt bluez and double checked patches:

                                          root@osmc:/bluez-5.39/patches# ls
                                          bluez-01_add-obexd-policy.patch bluez-11_sixaxis-fix-PID-navigation-controller.patch
                                          bluez-02_obexd-use-system-bus.patch bluez-12_sixaxis-add-support-for-setting-SDP-record.patch
                                          bluez-03_storagedir.patch bluez-13_sixaxis-provide-dualshock-3-SDP-record.patch
                                          bluez-04_work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch bluez-14_sixaxis-remove-not-needed-checks.patch
                                          bluez-05-046d-c52b-Logitech-Inc.-Unifying-Receiver.patch bluez-15_sixaxis-fix-multi-line-comments-style.patch
                                          bluez-06-broadcom-fixes.patch bluez-20-sixaxis-autotrust.patch
                                          bluez-07-broadcom-dont-set-speed-before-loading.patch bluez-link_against_ncurses.patch
                                          root@osmc:/bluez-5.39/patches#

                                          1 Reply Last reply Reply Quote 0
                                          • Wolfman100W
                                            Wolfman100 @luetzel
                                            last edited by

                                            @luetzel

                                            have updated:

                                            GNU nano 2.2.6 File: bluetooth.ver

                                            {
                                            global:
                                            btd_;
                                            g_dbus_
                                            ;
                                            info;
                                            error;
                                            debug;
                                            baswap;
                                            ba2str;
                                            sdp_*;
                                            local:
                                            *;
                                            };

                                            luetzelL 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.