public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] How is pairing completed in rfcomm?
@ 2004-06-21 19:51 David Feldman
  2004-06-21 21:08 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: David Feldman @ 2004-06-21 19:51 UTC (permalink / raw)
  To: bluez-users; +Cc: wb0gaz

I'm working on getting my RH9 laptop to communicate with T68 (not i), 
and I made
another step forward, but I can't complete the "pairing" process (
which is where the
phone picks up the identity of a PC and makes that PC "OK" for future 
data operation.)

My steps:

insert card, do cardctl insert.
hciconfig hci0 up
rfcomm /dev/rfcomm0 MAC-ADDRESS 1    (1 is for DUN on this phone)

Now at this step I gave the phone the instruction to add to paired 
devices, with
the option "phone accepts".

Then, I did this:

cat </dev/rfcomm0

at which point the phone displays the PC's name, then asks for a PIN.

I entered the PIN (a 4-digit code) that I had previously configured

Now the phone says "pairing..." and waits forever.

If I interrupt the cat </dev/rfcomm0 with Control-C,

then the following is seen:

1. Any output (echo, cat, etc.) to /dev/rfcomm0 produces the error 
message:
"bash: /dev/rfcomm0: Operation already in progress"

2. The rfcomm command produces the message:
rfcomm0: MAC-ADDRESS channel 1 disconnecting

Marcel had advised me to update to the latest kernel - I am not in a 
position to
do this immediately, and it I hope the pairing process would be able 
to proceed
in any event, if I am using the correct procedure. I am using Kernel 2.
4.20-31.9,
which was current as of 04/2004; as the phone is nearly 2 years old, 
I'm hoping
I can validate it's operation at least through the pairing process.

So my core question - how do I complete the pairing process, when 
initiated
by the PC and accepted by the phone?

Dave
wb0gaz@hotmail.com



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] How is pairing completed in rfcomm?
  2004-06-21 19:51 [Bluez-users] How is pairing completed in rfcomm? David Feldman
@ 2004-06-21 21:08 ` Marcel Holtmann
  2004-06-22 15:20   ` David Feldman
  2004-06-22 15:30   ` Solved pairing problem - big success! David Feldman
  0 siblings, 2 replies; 4+ messages in thread
From: Marcel Holtmann @ 2004-06-21 21:08 UTC (permalink / raw)
  To: David Feldman; +Cc: BlueZ Mailing List

Hi David,

> I'm working on getting my RH9 laptop to communicate with T68 (not i), 
> and I made
> another step forward, but I can't complete the "pairing" process (
> which is where the
> phone picks up the identity of a PC and makes that PC "OK" for future 
> data operation.)
> 
> My steps:
> 
> insert card, do cardctl insert.
> hciconfig hci0 up
> rfcomm /dev/rfcomm0 MAC-ADDRESS 1    (1 is for DUN on this phone)

it is "rfcomm bind 0 <bdaddr> [channel]".

> Now at this step I gave the phone the instruction to add to paired 
> devices, with
> the option "phone accepts".
> 
> Then, I did this:
> 
> cat </dev/rfcomm0
> 
> at which point the phone displays the PC's name, then asks for a PIN.
> 
> I entered the PIN (a 4-digit code) that I had previously configured
> 
> Now the phone says "pairing..." and waits forever.
> 
> If I interrupt the cat </dev/rfcomm0 with Control-C,
> 
> then the following is seen:
> 
> 1. Any output (echo, cat, etc.) to /dev/rfcomm0 produces the error 
> message:
> "bash: /dev/rfcomm0: Operation already in progress"
> 
> 2. The rfcomm command produces the message:
> rfcomm0: MAC-ADDRESS channel 1 disconnecting

Until you upgraded to a newer kernel I can't guarantee that this will
work. Your RFCOMM code seems to be buggy for Bluetooth 1.0b phones.

> Marcel had advised me to update to the latest kernel - I am not in a 
> position to
> do this immediately, and it I hope the pairing process would be able 
> to proceed
> in any event, if I am using the correct procedure. I am using Kernel 2.
> 4.20-31.9,
> which was current as of 04/2004; as the phone is nearly 2 years old, 
> I'm hoping
> I can validate it's operation at least through the pairing process.

The phone will work. I don't see any problem here because the Bluetooth
stack of the T68 and the T39m are identical and the T39m is working for
me.

> So my core question - how do I complete the pairing process, when 
> initiated
> by the PC and accepted by the phone?

The phone uses security level 2 and this means the security routines
kick in when you request access to the RFCOMM channel. If you want them
earlier then the use of security mode 3 is needed. Use "hciconfig hci0
auth" to activate it on your device.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bluez-users] How is pairing completed in rfcomm?
  2004-06-21 21:08 ` Marcel Holtmann
@ 2004-06-22 15:20   ` David Feldman
  2004-06-22 15:30   ` Solved pairing problem - big success! David Feldman
  1 sibling, 0 replies; 4+ messages in thread
From: David Feldman @ 2004-06-22 15:20 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List, wb0gaz

Hello Marcel/List:

I have made more progress!

It is not working, but I think I am now close. I still cannot 
complete pairing.

I did not realize that it was necessary to run "hcid" daemon... I 
could not
find a man page... Then when I was beginning to use hcid it gave error
that it could not execute pin helper, so I fixed the path to 
executable file
that generates my selected PIN code. When I manually execute the pin_
helper
file, it outputs 4 digits to the console, which is my test PIN. It is 
executable.

Anyway, now I run hcid before my testing procedure.

At this point, here is my situation:

1. Prepare phone: Set bluetooth ON (not discoverable, by now I know 
the
MAC address!), then choose Linked Devices->Add Device->Phone Accepts.
Phone says "Ready to Pair"

2. Prepare PC: bluetooth card inserted, then do "cardctl insert", and 
verify
messages on /var/log/messages (hcid reports HCI dev 0 registered, hci
dev 0 up, then Starting security manager 0.)

3. Execute script:

    hciconfig hci0 up
    hciconfig hci0 auth 3 (per Marcel suggestion)
    rfcomm bind 0 MAC-ADDRESS 1 (note I changed parameter #2 to 0, 
not /dev/rfcomm0)
    ---> reports "rfcomm0: MAC-ADDRESS channel 1 clean"
    cat </dev/rfcomm0

4. At this point the computer device name (from hcid.conf) appears on 
the phone,
and the phone says "Add to paired devices?" I select Yes. I enter my 
PIN digits
(as configured in pin helper script file) and phone says "Pairing 
failed, Retry?"

5. The cat command reports:  "Warning: null TTY for (d8:00) in tty_
fasync" and
"-bash: /dev/rfcomm0: Permission denied"

6. At this point I went back to /var/log/messages and I see these 
messages in
the file:

kernel: application bug: hcid(PID) has SIGCHLD set to SIG_IGN but 
calls wait()
kernel: (see the NOTES section of 'man 2 wait'). Workaround activated.
kernel: Warning: null TTY for (d8:00) in tty_fasync.

As an alternative, I tried using l2ping instead of cat </dev/rfcomm0 
to get the
security routine to start. l2ping reported the error message "Can't 
connect: Permission denied"
and /var/log/messages included two of the same kernel messages (
application bug
about wait) but not the message about null TTY.

My question: What should I do to start the security sequence?

Should I update hcid (I am now using version 2.2 as reported by hcid -?)

I hope I can make more progress without installing a new kernel, 
because I searched
for RPM for later kernel in 2.4 series (I am now using 2.4.20-31.9) 
but there is no
later version RPM, and my machine does not set up with compiler, so I 
cannot try
to compile new kernel.

Dave
wb0gaz@hotmail.com


###


>> So my core question - how do I complete the pairing process, when 
>> initiated
>> by the PC and accepted by the phone?
>
>The phone uses security level 2 and this means the security routines
>kick in when you request access to the RFCOMM channel. If you want them
>earlier then the use of security mode 3 is needed. Use "hciconfig hci0
>auth" to activate it on your device.
>
>Regards
>
>Marcel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Solved pairing problem - big success!
  2004-06-21 21:08 ` Marcel Holtmann
  2004-06-22 15:20   ` David Feldman
@ 2004-06-22 15:30   ` David Feldman
  1 sibling, 0 replies; 4+ messages in thread
From: David Feldman @ 2004-06-22 15:30 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List, wb0gaz

Hello Marcel/List:

I sent my last message too soon - sorry for the noise on the list.

I did more reading, and discovered there was an error in my pin 
helper file.

It appears the message generated must be PIN:xxxx, not just xxxx, so I
changed that. 

This made pairing successful!

Then, I configured minicom to communicate with /dev/rfcomm0 at 19200
bps, and the phone bluetooth went on-line. I was able to manually 
dial to
my home linux server phone number, and log in!

It is a very big success!!!

Thank you VERY MUCH for all of your fine help and advice, I now have
beginning bluetooth connection on my old Omnibook 800.

Soon, I will get ppp running, then I can access internet directly...

Dave
wb0gaz@hotmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-22 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-21 19:51 [Bluez-users] How is pairing completed in rfcomm? David Feldman
2004-06-21 21:08 ` Marcel Holtmann
2004-06-22 15:20   ` David Feldman
2004-06-22 15:30   ` Solved pairing problem - big success! David Feldman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox