Chattonne
Posts: 4
Joined: Thu Jan 08, 2015 2:29 am

Unable to get Bluetooth working

Thu Jan 08, 2015 2:51 am

Hi, I have very little experience with Linux, and am brand new to Raspberry Pi. I apologize in advance for my ignorance.

I'm trying to get a Bluetooth keyboard working in Raspbian. I've got an Ultra u12-41310 mini keyboard.

I installed bluez-utils, and I now see Bluetooth Manager under Preferences. If I do lsusb, I see Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode), so it's detecting the dongle.

However, hcitool isn't working. hcitool dev returns "Devices:" and nothing else. It doesn't show my dongle info. hcitool scan returns "Device is not available: No such device".

I can launch Bluetooth Manger in the GUI, but everything is grayed out.

I've tried unplugging / replugging the dongle. I've tried booting with the dongle plugged in, and booting without it plugged in and plugging in after it's booted. I've done all of the above with the keyboard turned off, the keyboard turned on, and the keybaord in pairing mode. I tested the keyboard on my Windows laptop and it works fine, so not a dud keyboard and/or dongle.

I've Googled the issue. One thing I found said to "check the driver" but I have no idea how to do that in Raspbian. I also found a message board where someone said they fixed the issue by downgrading to an older version of the kernel (I think it was 3.6 but I don't recall for sure). I downgraded to the version they suggested, and after that nothing USB would work, even USB keyboard and mouse.

So I reinstalled the version that came on my Noobs SD card (which is 3.12.22), did apt-get update, then apt-get install bluetooth bluez-utils blueman again, and I'm back in the same boat I started in. Help?

fruitoftheloom
Posts: 19355
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Unable to get Bluetooth working

Thu Jan 08, 2015 9:19 am

Code: Select all

sudo apt-get update
sudo apt-get install bluez-toools
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

Chattonne
Posts: 4
Joined: Thu Jan 08, 2015 2:29 am

Re: Unable to get Bluetooth working

Thu Jan 08, 2015 11:23 pm

Thanks, but it didn't help. Bluez-tools installed successfully, but it still doesn't detect the keyboard.

Code: Select all

[email protected]:/home/pi# hcitool dev
Devices:
[email protected]:/home/pi# hcitool scan
Device is not available: No such device
[email protected]:/home/pi# 

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

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 12:41 am

The first thing to check is that BlueZ is recognizing and powering up the dongle (it sounds like that is not the case.)

Code: Select all

hciconfig -a 
should return with the dongle (adapter) information. Try

Code: Select all

sudo hciconfig hci0 up
and let us know the results of both commands.
Last edited by Douglas6 on Fri Jan 09, 2015 12:42 am, edited 1 time in total.

DB3s
Posts: 5
Joined: Thu Dec 11, 2014 7:32 am

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 12:42 am

Hey if you haven't gotten this to work, I've been able to connect my apple keys and Magic Trackpad for GUI as well as cli use.

Chattonne
Posts: 4
Joined: Thu Jan 08, 2015 2:29 am

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 1:57 am

Douglas6 wrote:The first thing to check is that BlueZ is recognizing and powering up the dongle (it sounds like that is not the case.)

Code: Select all

hciconfig -a 
should return with the dongle (adapter) information. Try

Code: Select all

sudo hciconfig hci0 up
and let us know the results of both commands.

Code: Select all

[email protected]:/home/pi# hciconfig -a
hci0:	Type: BR/EDR  Bus: USB
	BD Address: 00:1B:10:00:33:24  ACL MTU: 1017:8  SCO MTU: 64:0
	DOWN 
	RX bytes:914 acl:0 sco:0 events:32 errors:0
	TX bytes:136 acl:0 sco:0 commands:32 errors:0
	Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: 
	Link mode: SLAVE ACCEPT 

[email protected]:/home/pi# sudo hciconfig hci0 up
Can't init device hci0: Operation not supported (95)

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 3:00 am

I just tested out a Broadcom USB BT adapter on my B+.

I don't know if all of this was necessary, but here's what I did...

sudo apt-get update
sudo apt-get install bluez bluez-tools bluez-utils bluez-firmware blueman obex-data-server

Then I fixed a bug in /usr/lib/python2.7/dist-packages/blueman/Functions.py which seems to have been present for a long time:

Code: Select all

def get_icon(name, size=24, fallback="gtk-missing-image"):
	ic = gtk.icon_theme_get_default()

	try:
		icon = ic.load_icon(name, size, 0) 
	except:
		if not fallback:
			raise
		try:
			icon = ic.load_icon(fallback, size, 0) 
		except:
			icon = ic.load_icon("gtk-missing-image", size, 0) 
	
	if icon.props.width > size:	
		new_w = size
		new_h = int(size * ( float(icon.props.width) / icon.props.height ))
		icon = icon.scale_simple(new_w, new_h, gtk.gdk.INTERP_BILINEAR)
	
	if icon.props.height > size:
		new_w = int(size * ( float(icon.props.height) / icon.props.width ))
		new_h = size
		icon = icon.scale_simple(new_w, new_h, gtk.gdk.INTERP_BILINEAR)
	
	return icon
	
Then I enabled the bluetooth.service like this:
sudo systemctl enable bluetooth

Then I rebooted. I had to launch blueman-manager using sudo:
sudo blueman-manager

I paired my phone and transferred a /boot/config.txt file to my phone. Seems to work OK. Hopefully this helps.

Code: Select all

~ $ hciconfig -a
hci0:	Type: BR/EDR  Bus: USB
	BD Address: 00:02:76:24:AD:45  ACL MTU: 1021:7  SCO MTU: 64:1
	UP RUNNING PSCAN 
	RX bytes:36019 acl:141 sco:0 events:510 errors:0
	TX bytes:69441 acl:192 sco:0 commands:253 errors:0
	Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH HOLD SNIFF PARK 
	Link mode: SLAVE ACCEPT 
	Name: 'RaspbianPiWall'
	Class: 0x520100
	Service Classes: Networking, Object Transfer, Telephony
	Device Class: Computer, Uncategorized
	HCI Version: 2.1 (0x4)  Revision: 0x529b
	LMP Version: 2.1 (0x4)  Subversion: 0x420e
	Manufacturer: Broadcom Corporation (15)

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

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 4:30 am

Yeah, that looks like the result of a knock-off CSR dongle that is known not to work with current kernels, after 3.10 and up to (maybe) 3.14. More details at https://bugzilla.kernel.org/show_bug.cgi?id=60847. You could try downgrading to a 3.10 kernel, or return the dongle for a true CSR product.

Chattonne
Posts: 4
Joined: Thu Jan 08, 2015 2:29 am

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 4:55 pm

Aw poop. I specifically bought that keyboard (the dongle came with the keyboard) because it was on the list of verified peripherals at http://elinux.org/RPi_VerifiedPeripherals. Maybe that list is old though (from 3.10 or older).

I'll try the stuff ktb did to get his adapter working when I get home. If that doesn't work, I'll look at getting a proper dongle.

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

Re: Unable to get Bluetooth working

Fri Jan 09, 2015 5:18 pm

I'd be interested in seeing the results of these two commands

Code: Select all

lsusb | grep -i bluetooth
and

Code: Select all

hciconfig hci0 version
if you get the chance.

Return to “Raspbian”