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

    Reconnect Bluetooth controller with a button

    Scheduled Pinned Locked Moved Help and Support
    8bitdobuttonbluetoothscript
    1 Posts 1 Posters 833 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.
    • I
      invader
      last edited by

      So I made my sister a great Retropie setup with a 8Bitdo SFC30 Bluetooth controller. Everything works really well. The first issue I’ve run into, is the controller lost its pairing. Now, I’m trying to make this as easy as possible for her. So I’ve hidden all the setup menus as she won’t have a keyboard connected.

      So the best thing I could think of was to make a physical button to reconnect the controller. I’ve had an 8Bitdo controller working really well with my Raspberry pi, with heaps of reboots and a lot of time not using it etc. I used the Retropie setup script to connect it and setup the UDEV rule. So the only thing I can think of that might have happened to my sister’s is holding SELECT on the controller and it forgets the pairing. I will tell my sister not to do this, but I like the button as a catch all in case it happens again, or if something else goes wrong and the pairing messes up.

      I tried to reverse engineer the setup script, but alas, my BASHfu isn’t up to the task. I have figured out how to connect the controller with:

      pi@retropie:~/RetroPie-Setup $ bluetoothctl
      [bluetooth]# scan on
      [bluetooth]# remove 63:0F:24:AD:61:0D
      [bluetooth]# pair 63:0F:24:AD:61:0D
      [bluetooth]# connect 63:0F:24:AD:61:0D
      [bluetooth]# trust 63:0F:24:AD:61:0D

      And after rebooting it connects again. Woo hoo!

      So what I really want, is a script that:

      Starts scanning
      [bluetooth]# scan on

      Remove the device so it can properly be re-paired
      [bluetooth]# remove 63:0F:24:AD:61:0D

      Pairs the device, if it isn’t available, keeps trying until it pairs
      [bluetooth]# pair 63:0F:24:AD:61:0D

      Connects the device if it isn’t available, keeps trying
      [bluetooth]# connect 63:0F:24:AD:61:0D

      Trusts the device, (I think this is required so it reconnects on reboot)
      [bluetooth]# trust 63:0F:24:AD:61:0D

      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.