Bluetooth reconnect

  • Hi guys,
    I've got an issue with a bt controller:

    If I try to pair it using libreelec settings addon, everything works fine, until I reboot the rPI (rPi2). Once I reboot, I am no table to connect again, unless I go to libreelec settings addon, and delete the prevous connection (it appears like trusted but does not pair/connect again).

    Once I delete the bt entry on settings addon, I can search for a device again, and pair/connect fine.

    If I try to use bluetoothctl, the device never connects; it only works by libreelec settings addon, so I cannot make an script or something like that.

    As you guess, this a tricky method.

    Is there anyway to connect automatically, or do it by any kind of scripts, maybe?

    I am using libreelec 7.0.3 on a rPI2.

    Thanks.

  • Nobody with a similar problem?

  • i am having the same problem with libreelec 8.01 RPi3 with a Rii 8i+BT keyboard. The connection does not survive a reboot. Have to go into bluetooth setting and re-connect. Then it works fine till the next reboot. Just will not auto connect. Bummer

  • Bump it appears that google turns up no useful results on the solution to auto connect either it just adds another keyboard and you have to reconnect to that one very annoying.

    So each time I boot I need to dig the wired keyboard out of the closet in the storage container on the bottom or in the middle of the pile just to use libreelec quite the headache...

    I would like for libreelec to just stay paired to the keyboard a real simple thing that should happen by default after trust and pair is assumed.

    I am using a 1byone keyboard with mousepad.

    Libre Elec 8.x Rpi3


    Any help on this one or if anyone has figured it out please do share as I am not finding much on this issue other than people talking about it with zero solutions.

  • My ps3 bluetooth dvd remote keeps paired until the remote battery runs out, then it needs re-pairing.

    I cannot track down the cause or fix, but I usually do the re-pair using kore as a remote (easier than getting out a keyboard!)

  • So it is a bug that needs fixing would be excellent if the DEV's could work this one out and push out an update....

    In the mean time I will have to investigate kore I guess. I seen there was enable standby option maybe this has something to do with it? IDK

    Will have to keep searching there must be a solution somewhere somehow someway.... The impossible only takes longer I guess.

    By the way most excellent thank you for the quick and insightful response.

  • Has there been any updates on this topic? I'm having the same problem, my LibreELEC system is not able to reconnect to a bluetooth speakers after a reboot.

    Any ideas / workarrounds to solve this?

  • The problem doesn't rely on the RPi3 but on the Linux Kernel and its bluetooth stack if BT and WLAN is used at the same time.

    This will result very likely in problems when both standards share the same antenna, which they do on the RPi3.

    A solution is to use either a BT or WLAN USB dongle separately or an Ethernet cable instead of WLAN.

  • Hi. I have the same problem with RPi2 (BT dongle) and RPi3 (onboard BT) and I'm using wired Ethernet in both cases. My Echo auto-reconnects after reboot so the BT speakers I am connecting to support auto-reconnect.

    I too have to manually reconnect to the speakers in LibreElec settings after a reboot.

    Does anyone know if there a bash script we can run at boot time to force a reconnect?

    Thanks folks.

  • Found it!

    created /storage/.config/autostart.sh

    (accessible through samba share /configfiles/autostart.sh)

    from terminal set it as executable (chmod a+x /storage/.config/autostart.sh)

    then put this in it: (if editing from Windows don't use windows notepad - use notepad++ or it messes up the line ends)

    #!/bin/bash

    (

    sleep 5

    echo -e "connect xx:xx:xx:xx:xx:xx\nexit" | bluetoothctl

    sleep 5

    echo -e "connect xx:xx:xx:xx:xx:xx\nexit" | bluetoothctl

    sleep 10

    echo -e "connect xx:xx:xx:xx:xx:xx\nexit" | bluetoothctl

    sleep 10

    echo -e "connect xx:xx:xx:xx:xx:xx\nexit" | bluetoothctl

    sleep 10

    echo -e "connect xx:xx:xx:xx:xx:xx\nexit" | bluetoothctl

    ) &

    replace xx:xx:xx:xx:xx:xx with the mac address of your bluetooth speakers (you can see it in the Bluetooth screen in Libreelec config)

    I put it in lots of times as it was sometimes failing in testing (possibly because I was too far for the BT speakers). Doesn't seem to adversely affect it so I left it.

    Putting the commands between ( ) & means they run whilst Kodi is starting, rather than Kodi waiting until done.

    This works on RPi2 with BT dongle and RPi3.

    Hope this helps.

  • I have a similar issue with my RPi3 and libreelec 9.2.6: I have a BT dongle attached to my RPi and want to connect my Teufel Stereo L speakers.

    When I turn BT OFF via "Libreelec settings --> services" then go to "Libreelec settings --> BT" it shows me no devices and tells me BT is OFF although the dongle is connected. So it would seem the solution under post #9 doesn't work for me (please correct me if I am wrong).

    So what I did is that I added a line in the config.txt "dtoverlay=disable-bt" to disable the onboard BT of my RPi and leave BT under "Libreelec settings --> services" ON. Now it shows me the devices and "hciconfig -a" shows me that it uses the BT USB dongle. However, if there is no sound playing for a while or if I reboot my RPi, I have to go into ""Libreelec settings --> BT" and pair the device (Teufel Stereo L speakers) again.

    How can I set it up that it automatically reconnects on reboot and that it doesn't loose connection if no sound is played? The latter might actually be a standby function of the speakers but would be happy for a solution there as well, e.g. RPi tells them that there is sound again and they switch on (similar as to sending a connect command via "Libreelec settings --> BT".