Skip to contentSkip to conversation

bluepin bash script with immediate pin response

Bluez-users Burkhard Fischer 2 participants 4 messages Jan 20, 2004 – Jan 21, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello,

I am using BlueFRITZ! USB Bluetooth dongle, the BlueFRITZ AP-ISDN and ciptool for establishing a connection.

I want to replace the python script bluepin with a simple shell script to avoid interactive authentication. A simple echo should do this, however I found out that a connection is only established when the bluepin bash script doesn't answer immediately.

Here is the syslog:

Jan 20 16:59:02 magito hcid[544]: pin_code_request (sba=00:04:0E:82:F9:74, dba=00:04:0E:84:06:CA)
Jan 20 16:59:02 magito hcid[1088]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 16:59:02 magito hcid[544]: pin_code_request (sba=00:04:0E:82:F9:74, dba=00:04:0E:84:06:CA)
Jan 20 16:59:02 magito hcid[1091]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 16:59:34 magito kernel: hci_cmd_task: hci0 command tx timeout

and with "sleep 1" before echoing the pin everything goes well (besides the occasional tx timeout):

Jan 20 17:14:35 magito hcid[544]: pin_code_request (sba=00:04:0E:82:F9:74, dba=0
0:04:0E:84:06:CA)
Jan 20 17:14:36 magito hcid[1577]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 17:14:38 magito kernel: hci_cmd_task: hci0 command tx timeout
Jan 20 17:15:10 magito hcid[544]: pin_code_request (sba=00:04:0E:82:F9:74, dba=0
0:04:0E:84:06:CA)
Jan 20 17:15:11 magito hcid[1596]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 17:15:11 magito hcid[544]: pin_code_request (sba=00:04:0E:82:F9:74, dba=0
0:04:0E:84:06:CA)
Jan 20 17:15:12 magito kernel: hci_cmd_task: hci0 command tx timeout
Jan 20 17:15:12 magito hcid[1602]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 17:15:12 magito hcid[544]: link_key_notify (sba=00:04:0E:82:F9:74)
Jan 20 17:15:12 magito hcid[544]: Saving link key 00:04:0E:82:F9:74 00:04:0E:84:
06:CA
Jan 20 17:15:12 magito hcid[544]: link_key_notify (sba=00:04:0E:82:F9:74)
Jan 20 17:15:12 magito hcid[544]: Replacing link key 00:04:0E:82:F9:74 00:04:0E:
84:06:CA
Jan 20 17:15:12 magito kernel: Found 1 CAPI controller(s) on device 00:04:0E:84:
06:CA
Jan 20 17:15:12 magito kernel: kcapi: Controller 1: 00:04:0E:84:06:CA attached
Jan 20 17:15:12 magito kernel: kcapi: card 1 "00:04:0E:84:06:CA" ready.
Jan 20 17:15:12 magito kernel: kcapi: notify up contr 1
Jan 20 17:15:12 magito kernel: capi: controller 1 up

I am using 2.4.24 kernel with the mh1-Patch and the source bluez-libs-2.5.tar.gz bluez-utils-2.4.tar.gz
bluez-sdp-1.5.tar.gz

Is there a reason for this behavior

thanks
Burkhard

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#1 lore raw

Hi Burkhard,

Quoted 52 lines

I am using BlueFRITZ! USB Bluetooth dongle, the BlueFRITZ AP-ISDN and ciptool for establishing a connection.

I want to replace the python script bluepin with a simple shell script to avoid interactive authentication. A simple echo should do this, however I found out that a connection is only established when the bluepin bash script doesn't answer immediately.

Here is the syslog:

Jan 20 16:59:02 magito hcid[544]: pin_code_request 
(sba=00:04:0E:82:F9:74, dba=00:04:0E:84:06:CA)
Jan 20 16:59:02 magito hcid[1088]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 16:59:02 magito hcid[544]: pin_code_request 
(sba=00:04:0E:82:F9:74, dba=00:04:0E:84:06:CA)
Jan 20 16:59:02 magito hcid[1091]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 16:59:34 magito kernel: hci_cmd_task: hci0 command tx timeout

and with "sleep 1" before echoing the pin everything goes well (besides the occasional tx timeout):

Jan 20 17:14:35 magito hcid[544]: pin_code_request 
(sba=00:04:0E:82:F9:74, dba=0
0:04:0E:84:06:CA)
Jan 20 17:14:36 magito hcid[1577]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 17:14:38 magito kernel: hci_cmd_task: hci0 command tx timeout
Jan 20 17:15:10 magito hcid[544]: pin_code_request 
(sba=00:04:0E:82:F9:74, dba=0
0:04:0E:84:06:CA)
Jan 20 17:15:11 magito hcid[1596]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 17:15:11 magito hcid[544]: pin_code_request 
(sba=00:04:0E:82:F9:74, dba=0
0:04:0E:84:06:CA)
Jan 20 17:15:12 magito kernel: hci_cmd_task: hci0 command tx timeout
Jan 20 17:15:12 magito hcid[1602]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 20 17:15:12 magito hcid[544]: link_key_notify (sba=00:04:0E:82:F9:74)
Jan 20 17:15:12 magito hcid[544]: Saving link key 00:04:0E:82:F9:74 
00:04:0E:84:
06:CA
Jan 20 17:15:12 magito hcid[544]: link_key_notify (sba=00:04:0E:82:F9:74)
Jan 20 17:15:12 magito hcid[544]: Replacing link key 00:04:0E:82:F9:74 
00:04:0E:
84:06:CA
Jan 20 17:15:12 magito kernel: Found 1 CAPI controller(s) on device 
00:04:0E:84:
06:CA
Jan 20 17:15:12 magito kernel: kcapi: Controller 1: 00:04:0E:84:06:CA 
attached
Jan 20 17:15:12 magito kernel: kcapi: card 1 "00:04:0E:84:06:CA" ready.
Jan 20 17:15:12 magito kernel: kcapi: notify up contr 1
Jan 20 17:15:12 magito kernel: capi: controller 1 up
Quoted 6 lines

I am using 2.4.24 kernel with the mh1-Patch and the source bluez-libs-2.5.tar.gz
bluez-utils-2.4.tar.gz
bluez-sdp-1.5.tar.gz

Is there a reason for this behavior

show us the dump (hcidump -w <file>) for a connection setup.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#2 lore raw

Hi

here some more informations and the attached hci dump

/bin/bluepin:

#!/bin/bash
#sleep 1
echo "PIN:6bkgLuRqDpSIYZgP"

command:

magito:/etc/bluetooth# ciptool connect 00:04:0E:84:06:CA
Can't connect L2CAP socket: Connection refused

syslog:

Jan 21 12:01:30 magito hcid[4019]: HCI daemon ver 2.4 started
Jan 21 12:01:30 magito sdpd[4022]: sdpd v1.5 started
Jan 21 12:01:30 magito hcid[4019]: HCI dev 0 up
Jan 21 12:01:30 magito hcid[4019]: Starting security manager 0
Jan 21 12:01:42 magito hcid[4019]: pin_code_request (sba=00:04:0E:82:F9:74, dba=00:04:0E:84:06:CA)
Jan 21 12:01:42 magito hcid[4031]: hci_send_cmd 6bkgLuRqDpSIYZgP
Jan 21 12:01:42 magito hcid[4019]: pin_code_request (sba=00:04:0E:82:F9:74, dba=00:04:0E:84:06:CA)
Jan 21 12:01:42 magito hcid[4033]: hci_send_cmd 6bkgLuRqDpSIYZgP

best regards
Burkhard

Quoted 30 lines · Marcel Holtmann

Hi Burkhard,

Quoted 6 lines

I am using BlueFRITZ! USB Bluetooth dongle, the BlueFRITZ AP-ISDN and ciptool for establishing a connection.

I want to replace the python script bluepin with a simple shell script to avoid interactive authentication. A simple echo should do this, however I found out that a connection is only established when the bluepin bash script doesn't answer immediately.

Is there a reason for this behavior

show us the dump (hcidump -w <file>) for a connection setup.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#3 lore raw

Hi Burkhard,

Quoted 4 lines

here some more informations and the attached hci dump

/bin/bluepin:

Quoted 8 lines

#!/bin/bash
#sleep 1
echo "PIN:6bkgLuRqDpSIYZgP"

command:

magito:/etc/bluetooth# ciptool connect 00:04:0E:84:06:CA
Can't connect L2CAP socket: Connection refused
	> HCI Event: Link Key Request(0x17) plen 6
	  CA 06 84 0E 04 00 
	< HCI Command: Link Key Request Negative Reply(0x01|0x000c) plen 6
	  CA 06 84 0E 04 00 
	> HCI Event: PIN Code Request(0x16) plen 6
	  CA 06 84 0E 04 00 
	> ACL data: handle 0x0000 flags 0x02 dlen 16
	    L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0041 result 4 status 0
	< HCI Command: PIN Code Request Reply(0x01|0x000d) plen 23
	  CA 06 84 0E 04 00 10 36 62 6B 67 4C 75 52 71 44 70 53 49 59 
	  5A 67 50 
	> HCI Event: Disconn Complete(0x05) plen 4
	  00 00 00 13 

the problem seems to be the AP itself, because l2cap_conn_rsp with result code 4 means "Connection refused - no resources available". Try to update the firmware of your AP.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users