Bluetooth & Linux, pain in the butt

Posted on
  • Hi, I'm Niko and I'm using Linux. Hello Niko.
    Anybody else? I can't anymore, I'm desperate, I need help!

    A week ago or so, I got the banglejs2, turned it on, used chromium to connect and it worked out of the box. You can't imagine the happiness.

    Next day: no way! Bluetooth connects to the watch but chromium: bright orange "Device connection failed". After uncountable approaches, changes in settings, and internet searches I give up and order a dongle. The good stuff, a "CSR"-one!

    Plugged it in, didn't really know how to tell chromium which adapter to use but after a while (and a reboot) it worked. Happiness came back. Couple of days go by without major problems.

    Today I plug the dongle out and later plug it back in. Oh dear! No way I can make chromium scan BT with the dongle. Always internal, always the bright orange needle in the heart. What can I do? Any ideas.

    Why is BT on Linux such a pain in the butt? Who is to blame? I want to blame someone.

    Thanks for coming to my rant.

    By the way: bangle 2v12, Bluez 5.60, kernel 5.13

  • Hi,
    Also a Linux user. Not had an issue with the Bangle yet but had issues with other random Bluetooth things. When this sort of thing happens, best bet is to try combinations of reboot, restart the Bluetooth service, and toggle the adapter with rfkill. You could use rfkill to choose your adapter I guess, but don't think it is your main problem.

  • Not sure this'll make you feel any better, but I use Linux for everything here and it works fine for me.

    Very very occasionally I'll have to /etc/init.d/bluetooth restart, or sometimes 'unpair' the device in Bluetooth settings. On my laptop I use the internal bluetooth but sometimes I do have to modprobe -r btush;modprobe btusb with that as I think the adaptor gets confused.

    Might also be worth just trying normal Chrome (not Chromium). I've heard others have had more success with that (and it's what I use)

  • Linux also. Linuxmint. I use ungoogled chromium to connect for the last 3 months. It works fine besides a few quirks, solved through simple disconnect -connect.
    Maybe it's related to the watch staying connected to your previous setup ? Sorry, I don't have solution to offer you, but I can reassure you, it can work. I use quite a few bluetooth devices, usually flawlessly.

  • Hi,
    similar story here. I ordered a bluetooth dongle because the internal bluetooth worked for my Bangle only when put close to my computer and it didn't work for the Puck at all.

    The dongle worked at first after I blocked the internal bluetooth with rfkill. But only until the next reboot of the computer. Since then rfkill didn't help anymore.

    Deactivating the internal bluetooth adapter is what finally worked for me. Since then bluetooth is working for both my Bangle and my Puck.

  • I've had similar with Chromium on Ubuntu Studio 20.04. It usually connects fine the first time but if I keep disconnecting and reconnecting it starts to misbehave and struggle to connect. Shutting down Chromium and leaving it for a while seems to help. I do have quite an old laptop, mind, so could be a dodgy Bluetooth. Never get those issues on Android or my work Windows machine.

  • I don't know exactly what I was doing on the beginning that I'm not doing anymore, but sometimes I had to run this command below to make linux forget the connection and start over. May be new firmware, but I haven't needed to run the command since mid-January

    sudo rm -rf /var/lib/bluetooth/04\:6C\:59\:0D\:2B\:D­5/ && sudo service bluetooth restart
    

    (The device address should be different)

  • I use osx on desktop and I almost have problems with bangle and bluetooth, in case of problems the solution for me, both on android and on osx is to unpair the device, once done, everything returns to work ALWAYS.

  • I have Ubuntu 18.04.6 LTS. No problems at all.

  • Thanks for all the answers, I didn't have time to post here but did some bluetoothing around. I maintain that BT under linux is a pain and it shouldn't. However, here is what I found out so far:

    1. My initial observation was from ubuntu studio 21.10. After @Fteacher mentioned LinuxMint I remembered that I still had a Mint partition. So I booted into it and it worked with internal BT once. Then it didn't. Put it in the dongle and got it to work. Now, after a week, it works on the internal. I don't know what's going on. But it works.

    2. rfkill shuts down all BT. At least on a superficial level. Somehow with bluetoothctl one power one off, still connect with the other one but the GUIIs will not see any BT.

    This is all confusing but at least right now it is working for me.

  • @Niko I share your pain, my attempts of getting a bluetooth dongle to work never made it to "works reliably". I stepped back from it and I use an old lineageOS tablet now.

    I've freshly bought three different usb bluetooth dongles in May 2021. One has a Broadcom BCM20702A0, but https://github.com/winterheart/broadcom-­bt-firmware/ shows that Broadcom stopped security support a few years ago.

    The other was a "Qualcomm CSR8510" as recommended, but still had problems. This one I need to retest, because Chromium was acting strangely.

    Then there is a edimax BT-8500, which came with code for a kernel module and then was most promissing.

    So I believe there are multiple reasons for the problems:

    1. bluetooth complexity
    2. consumers being very price sensitive and just buy cheapest, so vendors produce cheaply.
    3. Chromium (which is the codebase for Chrome) not really putting a focus on this.
    4. Not enough funding/development power for GNU/Linux Bluetooth support
  • I should just reiterate here that I work on Linux all the time (mainly Mint/Ubuntu), and use a cheap BCM20702 for my desktop (it shows as 0a5c:21ec via lsbusb), my laptop's built-in Intel bluetooth, or Raspberry Pi.

    I give it a really bad time too because I'm continually connecting to hundreds of different BLE devices, then disconnecting, changing firmware and so on.

    It all works great for me, and I moved to a new desktop with a brand new install of Mint last week which also worked right out the box. So I'd be careful about writing off all Linux devices as having bad Bluetooth LE support - my experience has been very different here.

    I'm really surprised you two are having such big issues here.

    Definitely worth:

    • Trying Chrome instead of Chromium
    • Don't pair with the Linux Bluetooth menu
    • Just rebooting your PC, just in case. If that works then you can look at other ways of restarting just the relevant bit of the bluetooth stack - but I've found this isn't a big problem with any distribution I've used in the last few years
  • Don't pair with the Linux Bluetooth menu

    This is definitely something I changed here, and it might have made all the difference.

  • @Gordon thanks for sharing your experiences and hints. I agree that there are people that report having a good experience with Bluetooth on GNU/Linux. However that was not my experience. I did try the command line, two different GNU/Linux distributions, building a new kernel driver and so on, looking at various howtos. So there are some factors which are making a difference. Maybe it is the version of Linux (the kernel - I had a rather old ones). However it stopped being fun investigating.

    What I don't do is using the proprietary build of Chromium, and this would be strange if they had some proprietary stuff in there making Bluetooth better and not being in the source code.

  • Just for info - this is the configuration that is working for me (after disabling the internal bluetooth adapter as described in the link I posted above):

    • x86_64 computer bought 2013
    • up-to-date Debian Bullseye with kernel 5.10
    • Chromium (I wouldn't use Chrome either)
    • a cheap bluetooth adapter that is working out of the box with the Debian main repositories.
  • I just had problems, removing the device in Chromium under chrome://bluetooth-internals/#adapter helped.

  • I am also on Linux. Not supported on Firefox, so I tried Brave, but it did not work.

    I works with google-chrome-stable, though.

  • Not supported on Firefox

    Yes, this is a known issue. Mozilla refuse to implement Web Bluetooth in their browser.

    But to be fair I beleive pretty much all the docs say to use Chrome (or Chromium should work - but some folks have reported issues with that)

  • so I tried Brave

    Unfortunately Brave developers disabled web bluetooth intentionally because of their privacy focus. For more details see https://github.com/brave/brave-browser/i­ssues/9586#issuecomment-840743917 and https://github.com/brave/brave-browser/i­ssues/15637

  • Yes, this is a known issue. Mozilla refuse to implement Web Bluetooth
    in their browser.

    Sad but true

    *Status:
    RESOLVED WONTFIX*

    https://bugzilla.mozilla.org/show_bug.cg­i?id=674737

    Mozilla's Position:.... Like WebUSB there is significant uncertainty regarding how well prepared devices are to receive requests from arbitrary sites. The generic nature of the API means that this risk is difficult to manage. The Web Bluetooth CG has opted to only rely on user consent, which we believe is not sufficient protection. This proposal also uses a blocklist, which will require constant and active maintenance so that vulnerable devices aren't exploited. This model is unsustainable and presents a significant risk to users and their devices.

  • It's a shame they haven't reconsidered in light of Chrome using it for 8 years and there being no issues whatsoever :(

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bluetooth & Linux, pain in the butt

Posted by Avatar for Niko @Niko

Actions