I have a problem with connecting to a specific bluetooth device (temperature sensor). The device is correctly detected:
Code: Select all
sudo hcitool lescan
LE Scan ...
AA:FD:1D:03:FF:15 (unknown)
AA:FD:1D:03:FF:15 Tr48
Code: Select all
gatttool -t random -b aa:fd:1d:03:ff:15 -I
[aa:fd:1d:03:ff:15][LE]> connect
Attempting to connect to aa:fd:1d:03:ff:15
Error: connect error: Transport endpoint is not connected (107)
Code: Select all
sudo hcidump -t
HCI sniffer - Bluetooth packet analyzer ver 5.43
device: hci0 snap_len: 1500 filter: 0xffffffff
2018-10-25 12:10:09.490484 < HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
type 0x00 (passive)
interval 60.000ms window 30.000ms
own address: 0x00 (Public) policy: white list only
2018-10-25 12:10:09.490862 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Parameters (0x08|0x000b) ncmd 1
status 0x00
2018-10-25 12:10:09.490916 < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
value 0x01 (scanning enabled)
filter duplicates 0x01 (enabled)
2018-10-25 12:10:09.491400 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x00
2018-10-25 12:10:09.534114 > HCI Event: LE Meta Event (0x3e) plen 43
LE Advertising Report
ADV_IND - Connectable undirected advertising (0)
bdaddr AA:FD:1D:03:FF:15 (Random)
Flags: 0x06
Unknown type 0xff with 26 bytes data
RSSI: -77
2018-10-25 12:10:09.534177 < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
value 0x00 (scanning disabled)
filter duplicates 0x00 (disabled)
2018-10-25 12:10:09.536343 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x00
2018-10-25 12:10:09.536394 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
bdaddr AA:FD:1D:03:FF:15 type 1
interval 96 window 96 initiator_filter 0
own_bdaddr_type 0 min_interval 24 max_interval 40
latency 0 supervision_to 42 min_ce 0 max_ce 0
2018-10-25 12:10:09.537080 > HCI Event: Command Status (0x0f) plen 4
LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
2018-10-25 12:10:11.596496 < HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0
2018-10-25 12:10:11.598396 > HCI Event: Command Complete (0x0e) plen 4
LE Create Connection Cancel (0x08|0x000e) ncmd 1
2018-10-25 12:10:11.598538 > HCI Event: LE Meta Event (0x3e) plen 19
LE Connection Complete
status 0x02 handle 64, role master
bdaddr AA:FD:1D:03:FF:15 (Random)
Code: Select all
from bluepy.btle import UUID, Peripheral
mac = "aa:fd:1d:03:ff:15"
p = Peripheral(mac,"random")
services=p.getServices()
for service in services:
print (service)Code: Select all
bluepy.btle.BTLEException: Failed to connect to peripheral AA:FD:1D:03:FF:15 addr type: random