LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   bluetooth robot won't connect (https://www.linuxquestions.org/questions/linux-hardware-18/bluetooth-robot-wont-connect-4175621387/)

Pedroski 01-10-2018 07:42 PM

bluetooth robot won't connect
 
1 Attachment(s)
Hi, I got this cute little bluetooth robot speaker as a present. My computer sees it, but somehow fails to connect.

I get: "Device added successfully, but failed to connect."

I never could connect to an older set of bluetooth speakers that we have here either. Same problem.

I can successfully send photos from my mobile to my computer, so the bluetooth actually works.

I tried a reboot, still no joy. Any tips please?

Rickkkk 01-11-2018 03:53 PM

Hey Pedroski,

How are you using Bluetooth on your computer ? I use it regularly, but exclusively via the command line, so I may or may not be of any help to you.

First thing, using Bluetooth for audio requires additional packages compared to using it for simple file transfer type connections. You need:
  • bluez
  • bluez-libs
  • bluez-utils
  • pulseuadio
  • pulseaudio-alsa
  • pulseaudio-bluetooth
  • pavucontrol

... so make sure you have all that installed, first.

Afterwards, what I do is:
  • Enable the bluetooth systemd service
  • Start the bluetooth service
  • Start bluetoothctl
  • Issue the commands: power on, then : agent on, then: scan on,
  • This will list devices and their MAC addresses. Identify which one is your speaker.
  • Put your bluetooth speaker in pairing mode.
  • Issue the command pair [device MAC address here] in bluetoothctl.
  • Wait for positive result to pair command.
  • Issue the command connect [device MAC address here].
  • If you are successful, your bluetooth speaker will connect.

You then have to configure pulseaudio to output sound to the bluetooth speaker using pavucontrol.

... That's it in a nutshell - hope this helps.

Again, if you use some kind if GUI tools to manage Bluetooth, and if all of the required software is already installed on your computer, the solution to your situation may be different.

Let us know how it goes.

Cheers !

Pedroski 01-11-2018 04:55 PM

Thanks!

lsusb gives: Atheros Communications, Inc. AR3012 Bluetooth 4.0

Here the results of stage 1. I am using Ubuntu 16.04. 2. and 3. do not look good. Any tips?

1.
Quote:

pedro@pedro-school:~$ sudo apt-get install bluez
Reading package lists... Done
Building dependency tree
Reading state information... Done
bluez is already the newest version (5.37-0ubuntu5.1).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
pedro@pedro-school:~$
2.
Quote:

pedro@pedro-school:~$ sudo apt-get install bluez-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package bluez-libs
3.
Quote:

pedro@pedro-school:~$ sudo apt-get install bluez-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bluez-utils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
bluez:i386 bluez

E: Package 'bluez-utils' has no installation candidate

Rickkkk 01-12-2018 07:33 AM

Hey Pedroski,

#1 is no problem - bluez was simply already installed that's fine.

I should have mentioned that the names of the packages may vary slightly between distros. I use Arch so the names for Ubuntu may be slightly different. OR ... perhaps the bluez package in Ubuntu already includes what Arch packages in those 2 separate packages. Perhaps best to check the Synaptics Package Manager for anything with "bluez" in the name.

Don't forget to check all the pulseaudio stuff.

Cheers - let us know how it goes.

Pedroski 01-12-2018 05:32 PM

Ubuntu runs on pulseaudio by default.

I can connect my laptop to my phone, send and receive files via bluetooth. I can connect my phone to my speakers and play music via bluetooth. Therefore, I think everything works.

https://www.howtoforge.com/tutorial/...ooth-on-linux/

pulseaudio needs this module in Ubuntu. It was not installed. But it still does not work, nothing shows in pulseaudio's output tab. And no sound via bluetooth!

Quote:

sudo apt-get install pulseaudio-module-bluetooth
But I still cannot connect to the speakers and stream audio! Any further tips?

Quote:

This is from lsusb

Bus 004 Device 002: ID 0cf3:3004 Atheros Communications, Inc. AR3012 Bluetooth 4.0
Quote:

pedro@pedro-school:~$ lsmod | grep -i bluetooth
bluetooth 520192 40 bnep,ath3k,btbcm,btrtl,btusb,rfcomm,btintel
Quote:

dmesg | grep -i blue
[ 2.795474] usb 4-3: Product: Bluetooth USB Host Controller
[ 6.861607] Bluetooth: Core ver 2.21
[ 6.861655] Bluetooth: HCI device and connection manager initialized
[ 6.861665] Bluetooth: HCI socket layer initialized
[ 6.861671] Bluetooth: L2CAP socket layer initialized
[ 6.861683] Bluetooth: SCO socket layer initialized
[ 8.645979] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 8.645990] Bluetooth: BNEP filters: protocol multicast
[ 8.646006] Bluetooth: BNEP socket layer initialized
[ 9.212443] Bluetooth: RFCOMM TTY layer initialized
[ 9.212468] Bluetooth: RFCOMM socket layer initialized
[ 9.212489] Bluetooth: RFCOMM ver 1.11
pedro@pedro-school:~$ sudo apt-get install --reinstall bluez

Rickkkk 01-13-2018 09:22 AM

Hi Pedroski,

Since you're able to transfer files with Bluetooth on your Ubuntu computer, we can safely assume that the bluetooth systemd service is running.

From the command line, have you tried running bluetoothctl and issuing the commands I mentioned in a earlier post ? I realize that with Ubuntu you might usually manage this graphically, but perhaps this will provide clues as to what is not working.

Let us know how it goes.

Mill J 01-13-2018 10:03 PM

https://vilimpoc.org/blog/2016/04/30...ooth-speakers/ had the same problem awile ago this worked for me.
Another suggestion: give blueman a whirl.

Pedroski 01-28-2018 06:57 PM

Went on holiday to Vietnam, just got back!

From the command line:

Quote:

pedro@pedro-school:~$ bluetoothctl
[NEW] Controller 24:F5:AA:B7:5E:7C pedro-school [default]
[NEW] Device FC:58:FA:C7:65:C9 MINIS099
[NEW] Device 74:23:44:4C:31:F9 PedrosPhone
[NEW] Device FC:58:FA:1D:06:09 C-89
[NEW] Device 3C:C2:43:93:9D:85 3C-C2-43-93-9D-85
[bluetooth]# pair FC:58:FA:1D:06:09
Attempting to pair with FC:58:FA:1D:06:09
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]#
Also, I switched the robot off, then on, got this:

Quote:

[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[bluetooth]# quit
[DEL] Controller 24:F5:AA:B7:5E:7C pedro-school [default]
pedro@pedro-school:~$
I had already changed /etc/bluetooth/main.conf to AutoEnable=true a while ago. Still don't work!

Rickkkk 01-28-2018 08:25 PM

Hey Pedroski,

Just a thought ... make sure your phone isn't connected to your speaker while you're trying to connect your laptop to it .. This happened to me once ... seems to me I got similar behaviour from bluetoothctl ...

Cheers.

Pedroski 01-28-2018 08:49 PM

phone bluetooth is off. Unless a neighbour is blocking access somehow, but like I said, I can connect my phone to the robot no trouble, so I do not think it is otherwise paired, or that would not work.

Mill J 01-28-2018 08:55 PM

Did my link work? Ubuntu 16 04 has some problems with Bluetooth out of the box. I found after editing that file, I have to remove/unpair the device from the built in Bluetooth setting gui than add it to trusted(star button) before pairing/connecting.

Pedroski 01-29-2018 02:13 AM

I read that link, thanks. I had already changed that main.conf file as suggested a couple of weeks ago.

I just deleted the device C89, then reinstalled it. When I go to System Settings>Bluetooth I see C89 connection OFF, and there is no way to turn it on. Why is the device connected: yes then a second later connected: no. Something is wrong.

Quote:

pedro@pedro-school:~$ bluetoothctl
[NEW] Controller 24:F5:AA:B7:5E:7C pedro-school [default]
[NEW] Device FC:58:FA:1D:06:09 C-89
[NEW] Device 74:23:44:4C:31:F9 PedrosPhone
[NEW] Device 3C:C2:43:93:9D:85 3C-C2-43-93-9D-85
[bluetooth]# pair FC:58:FA:1D:06:09
Attempting to pair with FC:58:FA:1D:06:09
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]# pair FC:58:FA:1D:06:09
Attempting to pair with FC:58:FA:1D:06:09
Failed to pair: org.bluez.Error.AlreadyExists
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[CHG] Device FC:58:FA:1D:06:09 Connected: yes
[CHG] Device FC:58:FA:1D:06:09 Connected: no
[bluetooth]#


All times are GMT -5. The time now is 09:28 AM.