3

I am having trouble connecting to my mobile phone using the cirago bluetooth adapter with my raspberry pi running adafruit's occidentalis v2. Show me teh codez.

But in all seriousness, here are some commands showing what I have tried for configuring rpi + bluetooth adapter.

pi@raspberrypi /etc/X11 $ lsusb
Bus 001 Device 002: ID 0424:9512 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 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 0bda:817b Realtek Semiconductor Corp. 
Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

As you can see, my device appears to be installed correctly. Next,

hci0:   Type: BR/EDR  Bus: USB
    BD Address: E0:91:53:61:07:55  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING PSCAN ISCAN 
    RX bytes:20113 acl:93 sco:0 events:499 errors:0
    TX bytes:6799 acl:97 sco:0 commands:181 errors:0
    Features: 0xff 0xff 0x8f 0xfe 0x9b 0xbf 0x59 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH HOLD SNIFF PARK 
    Link mode: SLAVE ACCEPT 
    Name: 'raspberrypi-0'
    Class: 0x520100
    Service Classes: Networking, Object Transfer, Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 3.0 (0x5)  Revision: 0x1aa1
    LMP Version: 3.0 (0x5)  Subversion: 0x1aa1
    Manufacturer: Cambridge Silicon Radio (10)

So it seems to have a reasonable configuration going on, but to be honest I'm not entirely clear what several of those mean and the hciconfig man page is fairly cryptic for someone who is kind of new to bluetooth.

Continuing on, when I make my phone visisble to all devices I can then run

pi@raspberrypi /etc/X11 $ sudo hcitool scan
Scanning ...
    D4:87:D8:F7:43:48   SGH-I777

However, this is where things start to breakdown, I then attempt to connect

pi@raspberrypi /etc/X11 $ sudo hcitool cc --role=s d4:87:d8:f7:43:48
pi@raspberrypi /etc/X11 $ sudo hcitool con
Connections:

I also read in a few places that the use of bluetooth-agent and a pin might help so I tried that, but it didn't seem to help. Also interesting is that my phone kind of believes it is paired, it shows in the paired devices list... but the bluetooth icon on my phone never turns blue indicating a connection.

At one point I did get to here which I thought was promising

pi@raspberrypi /etc/X11 $ sudo bluetooth-agent 4790
Confirmation request of 207543 for device /org/bluez/2299/hci0/dev_D4_87_D8_F7_43_48

but it still did not turn my bluetooth icon blue on my phone nor show up as a connection when I checked hcitool for connections.

Finally, it might be useful information to mention that when I right click on bluetooth manager and click adapters, there is nothing listed. However, do not focus on this please because I want to learn how to do this using all the command line tools so I understand everything. I only included the information about the gui tool in case it helps anybody figure out what is wrong.

Obviously, any help is greatly appreciated. Even if you cannot solve my problem, please provide any further explanation or information you have about the above commands and functionality as I am pretty new to bluetooth. Perhaps if you can provide a better understanding of what these tutorials having been making me try, I will be able to figure it out.

Thanks again.

2
  • What are you trying to do with the bluetooth connection between the phone and the Pi ?
    – Lawrence
    Aug 13, 2013 at 6:06
  • 2
    @Lawrence Don't know yet, perhaps stream audio. Really I just want to learn about bluetooth.
    – NickHalden
    Aug 13, 2013 at 15:15

1 Answer 1

1

I think that you may already have "connected" but do not know it. If you are connecting from the Pi to the phone, you are probably connecting to the phone as a dial-up device - which wont do anything until you actually "dial up".

Realize that there are basically two parts to using bluetooth - pairing and connecting. After you have paired, then you connect to a service on the device.

Depending on which way you are trying to create the connection and what services you are wanting to establish, different things will need to happen after you have paired the devices. Here is a very good article on the general information that I think you are seeking: Linux Bluetooth. Also, for me this was most useful of all for actually connecting to a remote arduino from the Pi with SPP: Pair with SPP in Linuc command line

1
  • Side note - my answer assumes standard pre-"4.0 BLE" protocol connections.. for that other stuff, it is a bit different. May 2, 2014 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.