[Ilugc] bluetooth Ubuntu - Moto L6

  • From: mohan.tux@xxxxxxxxx (Mohan Sundaram)
  • Date: Mon Oct 22 19:00:06 2007

Mohan Sundaram wrote:

I'm getting stuck on the PIN exchange.

<quote>
When connecting the two devices for the first time you might be asked to 
enter a PIN-Code on the phone. Enter some numbers and press 'Okay' 
rfcomm will ask you to enter the PIN-Code for the mobile phone. Enter 
the same numbers and press <Enter>/Click Okay. Both devices will now 
connect to each other.
</quote>

Does not happen for me. Pin_helpers are supposed to provide the pins. In 
feisty, passkey agents had to be manually invoked prior to connection in 
an open shell. Then the dialog stated above happens. pin_helpers 
declared in hcid.conf did not work. In Gutsy (BlueZ 3.0 upwards), all 
pin_helpers are deprecated. Positively frustrating.

Mohan

Replying to my own post as I finally got my stuff to work. Not very 
scientific as it was a trial and error method. Will try to give a 
sequence which I think works. If someone else can check it out, it would 
be great.  *Warning: Long post*

Preamble:
A lot of changes have happened in the BlueZ utils recently. Bluetooth 
was broken in Feisty and Edgy as per ML. Feisty has btsco user space s/w 
for headsets but no kernel module btsco.

My experience:
*Headset HS805:*
1. When I shifted to Gutsy, the first thing I noticed was direct headset 
support. System >> Preferences >> Bluetooth headset.
2. My Moto HS805 worked first shot in pairing. Subsequent connections 
took some learning.  Invoking the BT headset and check for new devices 
shows the headset when headset is in pairing mode and the HS button was 
clicked a couple of times. No pairing beeps as I would hear if it paired 
with my Moto L6.
3. Once it appeared on the list, choosing it as the active headset made 
it the second ALSA and OSS device.
4. Once done, I was able to pick the BT headset in Skype sound devices.

       Happy, thrilled and felt something was accomplished fairly fast.

*Moto L6:* Wanted to use Wammu/Kmobiletools for phonebook/ SMS etc.
1. When I installed Gutsy, I also installed the kobexclient. 
Gnome-obex-server came in the gnome-bluez utils pack and got installed.
2. I set the laptop to automatic connect on my MotoL6. Obex push from PC 
  worked well. Invoked gnome-obex-server on PC and obex push from phone 
worked well.
3. I setup rfcomm to bind to the address and l2ping worked well. "rfcomm 
connect 0" refused to connect. /dev/rfcomm0 had 600 as rights and I was 
root. As I'd read someplace, I set the permissions to 666. Still pairing 
did not happen.
4. /var/log/syslog showed passkey-agent registered. I set default to 
0000 and still no avail. I wrote a pin_helper script that  echoed 
"PIN:0000" and called it from /etc/bluetooth/hcid.conf. Still no avail.
5. Did some more RTFM and read in blueZ architecture that auth uses the 
dbus architecture and a interactive dbus-send command was listed. I used 
that to send a PIN to the device and it paired.
6. Went to the bluetooth paired devices config and set both the headset 
and phone as trusted devices.
7. Tried rfcomm connect 0 and it worked. Fired up cutecom and tried AT+C 
commands. Disconnected. Moved down from 115200 to 19200 bauds and they 
worked.
8. Wammu and Kmobiletools were a breeze after this.

Hope this is useful to others. Most documents I read did not deal with 
the PIN auth problem solution that I tried. Most list pin_helpers which 
were deprecated in blueZ 3.0.

Mohan Sundaram

Other related posts: