Skip to content

Trying to connect to Avi-On Bluetooth Plug #1

@ssimon2715

Description

@ssimon2715

I looked all over the internet for a way to control my smart/dumb Avi-On Bluetooth Plugs and I am very glad I found your work.
I was wondering if you could help me out, I can't seem to get connected when I run connect().
I get an error that says bluepy.btle.BTLEException: Failed to connect to peripheral 28:fd:80:82:06:11, addr type: public

Here is an hcidump of when I run the script, if that helps:

root@chip:~# hcidump -t
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
2016-12-28 23:38:26.557861 < 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
2016-12-28 23:38:26.807331 > HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 2
    status 0x00
2016-12-28 23:38:26.807425 < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x01 (scanning enabled)
    filter duplicates 0x01 (enabled)
2016-12-28 23:38:26.808756 > HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 2
    status 0x00
2016-12-28 23:38:28.460564 > HCI Event: LE Meta Event (0x3e) plen 38
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr 28:FD:80:82:06:11 (Public)
      Flags: 0x06
      Complete service classes: 0xfef1
      Unknown type 0x19 with 2 bytes data
      TX power level: 8
      Unknown type 0xff with 2 bytes data
      Complete local name: 'Avi-on'
      RSSI: -64
2016-12-28 23:38:28.460692 < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x00 (scanning disabled)
    filter duplicates 0x00 (disabled)
2016-12-28 23:38:28.462282 > HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 2
    status 0x00
2016-12-28 23:38:28.462368 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr 28:FD:80:82:06:11 type 0
    interval 96 window 48 initiator_filter 0
    own_bdaddr_type 0 min_interval 40 max_interval 56
    latency 0 supervision_to 42 min_ce 0 max_ce 0
2016-12-28 23:38:28.464127 > HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 2
2016-12-28 23:38:30.456228 < HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0
2016-12-28 23:38:30.457635 > HCI Event: Command Complete (0x0e) plen 4
    LE Create Connection Cancel (0x08|0x000e) ncmd 2
2016-12-28 23:38:30.457944 > HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x02 handle 0, role master
      bdaddr 28:FD:80:82:06:11 (Public)
2016-12-28 23:53:58.729733 < 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
2016-12-28 23:53:58.977332 > HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 2
    status 0x00
2016-12-28 23:53:58.977428 < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x01 (scanning enabled)
    filter duplicates 0x01 (enabled)
2016-12-28 23:53:58.978861 > HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 2
    status 0x00
2016-12-28 23:54:02.550276 > HCI Event: LE Meta Event (0x3e) plen 38
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr 28:FD:80:82:06:11 (Public)
      Flags: 0x06
      Complete service classes: 0xfef1
      Unknown type 0x19 with 2 bytes data
      TX power level: 8
      Unknown type 0xff with 2 bytes data
      Complete local name: 'Avi-on'
      RSSI: -64
2016-12-28 23:54:02.550402 < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x00 (scanning disabled)
    filter duplicates 0x00 (disabled)
2016-12-28 23:54:02.551991 > HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 2
    status 0x00
2016-12-28 23:54:02.552075 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr 28:FD:80:82:06:11 type 0
    interval 96 window 48 initiator_filter 0
    own_bdaddr_type 0 min_interval 40 max_interval 56
    latency 0 supervision_to 42 min_ce 0 max_ce 0
2016-12-28 23:54:02.553836 > HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 2
2016-12-28 23:54:04.546204 < HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0
2016-12-28 23:54:04.547625 > HCI Event: Command Complete (0x0e) plen 4
    LE Create Connection Cancel (0x08|0x000e) ncmd 2
2016-12-28 23:54:04.547925 > HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x02 handle 0, role master
      bdaddr 28:FD:80:82:06:11 (Public)

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions