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

    Bluetooth can't connect via RetroPie-Setup

    Scheduled Pinned Locked Moved Help and Support
    bluetoothgobjectpythonraspberry pi 2b
    9 Posts 3 Posters 4.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.
    • M
      MikeOShay
      last edited by

      Pi Model or other hardware: Raspberry Pi 2 Model B V1.1
      Power Supply used: USB 3.0 plugged into desktop computer
      RetroPie Version Used: RetroPie-Setup v4.4.1, last commit 111043b6
      Built From: https://github.com/RetroPie/RetroPie-Setup/releases/download/4.4/retropie-4.4-rpi2_rpi3.img.gz (I think)
      USB Devices connected: USB Keyboard, USB Wi-Fi adapter, USB Bluetooth adapter
      Controller used: USB Keyboard
      Error messages received: Note: the following was sight-transcribed with line breaks entered later for legibility, but I believe it's fully accurate.

      An error occurred connecting to the bluetooth device (Traceback (most recent call last):
      File "/home/pi/RetroPie-Setup/scriptmodules/supplementary/bluetooth/bluez-test-device", line 11, in <module> from gi.repository import GObject
      File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 145, in load_module importlib.import_module('gi.repository.' + dep.split("-")[0])
      File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name)
      File "/usr/lib/python2.7/dist_packages/gi/importer.py", line 146, in load_module dynamic_module = load_overrides(introspection_module)
      File "/usr/lib/python2.7/dist-packages/gi/overrides/__init__.py", line 125, in load_overrides override_mod = importlib.import_module(override_package_name)
      File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name)
      File "/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py", line 25, in <module> import socket
      File "/usr/lib/python2.7/socket.py", line 47, in <module> import _socket
      SystemError: PyErr_NewException: name must be module.class)
      

      Log found in /dev/shm/runcommand.log (if relevant): /dev/shm/runcommand.log didn't exist when I checked
      File: /home/pi/RetroPie-Setup/scriptmodules/supplementary/bluetooth/bluez-test-device
      How to replicate the problem:

      • Emulationstation UI > RetroPie Settings > Bluetooth
        (Same error occurs in Emulationstation UI > RetroPie Settings > RetroPie Setup > Configuration / tools > bluetooth as well)
      • Display Registered & Connected Bluetooth Devices
      • Error appears

      The same occurs with "Remove Bluetooth Device" and "Connect now to all registered devices" as well.
      If I try "Register and Connect to Bluetooth Device", it scans and detects the correct devices, but gives this error when I try to connect.

      I've successfully connected via command line with bluetoothctl, however I ran into issues trying to scan and auto-connect on startup, and I think the setup UI might prove more successful.

      I've tried uninstalling and reinstalling gobject-python and gobject-python-2, updating and upgrading RetroPie, to no avail.

      markyh444M mituM 2 Replies Last reply Reply Quote 0
      • markyh444M
        markyh444 @MikeOShay
        last edited by

        @mikeoshay if you're powering it from a USB port on your PC with that amount of USB devices connected off its then you're going to have power issues. Could explain why the Bluetooth isn't working as expected. Are you not getting any lightning bolt warnings in the top corner? I'd recommend getting a proper power supply and starting over.

        Retropie in a NES - Pi 3 with Mausberry circuit shutdown switch wired to buttons and 8bitdo NesPro30 controller
        Retropie in a Saturn Controller - Pi Zero, GPIO controls using DB9 driver
        Retropie in a PSX - Pi3
        https://markyh444.wordpress.com

        M 1 Reply Last reply Reply Quote 0
        • M
          MikeOShay @markyh444
          last edited by MikeOShay

          @markyh444 I've run it via wall-powered USB with no under-voltage messages or lightning bolt, same problem.

          I don't know why it isn't working as expected, that's why I'm here. Any action I try to do via the bluetooth menu outputs the error from the first post, triggering on bluez-test-device, line 11. I haven't been able to find any info about the error online.

          [Edit: Reworded for clarity]

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

            @mikeoshay Can't say I can reproduce the error, but it's true I have a 3b with a BT adapter. Can you provide a dmesg output - on pastebin.com ?
            EDIT: If you can use bluetoothctl to connect the device, it should be enough to pair it and configure it in Emulationstation.

            M 1 Reply Last reply Reply Quote 0
            • M
              MikeOShay @mitu
              last edited by

              @mitu Here you go, https://pastebin.com/9fKkhR7X
              If there's any syntax-highlighting that would be preferred, let me know and I'll change it.

              Regarding bluetoothctl, I've been able to connect and configure controllers that way, but I'm trying to automatically scan for my bluetooth controllers on startup. I was hoping the Setup UI would be able to help with this, since none of the guides I found for automatic detection/connection via bluetoothctl seemed to work.

              Even if bluetoothctl can do this, it would be nice to clear up this error message, no fun having something broken in the system. But if you have any suggestions on auto-connecting, I'm all ears.

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

                The only error in the kernel output is

                [    5.683485] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2						
                [    5.683520] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found
                

                which suggest you'll need a firmware blob to get rid of this error. It might be a red herring, but you could give it a try at fixing this error.

                M 1 Reply Last reply Reply Quote 0
                • M
                  MikeOShay @mitu
                  last edited by

                  @mitu Any suggestions on how I would do that? I'm new to a lot of this.

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

                    @mikeoshay Since there doesn't seem a Debian package for the firmware blob, you'll have to download it separately (see https://github.com/alecz20/broadcom-bt-firmware/blob/master/brcm/BCM20702A1-0a5c-21f3.hcd) and then copy it to /lib/firmware/brcm/ on the PI system.

                    1 Reply Last reply Reply Quote 0
                    • M
                      MikeOShay
                      last edited by

                      @mitu I did it, but then suddenly my wi-fi dongle stopped working. Then I tried some more troubleshooting attempts for that and messed stuff up even more.

                      Much as it pains me, I'm just reinstalling RetroPie and doing it all from scratch. I made backups of everything, so hopefully I'll be able to salvage some of my customizations.

                      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.