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

    Problem connecting bluetooth controllers on pi4

    Scheduled Pinned Locked Moved Help and Support
    bluetoothcontrollerspi4 4gbretropie 4.7.1
    16 Posts 6 Posters 3.5k 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.
    • B
      Barbakaas
      last edited by Barbakaas

      Hello,

      I have searched this forum and the rest of the internet and didt not find a solution to my problems, if there is an answer please refer me to it and delete this thread.

      I have recently bought a pi4 and installed Retropie v4.7.1 via Raspberry Pi Imager on a 16gb class 10 SD card. For what its worth, I am using an original Raspberry Pi power supply, and have connected the Pi via WiFi and use SSH to use the command line. I am however having issues connecting bluetooth controllers to the Pi, so much so that I thought the Pi I had was defective and got another one. However this one is giving me problems as well so it must be on my end, I am at a loss though. I am not using a dongle, but the on board Bluetooth. Here are some of the outputs associated with bluetooth

      pi@retropie:~ $ systemctl status bluetooth
      ● bluetooth.service - Bluetooth service
         Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
         Active: active (running) since Fri 2021-03-05 20:15:21 CET; 6min ago
           Docs: man:bluetoothd(8)
       Main PID: 526 (bluetoothd)
         Status: "Running"
          Tasks: 1 (limit: 4915)
         CGroup: /system.slice/bluetooth.service
                 └─526 /usr/lib/bluetooth/bluetoothd
      
      Mar 05 20:15:21 retropie systemd[1]: Starting Bluetooth service...
      Mar 05 20:15:21 retropie bluetoothd[526]: Bluetooth daemon 5.50
      Mar 05 20:15:21 retropie systemd[1]: Started Bluetooth service.
      Mar 05 20:15:21 retropie bluetoothd[526]: Starting SDP server
      Mar 05 20:15:21 retropie bluetoothd[526]: Bluetooth management interface 1.14 initialized
      Mar 05 20:15:21 retropie bluetoothd[526]: Sap driver initialization failed.
      Mar 05 20:15:21 retropie bluetoothd[526]: sap-server: Operation not permitted (1)
      Mar 05 20:15:21 retropie bluetoothd[526]: Failed to set privacy: Rejected (0x0b)
      

      this says failed to set privacy, could that have to do anything with it?

      pi@retropie:~ $ hciconfig -a
      hci0:   Type: Primary  Bus: UART
              BD Address: B8:27:EB:F1:E5:B3  ACL MTU: 1021:8  SCO MTU: 64:1
              UP RUNNING
              RX bytes:2257 acl:0 sco:0 events:133 errors:0
              TX bytes:2357 acl:0 sco:0 commands:133 errors:0
              Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
              Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
              Link policy: RSWITCH SNIFF
              Link mode: SLAVE ACCEPT
              Name: 'retropie'
              Class: 0x000000
              Service Classes: Unspecified
              Device Class: Miscellaneous,
              HCI Version: 5.0 (0x9)  Revision: 0x150
              LMP Version: 5.0 (0x9)  Subversion: 0x6119
              Manufacturer: Cypress Semiconductor Corporation (305)
      
      pi@retropie:~ $ hcitool dev
      Devices:
              hci0    B8:27:EB:F1:E5:B3
      
      pi@retropie:~ $ bluetoothctl list
      Controller E4:5F:01:04:B9:75 retropie [default]
      [bluetooth]# show e4:5f:01:04:b9:75
      Controller E4:5F:01:04:B9:75 (public)
              Name: retropie
              Alias: retropie
              Class: 0x00000000
              Powered: yes
              Discoverable: no
              Pairable: yes
              UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
              UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
              UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
              UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
              UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
              Modalias: usb:v1D6Bp0246d0532
              Discovering: no
      

      The MAC addresses of hci0 and the controller in bluetoothctl are different, i'm not sure if this is supposed to be like this but am unsure if or how to change it.

      then in bluetoothctl :

      [bluetooth]# default-agent
      Default agent request successful
      [bluetooth]# scan on
      [NEW] Device DC:2C:26:FE:89:92 Thrustmaster gamepad
      [bluetooth]# pair dc:2c:26:fe:89:92
      Attempting to pair with DC:2C:26:FE:89:92
      [CHG] Device DC:2C:26:FE:89:92 Connected: yes
      [CHG] Device DC:2C:26:FE:89:92 Connected: no
      

      after this nothing more seems to happen except that the scan keeps finding many other devices and seemingly connects and disconnects with many of them.

      when i try to pair again:

      [bluetooth]# pair dc:2c:26:fe:89:92
      Attempting to pair with DC:2C:26:FE:89:92
      Failed to pair: org.bluez.Error.AlreadyExists
      

      however when i check paired devices:

      [bluetooth]# paired-devices
      [bluetooth]#
      

      it doesn't see any registered devices. So for good measure i remove the MAC address even though it didn't really register and try to directly connect to it.

      [bluetooth]# connect dc:2c:26:fe:89:92
      Attempting to connect to dc:2c:26:fe:89:92
      Failed to connect: org.bluez.Error.Failed
      

      Trusting the MAC address prior to pairing and/or connecting to it does nothing to fix the problem.
      The same problems occur with any other controllers I try to connect (8bitdo sf30 pro, dualshock 4 v2 (both of them)). All these controllers connected without issue to both my laptop running Windows 10 and to my Raspberry pi 3b+ with Retropie.

      Running an update does update a lot of things, but does not solve the problem.

      Surely I can't be the only one with this problem, I have searched far and wide on the internet but I am still very much a novice regarding linux things so please forgive me if there are any dumb mistakes.

      EDIT: I tried using the bluetooth tool in Retropie itself many times, but have resorted to try to manually connect as I gained more knowledge. Also the tool kept freezing up after selecting the "security channel"

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @Barbakaas
        last edited by

        @barbakaas You may be stumbling on this issue. If you just installed your Pi4, can you run sudo rpi-update, then reboot and try to pair again your controller(s) ?

        1 Reply Last reply Reply Quote 0
        • B
          Barbakaas
          last edited by

          I tried this, but now I seem to be encountering a problem that I have encountered a few times before, usually after running the update but did not encounter in this installation yet

          pi@retropie:~ $ hcitool dev
          Devices:
          pi@retropie:~ $
          
          pi@retropie:~ $ hciconfig -a
          hci0:   Type: Primary  Bus: UART
                  BD Address: E4:5F:01:04:B9:75  ACL MTU: 1021:8  SCO MTU: 64:1
                  DOWN
                  RX bytes:794 acl:0 sco:0 events:46 errors:0
                  TX bytes:823 acl:0 sco:0 commands:54 errors:0
                  Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
                  Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
                  Link policy: RSWITCH SNIFF
                  Link mode: SLAVE ACCEPT
          
          pi@retropie:~ $ sudo hciconfig hci0 up
          Can't init device hci0: Connection timed out (110)
          
          [bluetooth]# list
          Controller E4:5F:01:04:B9:75 retropie [default]
          [bluetooth]# show e4:5f:01:04:b9:75
          Controller E4:5F:01:04:B9:75 (public)
                  Name: retropie
                  Alias: retropie
                  Class: 0x00000000
                  Powered: no
                  Discoverable: no
                  Pairable: yes
                  UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
                  UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
                  UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
                  UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
                  UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
                  Modalias: usb:v1D6Bp0246d0532
                  Discovering: no
          [bluetooth]# power on
          Failed to set power on: org.bluez.Error.Failed
          

          So, I can not begin to attempt to pair the controllers right now, unfortunately

          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @Barbakaas
            last edited by

            @barbakaas In this case, revert to the stable (installed from apt ) kernel with

            sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
            

            Try installing the xpadneo driver and see if the Thrustmaster or the 8bitdo controller pair.

            1 Reply Last reply Reply Quote 0
            • B
              Barbakaas
              last edited by

              I did the rollback to the stable version. however when trying to install xpadneo I get this error

              pi@retropie:~/xpadneo $ git clone https://github.com/atar-axis/xpadneo.git
              cd xpadneo
              sudo ./installCloning into 'xpadneo'...
              remote: Enumerating objects: 173, done.
              remote: Counting objects: 100% (173/173), done.
              remote: Compressing objects: 100% (90/90), done.
              remote: Total 3413 (delta 111), reused 128 (delta 76), pack-reused 3240
              Receiving objects: 100% (3413/3413), 20.51 MiB | 5.71 MiB/s, done.
              Resolving deltas: 100% (2131/2131), done.
              pi@retropie:~/xpadneo $ cd xpadneo
              pi@retropie:~/xpadneo/xpadneo $ sudo ./install
              sudo: ./install: command not found
              

              which i find very weird. I looked at the github page and tried to do the setup for "generic distributions" but that didn't work either. Both DKMS and raspberrypi-kernel-headers seem to be up to date as stated in the prerequisites.

              Again I apologize if I'm missing some basic knowledge, but I never expected to have to dive this deep into linux to get things working!

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @Barbakaas
                last edited by

                @barbakaas You can install it from RetroPie-Setup, it's under the drivers section of the packages.

                1 Reply Last reply Reply Quote 0
                • P
                  philcsf
                  last edited by philcsf

                  I recently fixed the Bluetooth stability issues by rolling back to the last stable 5.4 kernel. Bear in mind that you'll no longer be able to do 'apt-get upgrade' without the kernel auto-updating to the buggy 5.10 version.

                  sudo rpi-update 453e49b
                  
                  L 1 Reply Last reply Reply Quote 0
                  • B
                    Barbakaas
                    last edited by

                    Ok, so I still encountered the problems from my last post where hci0 seems to be powered down, I reinstalled a fresh image onto the sd card, configured wifi and ssh, and installed xpadneo via the setup menu.

                    However even with the fresh install it now doesnt want to power on the bluetooth connector. I will leave it for today and try again tomorrow, could there be some configs or something that could carry over between installs? how can this bluetooth connector be so random.

                    Thank you for your help up until now though!

                    1 Reply Last reply Reply Quote 0
                    • B
                      Barbakaas
                      last edited by

                      Update: I gave up and got a bluetooth dongle. I disabled on board bluetooth and was able to connect everything in a matter of minutes. I find it hard to believe that both Pi's had faulty bluetooth chips. Is there some way to test this? With a multi-meter or something?

                      Anyway I learned a lot about linux, raspberry Pi's and how bluetooth works so its not been for nothing.

                      L 1 Reply Last reply Reply Quote 0
                      • aluin13A
                        aluin13
                        last edited by

                        @barbakaas I'm encountering the same issue as you, but what I've found is if I install a new dongle, re-image the pi, or otherwise start with fresh bluetooth settings, I am able to pair my devices once. However, I inevitably encounter weird bluetooth issues on subsequent reboots that end up causing me to have to re-pair. Then, I'm back to square one and cannot get around the org.bluez.Error.AlreadyExists exception.

                        This has been driving me bananas for the last few days.

                        L 1 Reply Last reply Reply Quote 0
                        • L
                          luzer @Barbakaas
                          last edited by

                          @barbakaas said in Problem connecting bluetooth controllers on pi4:

                          Update: I gave up and got a bluetooth dongle. I disabled on board bluetooth and was able to connect everything in a matter of minutes. I find it hard to believe that both Pi's had faulty bluetooth chips. Is there some way to test this? With a multi-meter or something?

                          Anyway I learned a lot about linux, raspberry Pi's and how bluetooth works so its not been for nothing.

                          i tried this but had issues
                          do you have more details?

                          B 1 Reply Last reply Reply Quote 0
                          • L
                            luzer @philcsf
                            last edited by

                            @philcsf said in Problem connecting bluetooth controllers on pi4:

                            sudo rpi-update 453e49b

                            do you still need to do this with the latest pi images?

                            P 1 Reply Last reply Reply Quote 0
                            • P
                              philcsf @luzer
                              last edited by

                              @luzer I think they fixed in in a newer kernel (it's up to 5.10.24 or so now), but the stable version (5.10.17) is still broken. Try running rpi-kernel after your standard apt update/upgrade to get the latest dev kernel.

                              1 Reply Last reply Reply Quote 1
                              • L
                                luzer @aluin13
                                last edited by

                                i just restarted everything and get this error

                                @aluin13 said in Problem connecting bluetooth controllers on pi4:

                                @barbakaas I'm encountering the same issue as you, but what I've found is if I install a new dongle, re-image the pi, or otherwise start with fresh bluetooth settings, I am able to pair my devices once. However, I inevitably encounter weird bluetooth issues on subsequent reboots that end up causing me to have to re-pair. Then, I'm back to square one and cannot get around the org.bluez.Error.AlreadyExists exception.

                                This has been driving me bananas for the last few days.

                                1 Reply Last reply Reply Quote 0
                                • R
                                  rafaz182
                                  last edited by

                                  @philcsf I did it but I still receiving failed to connect org.bluez.error.failed

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    Barbakaas @luzer
                                    last edited by

                                    @luzer

                                    In boot/config.txt I added dtoverlay=disable-bt to disable the onboard bluetooth. The bluetooth dongle is a cheap one (€10 ish) but it works fine. I did connect my controllers through the bluetoothctl command line options just so I could check how things worked behind the menu in retropie.

                                    Can't help you any further though, sorry.

                                    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.