LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-10-2018, 07:42 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
bluetooth robot won't connect


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?
Attached Thumbnails
Click image for larger version

Name:	bluetoothRobot.jpg
Views:	16
Size:	123.8 KB
ID:	26729  
 
Old 01-11-2018, 03:53 PM   #2
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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 !
 
Old 01-11-2018, 04:55 PM   #3
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
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

Last edited by Pedroski; 01-11-2018 at 06:58 PM.
 
Old 01-12-2018, 07:33 AM   #4
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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.
 
Old 01-12-2018, 05:32 PM   #5
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
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

Last edited by Pedroski; 01-12-2018 at 05:41 PM.
 
Old 01-13-2018, 09:22 AM   #6
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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.
 
Old 01-13-2018, 10:03 PM   #7
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,258
Blog Entries: 2

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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.
 
Old 01-28-2018, 06:57 PM   #8
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
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!

Last edited by Pedroski; 01-28-2018 at 07:10 PM.
 
Old 01-28-2018, 08:25 PM   #9
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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.
 
Old 01-28-2018, 08:49 PM   #10
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
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.
 
Old 01-28-2018, 08:55 PM   #11
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,258
Blog Entries: 2

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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.
 
Old 01-29-2018, 02:13 AM   #12
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
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]#
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Raspberry Pi robot and hobby kit robot guide part 1 LXer Syndicated Linux News 0 01-31-2015 04:21 PM
Nokia E65- won't connect via USB. No Bluetooth. SunshineTalia Ubuntu 0 04-23-2007 04:02 AM
Tux Droid : Robot that can Connect To A Linux Os BeberGold Linux - News 0 02-23-2007 01:49 PM
Bluetooth, detects phone won't connect millionknives Slackware 5 02-14-2007 09:58 AM
LXer: Linux robot site launches with user-controllable robot LXer Syndicated Linux News 0 01-12-2006 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration