User avatar
nsayer
Posts: 50
Joined: Thu Jun 26, 2014 12:43 am
Contact: Website

Re: Raspberry Pi 3 Bluetooth Setup

Thu Jun 02, 2016 12:02 am

Has anyone solved the "No default controller available" problem?

At one point I had bluetooth working with an Apple keyboard on my Pi 3, but now I'm getting this. I have no idea what changed. I have no idea where to even look to see why the bluetooth controller seems to have disappeared.

EDIT

This post:

viewtopic.php?t=148305&p=981166

Pointed out that "raspberrypi-sys-mods" was missing. I installed it, and the bluetooth controller came back.
Check out my store! http://store.geppettoelectronics.com/

pingpong2012
Posts: 28
Joined: Mon Mar 30, 2015 1:09 am

Re: Raspberry Pi 3 Bluetooth Setup

Thu Jun 02, 2016 2:28 am

I was trying to transfer images from an admittedly old phone to the Pi earlier today, and ran into a few issues:

1) With the phone discoverable, and the Pi detecting, I could pair, but the Pi offered no services (the phone literally said no services available), despite the phone supporting everything related to transferring files and audio. I could even list the services the phone supports if someone wants me to. I read http://www.instructables.com/id/Make-Ra ... PP-Server/ about an object push server,

2) Making the Pi discoverable and the phone pair with the Pi, I got a notice to input the passcode on the phone, nothing on the Pi. I guessed 0000 and 00000000, neither worked.

3) I think after I made the Pi discoverable it timed out after a while, but the bluetooth icon kept flickering. Not serious but made me curious. I could be mistaken.

Could there be some scripts added to automate installing the services? Like a window or menu is added to the bluetooth gui, which lists the services currently installed, and maybe an option to start/stop them?

JasperSlade
Posts: 3
Joined: Thu Jun 02, 2016 4:31 am

Re: Raspberry Pi 3 Bluetooth Setup

Thu Jun 02, 2016 4:38 am

Recently got my first RPi, used it to setup RetroPie. Been working to get a bluetooth gamepad working. Used the info at https://github.com/RetroPie/RetroPie-Se ... controller so I now, provided the gamepad is on during startup, it will connect. otherwise I have to drop to the command line and use bluetoothctl to get a connection.

Here are the exact instructions I followed:

Step 2.5 - Forcing the Pi to reconnect to the controller

If you find your controller doesn't automatically reconnect when you restart the Pi, this process should force the connection.
Some users have reported it will work without this if you wait for Emulation Station to fully load before turning on your controller - this is possibly model or firmware specific.

sudo nano /bin/connect-bluetooth.sh

In that file add
#!/bin/bash
sudo bluetoothctl << EOF
power on
connect [MAC Address]
exit
EOF

Save that file.
Make it executable

sudo chmod +x /bin/connect-bluetooth.sh

Then create a new file
sudo nano /etc/systemd/system/connect-bluetooth.service

Add this text:
[Unit]
Description=Connect Bluetooth

[Service]
Type=oneshot
ExecStart=/bin/connect-bluetooth.sh

[Install]
WantedBy=multi-user.target
Save that file.

Then run this command to enable that process
sudo systemctl enable /etc/systemd/system/connect-bluetooth.service

Video Guide for this: https://youtu.be/RsybSJEPZJM

Here is what I'm really hoping to figure out: If the gamepad loses connection for any reason (walk out of range, gamepad goes to sleep, etc) when it powers back on, i have to drop to the command line again to re-connect. is there a script i could write to periodically check for the gamepad and re-connect?
(Sorry if i'm a total newb)

pingpong2012
Posts: 28
Joined: Mon Mar 30, 2015 1:09 am

Re: Raspberry Pi 3 Bluetooth Setup

Fri Jun 03, 2016 5:24 am

JasperSlade wrote:
There's probably a device list that has the gamepad in it. Look for a console command to see if you can poll a service or get a list of devices, and see if the controller is in it, and if not, re-run the connection script. Could be as simple as a dumb script to see if *gamepad* is present in the output of some command. Astericks being the wildcard character, so it would check for the phrase anywhere in the returned message. I don't know what command searches through text, but if you put the output of a command to a file i.e. command --list >> /home/user/output.txt, that would put the output of the command in a text file. Another program could search for the string of your gamepad.

jfan
Posts: 1
Joined: Sat Jul 09, 2016 7:54 am

Re: Raspberry Pi 3 Bluetooth Setup

Sat Jul 09, 2016 8:00 am

On installing the latest version of Bluez and trying to scan i get the below

[email protected]:~/Desktop $ hcitool lescan
Could not open device: No such device

Please advise how to link the onboard Bluetooth chip

User avatar
Douglas6
Posts: 4710
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 3 Bluetooth Setup

Sat Jul 09, 2016 11:50 am

My guess is an improper installation of BlueZ. I'm guessing the adapter is not getting powered up, and so the service is failing. What are the results of

Code: Select all

hciconfig -a
and

Code: Select all

systemctl status bluetooth 

Cris
Posts: 1
Joined: Sun Aug 28, 2016 12:05 pm

Re: Raspberry Pi 3 Bluetooth Setup

Sun Aug 28, 2016 12:07 pm

If you get DEVICE <hex-ID> not available , try typing the HEX code exactly as printed in the scan (meaning, capitals where capitals are printed) ..

I had this issue with my keyboard...

HEX : fa is not the same as HEX : FA for the program apparently :)

zuolan
Posts: 1
Joined: Sun Sep 11, 2016 6:21 am

Re: Raspberry Pi 3 Bluetooth Setup

Sun Sep 11, 2016 6:40 am

Hi,

I am new to this with RPi3 native Bluetooth. I am able to do below:

With bluetoothctl:

[email protected]:~ $ bluetoothctl
[NEW] Controller B8:27:EB:83:18:3B raspberrypi [default]
[bluetooth]# agent on
Agent registered
[bluetooth]# list
Controller B8:27:EB:83:18:3B raspberrypi [default]
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:83:18:3B Discovering: yes
[NEW] Device 20:C3:8F:C3:93:B6 YUNMAI-SIGNAL-CW
[NEW] Device E0:A3:AC:01:EB:AA HUAWEI Mate 8
[CHG] Device 20:C3:8F:C3:93:B6 RSSI: -101
[CHG] Device 20:C3:8F:C3:93:B6 RSSI: -86


With hcitool:

[email protected]:~ $ hcitool scan
Scanning ...
E0:A3:AC:01:EB:AA HUAWEI Mate 8
[email protected]:~ $ hcitool info E0:A3:AC:01:EB:AA
Requesting information ...
Can't create connection: Operation not permitted
[email protected]:~ $ sudo hcitool info E0:A3:AC:01:EB:AA
Requesting information ...
BD Address: E0:A3:AC:01:EB:AA
Device Name: HUAWEI Mate 8
LMP Version: (0x8) LMP Subversion: 0x6119
Manufacturer: Broadcom Corporation (15)
Features page 0: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <SCO link> <HV2 packets> <HV3 packets>
<u-law log> <A-law log> <CVSD> <paging scheme> <power control>
<transparent SCO> <broadcast encrypt> <EDR ACL 2 Mbps>
<EDR ACL 3 Mbps> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <extended SCO>
<EV4 packets> <EV5 packets> <AFH cap. slave>
<AFH class. slave> <LE support> <3-slot EDR ACL>
<5-slot EDR ACL> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <EDR eSCO 2 Mbps>
<EDR eSCO 3 Mbps> <3-slot EDR eSCO> <extended inquiry>
<LE and BR/EDR> <simple pairing> <encapsulated PDU>
<err. data report> <non-flush flag> <LSTO> <inquiry TX power>
<EPC> <extended features>
Features page 1: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Features page 2: 0x7f 0x0b 0x00 0x00 0x00 0x00 0x00 0x00

I am new to this. Can someone tell if I could use these in my openhab to detect presence?
Thanks.

User avatar
ecaheti
Posts: 140
Joined: Tue Aug 14, 2012 3:06 pm
Location: Normandie, France
Contact: Website

Re: Raspberry Pi 3 Bluetooth Setup

Sun Oct 09, 2016 7:35 am

JasperSlade wrote:Recently got my first RPi, used it to setup RetroPie. Been working to get a bluetooth gamepad working. Used the info at https://github.com/RetroPie/RetroPie-Se ... controller so I now, provided the gamepad is on during startup, it will connect. otherwise I have to drop to the command line and use bluetoothctl to get a connection.

Here are the exact instructions I followed:

Step 2.5 - Forcing the Pi to reconnect to the controller

If you find your controller doesn't automatically reconnect when you restart the Pi, this process should force the connection.
Some users have reported it will work without this if you wait for Emulation Station to fully load before turning on your controller - this is possibly model or firmware specific.

sudo nano /bin/connect-bluetooth.sh

In that file add
#!/bin/bash
sudo bluetoothctl << EOF
power on
connect [MAC Address]
exit
EOF

Save that file.
Make it executable

sudo chmod +x /bin/connect-bluetooth.sh

Then create a new file
sudo nano /etc/systemd/system/connect-bluetooth.service

Add this text:
[Unit]
Description=Connect Bluetooth

[Service]
Type=oneshot
ExecStart=/bin/connect-bluetooth.sh

[Install]
WantedBy=multi-user.target
Save that file.

Then run this command to enable that process
sudo systemctl enable /etc/systemd/system/connect-bluetooth.service

Video Guide for this: https://youtu.be/RsybSJEPZJM

Here is what I'm really hoping to figure out: If the gamepad loses connection for any reason (walk out of range, gamepad goes to sleep, etc) when it powers back on, i have to drop to the command line again to re-connect. is there a script i could write to periodically check for the gamepad and re-connect?
(Sorry if i'm a total newb)
Many thanks! It worked to connecter the bluetooth keyboard and touchpad of my nexdock :-)

z33k
Posts: 2
Joined: Fri Nov 18, 2016 5:46 pm

Re: Raspberry Pi 3 Bluetooth Setup

Fri Nov 18, 2016 6:05 pm

Bluetooth works perfectly on Rasberry Pi 3 hardware with a fresh install of Ubuntu MATE 16.04.1 LTS.

Using RASPBIAN JESSIE WITH PIXEL, Version: September 2016 (in Headless Mode) Bluetooth did not work for me.

I jacked around for hours trying several tips that I found in forums. I even compiled 3 different versions from source but I could never get Bluetooth working properly in the Sept 2016 version of Rasbian.

If you just want Bluetooth to work, try Ubuntu MATE 16.04.1 LTS. BT works immediately without any headaches on the Raspberry Pi 3. MATE can be set to run in "headless" mode as well.

MATE is also "pretty" if you care about that. For this project, however, I am only using it in headless mode / command line only. All of the Bluetooth commands work as expected.

User avatar
Douglas6
Posts: 4710
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 3 Bluetooth Setup

Fri Nov 18, 2016 6:17 pm

I'm not aware of any problems with Bluetooth under Raspbian, but if you prefer MATE, I'm glad for your success.

z33k
Posts: 2
Joined: Fri Nov 18, 2016 5:46 pm

Re: Raspberry Pi 3 Bluetooth Setup

Fri Nov 18, 2016 6:52 pm

Actually, I prefer Rasbian.

Bluetooth does not work with a fresh install of Rasbian (Sept, 2016), on my Raspberry Pi 3 (I have 3 different Pi3 units).

The BT hardware MAC address shows up as all As (AA:AA:AA:AA:AA:AA).

All of the BT "status" commands appear to work fine. When I try to scan or make the device discoverable, I get nothing. I can pop in the SD card with MATE and the Bluetooth works perfectly.

From there, I spent may hours trying different versions of bluez, adding/removing drivers, I even "updated" the firmware on one of the boards. Still no luck.

If I could get BT to work in Raspian, that would be awesome.

druck
Posts: 3
Joined: Sun Feb 24, 2013 11:26 pm

Re: Raspberry Pi 3 Bluetooth Setup

Fri Dec 09, 2016 9:17 pm

I've been using my Raspbian Jessie Pi3 to log temperature/humidity/pressure from an Oregon Scientific Weather station via BLE, it was working fine for almost a month until it stopped without warning in the middle of last night. No errors in syslog or dmesg, all services running but hcitool dev reported no devices.

I tried a number of things mentioned here and several reboots, but it was either rpi-update or apt install raspberrypi-sys-mods and another reboot which fixed it.

LeFauve
Posts: 1
Joined: Fri Dec 30, 2016 3:29 am

Re: Raspberry Pi 3 Bluetooth Setup

Fri Dec 30, 2016 3:38 am

I got my keyboard working, and it's well recognized when I switch it off/on (it takes about 30s for the keyboard to start working after I turn it on).

However, that only works after I'm logged in on the first console...
Is there a way to use the BT keyboard to log from the console?

I use the Raspbian Jessie Lite from November 2016.

PS: After I log in with an USB keyboard, I can use ALT+Fx to switch console and log again with the BT keyboard; the problem is just the first login

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 374
Joined: Fri Dec 26, 2014 11:02 am

Re: Raspberry Pi 3 Bluetooth Setup

Fri Dec 30, 2016 1:01 pm

LeFauve wrote:Is there a way to use the BT keyboard to log from the console?
Good question - the answer is "probably not", as the Bluetooth is currently controlled by a plugin that only loads when the GUI is up and running.

I'll have a look into this at some point and see if there is anything we can do to improve matters - it's certainly non-ideal that it doesn't work in the situation you describe.

User avatar
Douglas6
Posts: 4710
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 3 Bluetooth Setup

Fri Dec 30, 2016 1:19 pm

spl23 wrote:Bluetooth is currently controlled by a plugin that only loads when the GUI is up and running.
What does the plugin do at start up? Source code?

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 374
Joined: Fri Dec 26, 2014 11:02 am

Re: Raspberry Pi 3 Bluetooth Setup

Fri Dec 30, 2016 1:39 pm

Douglas6 wrote:
spl23 wrote:Bluetooth is currently controlled by a plugin that only loads when the GUI is up and running.
What does the plugin do at start up? Source code?
It's all D-Bus control of the BlueZ stack. The source is on the raspberrypi GitHub - look in the lxpanel project, under plugins/bluetooth. All the code is in the bluetooth.c file. (It's quite long...)

wasz
Posts: 2
Joined: Sat Jan 07, 2017 8:25 pm

Re: Raspberry Pi 3 Bluetooth Setup

Sat Jan 07, 2017 8:47 pm

I just received my pi3 and checking bluetooth features at the moment. I have working fine with the tzumi BT keyboard. I am now trying to get the ALSA player or some other player to direct mp3 files to an Anker bluetooth speaker. I downloaded the latest noobs and have bluetooth icon on panel. I can connect to BT speaker but no sound. I read a note on the intro pages that I need something in Pulse Audio to connect the mp3 stream to the bluetooth device. The ALSA player and the OMXPLAYER that I have tried go fine to the HDMI screen and the ALSA can go to the headphone analog output. Omxplayer seems to go only to the HDMI on my unit. Can anybody tell me how to use BlueTooth option and Pulse Audio to get the speakers to work?

User avatar
Douglas6
Posts: 4710
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 3 Bluetooth Setup

Sun Jan 08, 2017 3:37 pm

Try installing PulseAudio:

Code: Select all

sudo apt-get install pulseaudio pulseaudio-module-bluetooth 
(I wish people would no longer use this catch-all thread of a hundred different issues. I'm sure no one actually reads through it. It would be preferable to post a new thread with the specific issue.)

wasz
Posts: 2
Joined: Sat Jan 07, 2017 8:25 pm

Re: Raspberry Pi 3 Bluetooth Setup

Sun Jan 08, 2017 11:41 pm

thank you. I found the Magpi article http://www.raspberrypi.org.magpi/blueto ... erry-pi-3/ very helpful and it suggested the same as you. I was surprised at how many updates had to be done as I had just downloaded the installer onto a new ssd and thought I had the latest Jessie system. Anyway, adding pulse audio and the other commands suggested got bluetooth working. I added the audacious mp3 player too. However after several hours of use and some reboots it has flaked out several times for unknown reasons and the devices kept going to sleep on me when idled. I think it doesn't like it much when I push the cpu while trying to play music in the background. Gave up for now as the hdmi sound is nearly as good as my bluetooth system but I know the basic concept works now. Hopefully will get better after a few revisions. I never could get omxplayer to redirect the audio to the bluetooth speaker.

As for posting in the wrong spot.. I am very much a newbie and this question seemed to be what I was interested in. Hopefully others will find the magpi tutorial as helpful. I assume some forum manager can move the comments if appropriate to another place.

User avatar
Douglas6
Posts: 4710
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 3 Bluetooth Setup

Sun Jan 08, 2017 11:49 pm

There are many reports of flakiness with the Pi3's Bluetooth, especially if used in conjunction with WiFi. Omxplayer (at least the version in the repos) will never work with Bluetooth.

User avatar
pauly
Posts: 12
Joined: Sat Mar 09, 2013 7:14 am
Location: Kent
Contact: Website

Re: Raspberry Pi 3 Bluetooth Setup

Mon Jan 16, 2017 10:00 am

just realised I did not reply here after I resolved my issue - I had been swapping sd cards around my raspberry pis (raspberries pi?) and had an sd card with the older image in my raspberry pi 3, so it was running raspbian weezy rather than jessie.

Mustang_Pi
Posts: 1
Joined: Tue Jan 31, 2017 12:42 am

Re: Raspberry Pi 3 Bluetooth Setup

Tue Jan 31, 2017 2:31 am

Hello,

this is my very first post. I tried to learn and find my problem in this thread but nothing really seems to fix it.


I am trying to connect my phone to the raspberry, to play my music from my phone to the amplifier attached to the Hifi DAC.
Phone and Pi are paired but not connected.


bluetooth status shows the following:

Code: Select all

[email protected]:~ $ sudo service bluetooth status
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Mon 2017-01-30 20:35:17 EST; 29min ago
     Docs: man:bluetoothd(8)
 Main PID: 2076 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─2076 /usr/lib/bluetooth/bluetoothd

Jan 30 20:35:17 raspberrypi bluetoothd[2076]: Bluetooth daemon 5.23
Jan 30 20:35:17 raspberrypi bluetoothd[2076]: Starting SDP server
Jan 30 20:35:17 raspberrypi systemd[1]: Started Bluetooth service.
Jan 30 20:35:17 raspberrypi bluetoothd[2076]: Bluetooth management interface...d
Jan 30 20:35:17 raspberrypi bluetoothd[2076]: [b]Sap driver initialization failed.[/b]
Jan 30 20:35:17 raspberrypi bluetoothd[2076]: sap-server: Operation not perm...)
Jan 30 20:40:25 raspberrypi systemd[1]: Started Bluetooth service.
[b]Jan 30 20:48:42 raspberrypi bluetoothd[2076]: a2dp-source profile connect fa...e
Jan 30 21:00:32 raspberrypi bluetoothd[2076]: a2dp-source profile connect fa...e[/b]
Hint: Some lines were ellipsized, use -l to show in full.
I am running bluez blueman as a GUI to connect, but it wont connect either.
Something in the A2DP is missing.
Anyone any idea ?

I read a lot to get pulseaudio , which I did, but it wont start

Code: Select all

[email protected]:~ $ sudo apt-get install pulseaudio-module-bluetooth
Reading package lists... Done
Building dependency tree       
Reading state information... Done
pulseaudio-module-bluetooth is already the newest version.
The following packages were automatically installed and are no longer required:
  libboost-filesystem1.55.0 libboost-program-options1.55.0
  libboost-regex1.55.0 libcwiid1 libjs-prettify libllvm3.7 libqscintilla2-11
  libqscintilla2-l10n libqt4-network libqt4-xmlpatterns libqtwebkit4
  libruby1.9.1 libruby1.9.1-dbg libtcl8.5 libtcltk-ruby1.9.1 libtk8.5 ri1.9.1
  ruby1.9.1 ruby1.9.1-dev ruby1.9.1-examples ruby1.9.1-full ruby1.9.3
  supercollider supercollider-common supercollider-ide supercollider-language
  supercollider-supernova tcl8.5 tk8.5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[email protected]:~ $ sudo killall pulseaudio
pulseaudio: no process found
[email protected]:~ $ sudo pulseaudio --start
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
W: [pulseaudio] authkey.c: Failed to open cookie file '/root/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authorization key '/root/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/root/.pulse-cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authorization key '/root/.pulse-cookie': No such file or directory

thanks everyone in advance

User avatar
Douglas6
Posts: 4710
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 3 Bluetooth Setup

Tue Jan 31, 2017 2:44 pm

This program is not intended to be run as root (unless --system is specified).
So, run it with the --system flag, or don't use 'sudo'.

WRustyLane
Posts: 5
Joined: Fri Feb 03, 2017 4:43 am

Re: Raspberry Pi 3 Bluetooth Setup

Fri Feb 03, 2017 6:57 am

Howdy,
I, too, am having difficulty in setting up my bluetooth keyboard. Here's a sample of what I'm getting.
[NEW] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[CHG] Device 0C:FC:83:73:CF:FC Connected: no
[DEL] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[NEW] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[CHG] Device 0C:FC:83:73:CF:FC Connected: yes
[CHG] Device 0C:FC:83:73:CF:FC RSSI: -35
[CHG] Device 0C:FC:83:73:CF:FC Connected: no
[DEL] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[NEW] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[CHG] Device 0C:FC:83:73:CF:FC Connected: yes
[CHG] Device 0C:FC:83:73:CF:FC Connected: no
[DEL] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[NEW] Device 0C:FC:83:73:CF:FC Bluetooth Keyboard
[CHG] Device 0C:FC:83:73:CF:FC RSSI: -48

Any help would be appreciated. Thank you.

Rusty

Return to “Troubleshooting”