2005-08-25 18:16:25

by Johannes Bauer

[permalink] [raw]
Subject: [Bluez-users] rfcomm: Connection Refused

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,

I'm having trouble with Bluez. I think I'm almost there, however. Here's
the description:

I have successfully set up the hci0 device:

# hciconfig -a hci0
hci0: Type: USB
BD Address: 00:11:F6:03:E7:9A ACL MTU: 120:20 SCO MTU: 64:0
UP RUNNING PSCAN ISCAN
RX bytes:35535 acl:527 sco:0 events:1263 errors:0
TX bytes:20799 acl:524 sco:0 commands:442 errors:0
Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'Joeserver'
Class: 0x3e0100
Service Classes: Networking, Rendering, Capturing
Device Class: Computer, Uncategorized
HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x757
Manufacturer: Silicon Wave (11)
#

And I have paired my PC with my Sony Ericsson K700i Cellular Phone:

# hcitool scan
Scanning ...
00:0E:07:A7:7E:D2 K700i
# hcitool cc 00:0E:07:A7:7E:D2
# hcitool auth 00:0E:07:A7:7E:D2
# hcitool dc 00:0E:07:A7:7E:D2

The cell phone asks upon the "auth" command if it shall connect to
"Joeserver" and asks for the PIN. When I enter the correct pin (stored
in /etc/bluetooth/pin) the devices are paired.

Everything looks fine so far. Then comes the rfcomm:

# rfcomm bind 0 00:0E:07:A7:7E:D2 1

Now when I try, for example:

# cat > /dev/bluetooth/rfcomm/0
- -bash: /dev/bluetooth/rfcomm/0: Connection refused
#

I also tried changing channels from 1 to 12. On 6 it just blocked, but
the cellphone didn't display anything. All other channels said
"connection refused".

Then I read the mailing list and some message there said to use sdptool:

# sdptool browse 00:0E:07:A7:7E:D2
Browsing 00:0E:07:A7:7E:D2 ...
Service Name: Dial-up Networking
Service RecHandle: 0x10000
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Service Name: HS Voice Gateway
Service RecHandle: 0x10002
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100

Service Name: Serial Port
Service RecHandle: 0x10003
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2

Service Name: Serial Port 2
Service RecHandle: 0x10004
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3

Service Name: OBEX Object Push
Service RecHandle: 0x10005
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 6
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100

Service Name: OBEX IrMC Sync Server
Service RecHandle: 0x10006
Service Class ID List:
"IrMC Sync" (0x1104)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 8
"OBEX" (0x0008)
Profile Descriptor List:
"IrMC Sync" (0x1104)
Version: 0x0100

Service Name: OBEX Basic Imaging
Service RecHandle: 0x1000a
Service Class ID List:
"Imaging Responder" (0x111b)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 9
"OBEX" (0x0008)
Profile Descriptor List:
"Imaging" (0x111a)
Version: 0x0100

Service Name: OBEX File Transfer
Service RecHandle: 0x1000d
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100

Service Name: HF Voice Gateway
Service RecHandle: 0x1000e
Service Class ID List:
"Handfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 5
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0101

Service Name: OBEX SyncML Client
Service RecHandle: 0x10018
Service Class ID List:
"Error: This is UUID-128" (0x00000002-0000-1000-8000-0002ee000002)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 15
"OBEX" (0x0008)

Service Description: K700 series
Service RecHandle: 0x1001b
Service Class ID List:
"PnP Information" (0x1200)

Service Name: Mouse & Keyboard
Service Description: K700
Service Provider: Sony Ericsson
Service RecHandle: 0x1001c
Service Class ID List:
"Human Interface Device" (0x1124)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 17
"HIDP" (0x0011)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Human Interface Device" (0x1124)
Version: 0x0100

#

Channels appear to be 1, 2 and 3 (which I tried, as mentioned above).

Here's my /etc/bluetooth/hcid.conf (all comments removed)
options {
autoinit yes;
security user;
pairing multi;
pin_helper /etc/bluetooth/pin-helper;
}

device {
name "Joeserver";
class 0x3e0100;
iscan enable;
pscan enable;
lm accept;
lp rswitch,hold,sniff,park;
}

And this is my /etc/bluetooth/rfcomm.conf:
rfcomm0 {
bind yes;
device 00:0E:07:A7:7E:D2;
channel 1;
comment "Handy";
}

(it only gets read on startup, I have set up the bindings to channel
1-12 manually).

Would a dump of hcidump be helpful? What exactly should I dump?

I would really appreciate if somebody could help, Bluez is already a
really impressive piece of work. It worked (until now) so smoothly, I
was really impressed :-)

Greetings,
Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDDgr5CseFG8xyfi4RAquTAJ9y+DeGvnzoMNtW0lCogjzr2i8aYwCeKM8R
AoHvp/5dCpt9xtlGP7sTCqI=
=cbBD
-----END PGP SIGNATURE-----


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2005-08-25 22:30:12

by Johannes Bauer

[permalink] [raw]
Subject: Re: [Bluez-users] rfcomm: Connection Refused

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marcel Holtmann wrote:
> Hi Johannes,
>
>>I'm having trouble with Bluez. I think I'm almost there, however. Here's
>>the description:
>
> run "hcidump -X -V" of your connection attempt.

Yes, sir :-)

# hcidump -X -V
HCI sniffer - Bluetooth packet analyzer ver 1.21
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
bdaddr 00:0E:07:A7:7E:D2 ptype 0xcc18 rswitch 0x01 clkoffset 0x4295
(valid)
Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
status 0x00 handle 7 bdaddr 00:0E:07:A7:7E:D2 type ACL encrypt 0x00
< ACL data: handle 7 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 3 scid 0x0040
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
handle 7 policy 0x0f
Link policy: RSWITCH HOLD SNIFF PARK
> HCI Event: Command Complete (0x0e) plen 6
Write Link Policy Settings (0x02|0x000d) ncmd 1
status 0x00 handle 7
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> HCI Event: Max Slots Change (0x1b) plen 3
handle 7 slots 5
> ACL data: handle 7 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x007d scid 0x0040 result 0 status 0
Connection successful
< ACL data: handle 7 flags 0x02 dlen 16
L2CAP(s): Config req: dcid 0x007d flags 0x00 clen 4
MTU 1024
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> ACL data: handle 7 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
Success
MTU 674
> ACL data: handle 7 flags 0x02 dlen 16
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
MTU 674
< ACL data: handle 7 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x007d flags 0x00 result 0 clen 0
Success
< ACL data: handle 7 flags 0x02 dlen 8
L2CAP(d): cid 0x007d len 4 [psm 3]
RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> ACL data: handle 7 flags 0x02 dlen 8
L2CAP(d): cid 0x0040 len 4 [psm 3]
RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
< ACL data: handle 7 flags 0x02 dlen 18
L2CAP(d): cid 0x007d len 14 [psm 3]
RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
dlci 2 frame_type 0 credit_flow 15 pri 7 ack_timer 0
frame_size 669 max_retrans 0 credits 7
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> ACL data: handle 7 flags 0x02 dlen 19
L2CAP(d): cid 0x0040 len 15 [psm 3]
RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8
dlci 2 frame_type 0 credit_flow 14 pri 7 ack_timer 0
frame_size 330 max_retrans 0 credits 7
< ACL data: handle 7 flags 0x02 dlen 8
L2CAP(d): cid 0x007d len 4 [psm 3]
RFCOMM(s): SABM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x59
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> ACL data: handle 7 flags 0x02 dlen 8
L2CAP(d): cid 0x0040 len 4 [psm 3]
RFCOMM(s): DM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x73
< ACL data: handle 7 flags 0x02 dlen 8
L2CAP(d): cid 0x007d len 4 [psm 3]
RFCOMM(s): DISC: cr 1 dlci 0 pf 1 ilen 0 fcs 0xfd
< ACL data: handle 7 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x007d scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 7
> ACL data: handle 7 flags 0x02 dlen 8
L2CAP(d): cid 0x0040 len 4 [psm 3]
RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> ACL data: handle 7 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x007d scid 0x0040
< HCI Command: Disconnect (0x01|0x0006) plen 3
handle 7 reason 0x13
Reason: Remote User Terminated Connection
> HCI Event: Command Status (0x0f) plen 4
Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
status 0x00 handle 7 reason 0x16
Reason: Connection Terminated by Local Host

>># hcitool cc 00:0E:07:A7:7E:D2
>># hcitool auth 00:0E:07:A7:7E:D2
>># hcitool dc 00:0E:07:A7:7E:D2
>
>
> Who cares about this commands? These are for testing and development
> only.

Well, I read several HOWTOs, it was mentioned in one.

Hope the log helps,
Greetings,
Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDDkZ0CseFG8xyfi4RAl4KAJ9xDOyxupDYlXLn+QAXTEV77+9ZuACfRSqY
IFWK98hEkYmbC1LhOSJEz6g=
=oYOd
-----END PGP SIGNATURE-----


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-08-25 19:09:19

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] rfcomm: Connection Refused

Hi Johannes,

> I'm having trouble with Bluez. I think I'm almost there, however. Here's
> the description:

run "hcidump -X -V" of your connection attempt.

> And I have paired my PC with my Sony Ericsson K700i Cellular Phone:
>
> # hcitool scan
> Scanning ...
> 00:0E:07:A7:7E:D2 K700i
> # hcitool cc 00:0E:07:A7:7E:D2
> # hcitool auth 00:0E:07:A7:7E:D2
> # hcitool dc 00:0E:07:A7:7E:D2

Who cares about this commands? These are for testing and development
only.

Regards

Marcel




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users