rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

bluetooth dongle (again)

Tue Feb 12, 2013 3:33 pm

Sometimes after boot my iusb dongle is recgnised and hcitool dev finds the device. Sometimes not.

What command could I use to reprompt the Pi to look for the usb connections? What part of the boot sequence does this happen?

Thanks

PS1981
Posts: 445
Joined: Wed Dec 12, 2012 4:11 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 3:43 pm

lsusb

rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 3:49 pm

PS1981 wrote:lsusb
quick reply, thanks!

so if my hcitool dev shows up nothing, running lsusb may get hcitool dev to find it?

I thought lsusb was just showing me what devices are connected?

I better check whether when my hcitool dev fails to find a device this is because lsusb shows a bluetooth device or not

R

PS1981
Posts: 445
Joined: Wed Dec 12, 2012 4:11 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 3:59 pm

rooster wrote:
PS1981 wrote:lsusb
I thought lsusb was just showing me what devices are connected?
R
Yes I believe so. Sorry I thought that was what you meant.

PS1981
Posts: 445
Joined: Wed Dec 12, 2012 4:11 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 6:00 pm

I know it sounds like a very simple answer, which anyone could give, but if you see it using lsusb, and yet it still does not work, could it be that you're just not getting enough power to it? I have similar problems with a wifi dongel which always shows p in lsusb, but doesn't always light up and work. I'm not using a powered hub in this case, so for me I'd say the cause is obvous.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: bluetooth dongle (again)

Tue Feb 12, 2013 6:19 pm

There is a serious bug with the current version of Raspbian and Bluetooth.
If you boot the Pi from cold with the dongle attached it doesn't get initialised, however it does when you insert it into the USB ports after boot up.
There is obviously a script missing some calling, I don’t know where but in the meantime I’ve written a script myself to inialise the dongle (called from /etc/rc.local).

#!/bin/bash
hciconfig device up
hciconfig set name raspberrypi-0
hciconfig set class 0x4e2100
hciconfig enable iscan
hciconfig enable pscan

If your device name is different then feel free to edit "hciconfig set name". :)

Richard S.
Last edited by redhawk on Tue Feb 12, 2013 6:40 pm, edited 1 time in total.

PS1981
Posts: 445
Joined: Wed Dec 12, 2012 4:11 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 6:22 pm

And just seen in this post:
http://www.raspberrypi.org/phpBB3/viewt ... 66&t=25562
the command

Code: Select all

sudo service bluetooth restart
which according to the above mentioned post did not help. Maybe try at your own risk anyway?

rooster1
Posts: 17
Joined: Tue Feb 12, 2013 8:55 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 10:53 pm

PS1981 wrote:I know it sounds like a very simple answer, which anyone could give, but if you see it using lsusb, and yet it still does not work, could it be that you're just not getting enough power to it? I have similar problems with a wifi dongel which always shows p in lsusb, but doesn't always light up and work. I'm not using a powered hub in this case, so for me I'd say the cause is obvous.
The power is a good suggestion, but I have been there :) Powered from Pi - intermittent (badly) powered from data cable from hub - intermittent (badly and Pi voltage tests too low). This is powered from a usb hub which has worked fine with different combinations of dongle and power source and all other peripherals work flawlessley.

R

rooster1
Posts: 17
Joined: Tue Feb 12, 2013 8:55 pm

Re: bluetooth dongle (again)

Tue Feb 12, 2013 11:12 pm

redhawk wrote:There is a serious bug with the current version of Raspbian and Bluetooth.
If you boot the Pi from cold with the dongle attached it doesn't get initialised, however it does when you insert it into the USB ports after boot up.
There is obviously a script missing some calling, I don’t know where but in the meantime I’ve written a script myself to inialise the dongle (called from /etc/rc.local).

#!/bin/bash
hciconfig device up
hciconfig set name raspberrypi-0
hciconfig set class 0x4e2100
hciconfig enable iscan
hciconfig enable pscan

If your device name is different then feel free to edit "hciconfig set name". :)

Richard S.
Hi Richard

Unfortunately I have the issue that it is intermittent :(

3 times out of 4 it works, but 1 time it fails - nothing changed with hardware, just rebooting and repeating

lsusb finds the bluetooth everytime

hciconfig -a shows
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:DE:FC:00 ACL MTU: 1022:8 SCO MTU: 121:3
DOWN INIT RUNNING
RX bytes:781 acl:0 sco:0 events:24 errors:0
TX bytes:341 acl:0 sco:0 commands:26 errors:0
Features: 0xff 0xfe 0x0d 0xfe 0x98 0x7f 0x79 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF
Link mode: SLAVE ACCEPT
when the hcitool dev fails
and
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:DE:FC:00 ACL MTU: 1022:8 SCO MTU: 121:3
UP RUNNING PSCAN
RX bytes:1001 acl:0 sco:0 events:47 errors:0
TX bytes:1191 acl:0 sco:0 commands:50 errors:0
Features: 0xff 0xfe 0x0d 0xfe 0x98 0x7f 0x79 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF
Link mode: SLAVE ACCEPT
Name: 'raspberrypi-0'
Class: 0x420100
Service Classes: Networking, Telephony
Device Class: Computer, Uncategorized
HCI Version: 3.0 (0x5) Revision: 0x9999
LMP Version: 3.0 (0x5) Subversion: 0x9999
Manufacturer: Atheros Communications, Inc. (69)

when it works

if I try
hciconfig hci0 down
and
hciconfig hci0 up
I get the error
Can't init device hci0: Connection timed out (110)

:(

R

rooster
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm

Re: bluetooth dongle (again)

Wed Feb 13, 2013 9:17 pm

rooster1 wrote:
redhawk wrote:There is a serious bug with the current version of Raspbian and Bluetooth.
If you boot the Pi from cold with the dongle attached it doesn't get initialised, however it does when you insert it into the USB ports after boot up.
There is obviously a script missing some calling, I don’t know where but in the meantime I’ve written a script myself to inialise the dongle (called from /etc/rc.local).

#!/bin/bash
hciconfig device up
hciconfig set name raspberrypi-0
hciconfig set class 0x4e2100
hciconfig enable iscan
hciconfig enable pscan

If your device name is different then feel free to edit "hciconfig set name". :)

Richard S.
Hi Richard

Unfortunately I have the issue that it is intermittent :(

3 times out of 4 it works, but 1 time it fails - nothing changed with hardware, just rebooting and repeating

lsusb finds the bluetooth everytime

R
just an update on this but farm from solving...

I have my pi booting up, checking...
lsusb
hciconfig -a
hcitool dev
hcitool scan
writing to a log file...and repeat

I leave for a couple of hours and check the results.

My 7 port belkin usb hub works about 1/2 of the time, no pattern, sometimes works 10 times on the trot then fails the same, sometimes works every other time. This has caused me problems because I might check a hardware combination 3 times and if its ok then I assume it stays that way.

A different hub (4 port) worked 21 out of 26 times and another worked all 26 times.

voltage at pi looks fine in all circumstances.

I'll check a couple more of each variety and see what happens

R

no0dl3
Posts: 1
Joined: Mon Jul 21, 2014 3:26 pm

Re: bluetooth dongle (again)

Mon Jul 21, 2014 3:30 pm

Hi there, I'm very very new to programming, linux and Raspberry Pi.

I bought a Raspberry Pi Model B+, received it today and I'm having trouble with bluetooth.

I've followed the instructions on here http://elinux.org/RPi_Bluetooth_keyboard_setup

When I get to the "Check Hadrware" section, I type in hcitool dev, and every time I get bash: hcitool: command not found

I'm using a bluetooth usb dongle from ebay. blueooth 4.0 CSR 4.0

Help!

Thanks in advance.

wrobell
Posts: 15
Joined: Fri Sep 06, 2013 9:47 am

Re: bluetooth dongle (again)

Tue Jul 22, 2014 4:04 pm

no0dl3 wrote: When I get to the "Check Hadrware" section, I type in hcitool dev, and every time I get bash: hcitool: command not found
You need to install bluez package.

akshat.joshi
Posts: 1
Joined: Sat Sep 20, 2014 8:58 pm

Re: bluetooth dongle (again)

Sat Sep 20, 2014 9:50 pm

Hello,
I am using Emotiv EPOC 4.0le bluetooth device to recieve data on RPi.
when i use the command
```
lsusb
```
I can following output:
```
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 010: ID 1241:1203 Belkin
Bus 001 Device 005: ID 21a1:0001 Emotiv Systems Pty. Ltd. EPOC Consumer Headset Wireless Dongle
```
But when i use
```
hciconfig
```
I dont get any output or error message. The pointer goes to next step.

my dongle details are as follows:
```
Bus 001 Device 015: ID 21a1:0001 Emotiv Systems Pty. Ltd. EPOC Consumer Headset Wireless Dongle
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x21a1 Emotiv Systems Pty. Ltd.
idProduct 0x0001 EPOC Consumer Headset Wireless Dongle
bcdDevice 0.03
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 59
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 33 US
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 20
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 4
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 28
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 1

```
Any help is appreciated.
Thanks a lot !!

Return to “Automation, sensing and robotics”