Paul_PL
Posts: 9
Joined: Wed Mar 22, 2017 3:54 pm

Problem with pin code in SPP profile BT

Thu Apr 27, 2017 8:44 am

Hi all,
It is my first topic in formu, so i please a indulgence. :)

I have a problem with connection [Raspberry_PI_3] <=====> [GPS with BT adapter] in SPP profile in Bluetooth.

In Raspberry i use terminal command and external BT adapter.
I have a problem with write pin code to connection Bluetooth in SPP.

Code: Select all

[email protected]:/home/pi# hcitool dev
Devices:
	hci0	00:1A:7D:FF:00:01
[email protected]:/home/pi# 
[email protected]:/home/pi# hciconfig hci0 sspmode 1
[email protected]:/home/pi# 
[email protected]:/home/pi# 
[email protected]:/home/pi# rfcomm --raw connect 0 00:12:0E:8D:58:4B 1
Can't connect RFCOMM socket: Operation now in progress
[email protected]:/home/pi# 
[email protected]:/home/pi# 

Code: Select all

[email protected]:/home/pi# hcidump -h
Usage: hcidump [OPTION...] [filter]
  -i, --device=hci_dev       HCI device
  -l, --snap-len=len         Snap len (in bytes)
  -p, --psm=psm              Default PSM
  -m, --manufacturer=compid  Default manufacturer
  -w, --save-dump=file       Save dump to a file
  -r, --read-dump=file       Read dump from a file
  -t, --ts                   Display time stamps
  -a, --ascii                Dump data in ascii
  -x, --hex                  Dump data in hex
  -X, --ext                  Dump data in hex and ascii
  -R, --raw                  Dump raw data
  -C, --cmtp=psm             PSM for CMTP
  -H, --hcrp=psm             PSM for HCRP
  -O, --obex=port            Channel/PSM for OBEX
  -P, --ppp=channel          Channel for PPP
  -S, --sap=channel          Channel for SAP
  -D, --pppdump=file         Extract PPP traffic
  -A, --audio=file           Extract SCO audio data
  -Y, --novendor             No vendor commands or events
  -h, --help                 Give this help list
  -v, --version              Give version information
      --usage                Give a short usage message
[email protected]:/home/pi# hcidump --device=hci0
HCI sniffer - Bluetooth packet analyzer ver 5.4
device: hci0 snap_len: 1500 filter: 0xffffffff
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6
    bdaddr 10:90:1D:0A:3D:56
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Random Address (0x08|0x0005) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
    type 0x01 (active)
    interval 22.500ms window 11.250ms
    own address: 0x01 (Random) policy: All
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x01 (scanning enabled)
    filter duplicates 0x01 (enabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
< HCI Command: Inquiry (0x01|0x0001) plen 5
    lap 0x9e8b33 len 8 num 0
> HCI Event: Command Status (0x0f) plen 4
    Inquiry (0x01|0x0001) status 0x00 ncmd 1
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -86
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -58
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca7 class 0x120104 rssi -57
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -90
> HCI Event: LE Meta Event (0x3e) plen 15
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr A0:E6:F8:57:63:5D (Public)
      Flags: 0x06
      RSSI: -87
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -71
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147d class 0x120104 rssi -79
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -90
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:D9:86:18 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -91
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -74
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -65
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:D9:86:18 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -91
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -87
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr C0:F8:DA:E7:B0:E3 mode 1 clkoffset 0x7cc3 class 0x3e010c rssi -88
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780a class 0x100104 rssi -59
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147e class 0x120104 rssi -72
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -90
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:15:83:0C:BF:EB mode 1 clkoffset 0x0d35 class 0x020104 rssi -78
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -75
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -57
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -86
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -91
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -58
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -62
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca7 class 0x120104 rssi -56
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -74
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -80
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -83
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -63
> HCI Event: LE Meta Event (0x3e) plen 15
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr A0:E6:F8:57:63:5D (Public)
      Flags: 0x06
      RSSI: -88
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -58
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr C0:F8:DA:E7:B0:E3 mode 1 clkoffset 0x7cc3 class 0x3e010c rssi -84
    Complete local name: 'MIE-STACHURAM-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147e class 0x120104 rssi -79
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780a class 0x100104 rssi -58
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147e class 0x120104 rssi -77
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -74
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780a class 0x100104 rssi -54
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr A8:54:B2:B4:C4:5D mode 1 clkoffset 0x3609 class 0x340408 rssi -87
    Complete service classes: 0x112e 0x1105 0x1200 0x110b 0x111e 0x1203
    Unknown type 0x05 with 0 bytes data
    Unknown type 0x07 with 0 bytes data
    TX power level: 4
    Complete local name: 'Audi MMI 2125'
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -55
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:03:7A:F8:4C:60 mode 1 clkoffset 0x4ebb class 0x00010c rssi -85
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -74
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:D9:86:18 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -88
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -85
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -61
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780b class 0x100104 rssi -58
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -71
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -64
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:15:83:0C:BF:EB mode 1 clkoffset 0x0d35 class 0x020104 rssi -80
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -79
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e5 class 0x3e010c rssi -72
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -54
> HCI Event: LE Meta Event (0x3e) plen 15
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr A0:E6:F8:57:63:5D (Public)
      Flags: 0x06
      RSSI: -84
> HCI Event: LE Meta Event (0x3e) plen 21
    LE Advertising Report
      SCAN_RSP - Scan Response (4)
      bdaddr A0:E6:F8:57:63:5D (Public)
      Complete local name: 'BMW FM1'
      RSSI: -84
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -87
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780a class 0x100104 rssi -63
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -77
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -64
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca7 class 0x120104 rssi -55
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -63
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 5C:E8:EB:63:F8:62 mode 1 clkoffset 0x15e3 class 0x5a020c rssi -78
    Complete local name: '#! $;&^^#!!!*?;:"[email protected]#$/^&*()?,;:"'
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -64
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -57
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -94
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -56
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 5C:E8:EB:63:F8:62 mode 1 clkoffset 0x15e3 class 0x5a020c rssi -79
    Complete local name: '#! $;&^^#!!!*?;:"[email protected]#$/^&*()?,;:"'
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147e class 0x120104 rssi -78
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -57
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -63
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -75
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 5C:E8:EB:63:F8:62 mode 1 clkoffset 0x15e3 class 0x5a020c rssi -76
    Complete local name: '#! $;&^^#!!!*?;:"[email protected]#$/^&*()?,;:"'
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 68:A3:C4:48:16:4D mode 1 clkoffset 0x06f2 class 0x06010c rssi -88
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -59
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:16:73:1C:FD:06 mode 1 clkoffset 0x0167 class 0x760408 rssi -61
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780a class 0x100104 rssi -57
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -86
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -86
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780b class 0x100104 rssi -64
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -54
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -86
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -54
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147e class 0x120104 rssi -75
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -71
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780b class 0x100104 rssi -56
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -90
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca7 class 0x120104 rssi -58
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -92
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -55
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -58
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:0E:8D:58:4B mode 1 clkoffset 0x410a class 0x001f00 rssi -57
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca7 class 0x120104 rssi -52
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 5C:E8:EB:63:F8:62 mode 1 clkoffset 0x15e3 class 0x5a020c rssi -73
    Complete local name: '#! $;&^^#!!!*?;:"[email protected]#$/^&*()?,;:"'
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 5C:E8:EB:63:F8:62 mode 1 clkoffset 0x15e4 class 0x5a020c rssi -77
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A7:1C mode 1 clkoffset 0x2ca8 class 0x120104 rssi -58
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -82
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -65
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: LE Meta Event (0x3e) plen 15
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr A0:E6:F8:57:63:5D (Public)
      Flags: 0x06
      RSSI: -88
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:12:6F:00:05:C0 mode 1 clkoffset 0x147e class 0x120104 rssi -72
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:03:7A:F8:4C:60 mode 1 clkoffset 0x4ebb class 0x00010c rssi -85
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:D9:86:18 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -93
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr D0:DF:9A:B2:25:8B mode 1 clkoffset 0x22e6 class 0x3e010c rssi -71
    Complete local name: 'MIE-KEDZIORP-N'
    TX power level: 0
> HCI Event: LE Meta Event (0x3e) plen 40
    LE Advertising Report
      ADV_NONCONN_IND - Non connectable undirected advertising (3)
      bdaddr 78:BD:BC:C7:6F:62 (Public)
      Unknown type 0xff with 26 bytes data
      RSSI: -88
> HCI Event: Inquiry Result with RSSI (0x22) plen 15
    bdaddr 00:02:5B:00:A6:F4 mode 1 clkoffset 0x780b class 0x100104 rssi -56
< HCI Command: Inquiry Cancel (0x01|0x0002) plen 0
> HCI Event: Command Complete (0x0e) plen 4
    Inquiry Cancel (0x01|0x0002) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x00 (scanning disabled)
    filter duplicates 0x00 (disabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:12:0E:8D:58:4B ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    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 38 bdaddr 00:12:0E:8D:58:4B type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 38
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:12:0E:8D:58:4B mode 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 38 slots 5
> HCI Event: Command Status (0x0f) plen 4
    Unknown (0x00|0x0000) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 38
    Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 38 page 1
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 38 page 1 max 0
    Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:12:0E:8D:58:4B mode 2 clkoffset 0x0000
< ACL data: handle 38 flags 0x00 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 38 packets 1
> ACL data: handle 38 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
< ACL data: handle 38 flags 0x00 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0040
> ACL data: handle 38 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0043 scid 0x0040 result 1 status 2
      Connection pending - Authorization pending
> HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:12:0E:8D:58:4B name 'BT GPS V30'
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 38 packets 1
> HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:12:0E:8D:58:4B
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
    bdaddr 00:12:0E:8D:58:4B
> HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Negative Reply (0x01|0x000c) ncmd 1
    status 0x00 bdaddr 00:12:0E:8D:58:4B
> HCI Event: PIN Code Request (0x16) plen 6
    bdaddr 00:12:0E:8D:58:4B
> ACL data: handle 38 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0040 result 3 status 0
      Connection refused - security block
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 38 reason 0x13
    Reason: Remote User Terminated Connection

Code: Select all

[email protected]:/home/pi# bluetoothctl 
[NEW] Controller 00:1A:7D:FF:00:01 raspberrypi [default]
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:FF:00:01 Discovering: yes
[NEW] Device 00:12:0E:8D:58:4B BT GPS V30
[bluetooth]# scan off
Discovery stopped
[CHG] Controller 00:1A:7D:FF:00:01 Discovering: no
[CHG] Device 00:12:0E:8D:58:4B Connected: yes
[CHG] Device 00:12:0E:8D:58:4B Connected: no
[DEL] Device 00:12:0E:8D:58:4B BT GPS V30
[bluetooth]# 

Please help if you know answer :D :D

User avatar
Douglas6
Posts: 4812
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Problem with pin code in SPP profile BT

Thu Apr 27, 2017 1:48 pm

Have you added the Serial Port Profile to your Pi? See this post: viewtopic.php?p=947185#p947185. Instead of using the 'rfcomm watch' command, you'll want to connect to the GPS device with

Code: Select all

sudo rfcomm connect hci0 AA:BB:CC:DD:EE:FF

Paul_PL
Posts: 9
Joined: Wed Mar 22, 2017 3:54 pm

Re: Problem with pin code in SPP profile BT

Fri Apr 28, 2017 5:53 am

I know what add SPP profile in raspberry. In a first connection SPP i use two raspberry.
[Raspberry_PI_3] <=====> [Raspberry_PI_3]
[____HOST____] <=====> [___DEVICE___]

HOST Code

Code: Select all

- hcitool
- bluetoothctl
- discoverable on
- exit
- hciconfig hci0 sspmode 0
- sdptool add --channel=1 sp
- rfcomm --raw listen /dev/rfcomm0 1 &
DEVICE Code

Code: Select all

- hcitool dev
- hciconfig hci0 sspmode 0
- rfcomm --raw connect 0 00:01:02:03:04:05 1
This connection it is work perfectly but it without pin code.


In this time try to connect to GPS but GPS have a pin code. I don't now where i have write pin code in command line to connection.
[GPS with BT adapter] <=====> [Raspberry_PI_3]
[______HOST______] <=====> [___DEVICE___]

What I have add in device code to connection in pin code to GPS? Is it any special command to write pin code?

Please help :D

Paul_PL
Posts: 9
Joined: Wed Mar 22, 2017 3:54 pm

Re: Problem with pin code in SPP profile BT

Fri Apr 28, 2017 9:52 am

My problem has been resolved just that

Code: Select all

- bluetoothctl
- power on
- discoverable on
- agent on
- default-agent
- pair xx:xx:xx:xx:xx:xx
Device xx:xx:xx:xx:xx:xx Connected: yes
Request PIN code
[agent] Enter PIN code: 5679 ENTER
- exit
- rfcomm --raw connect 0 xx:xx:xx:xx:xx:xx 1

Thank's for all

Return to “Interfacing (DSI, CSI, I2C, etc.)”