fsaris / EspHome-AwoX-BLE-mesh-hub

Custom component for ESPhome that can act as a AwoX BLE mesh hub (Telink mesh)
54 stars 16 forks source link

Can't connect to lights/connect them to home assistant #35

Closed ogitmb closed 11 months ago

ogitmb commented 12 months ago

Hi I am trying and trying but can't get it to work... No new devices are showing up in Home Assistant. Any clue on what i could try or check based on my log-files?

Any ideas welcome :-)

I should have two lights within range:

YAML yaml.txt

LOGFILE ESP32-Device logs_awox_logs (4).txt

I

NFO ESPHome 2023.10.6 INFO Reading configuration /config/esphome/awox.yaml... INFO Starting log output from awox-ble-mesh-hub/debug INFO Connected to MQTT broker!

[00:04:59][I][mqtt:274]: MQTT Connected! [00:04:59][I][app:062]: setup() finished successfully! [00:04:59][I][app:102]: ESPHome version 2023.10.6 compiled on Nov 10 2023, 23:26:03 [00:04:59][C][status_led:019]: Status LED: [00:04:59][C][status_led:020]: Pin: GPIO2

[00:04:59][C][wifi:382]: Local MAC: 08:D1:F9:CE:E6:98 [00:04:59][C][wifi:383]: SSID: 'New_Paradise'[redacted] [00:04:59][C][wifi:384]: IP Address: 192.168.178.170 [00:04:59][C][wifi:386]: BSSID: F0:B0:14:62:47:7F[redacted]

[00:04:59][C][wifi:389]: Signal strength: -64 dB ▂▄▆█ [00:04:59][C][wifi:393]: Channel: 6 [00:04:59][C][wifi:394]: Subnet: 255.255.255.0 [00:04:59][C][wifi:395]: Gateway: 192.168.178.1 [00:04:59][C][wifi:396]: DNS1: 192.168.178.1 [00:04:59][C][wifi:397]: DNS2: 0.0.0.0

[00:04:59][C][logger:417]: Level: DEBUG [00:04:59][C][logger:418]: Log Baud Rate: 115200 [00:04:59][C][logger:420]: Hardware UART: UART0 [00:04:59][C][esp32_ble:238]: ESP32 BLE: [00:04:59][C][esp32_ble:240]: MAC address: 08:D1:F9:CE:E6:9A [00:04:59][C][esp32_ble:241]: IO Capability: none [00:04:59][C][esp32_ble_tracker:617]: BLE Tracker: [00:04:59][C][esp32_ble_tracker:618]: Scan Duration: 300 s [00:04:59][C][esp32_ble_tracker:619]: Scan Interval: 320.0 ms [00:04:59][C][esp32_ble_tracker:620]: Scan Window: 30.0 ms [00:04:59][C][esp32_ble_tracker:621]: Scan Type: PASSIVE [00:04:59][C][esp32_ble_tracker:622]: Continuous Scanning: True

[00:05:00][C][mdns:116]: Hostname: awox-ble-mesh-hub [00:05:00][C][ota:097]: Over-The-Air Updates: [00:05:00][C][ota:098]: Address: awox-ble-mesh-hub.local:3232 [00:05:00][C][ota:101]: Using Password. [00:05:00][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 3 restarts

[00:05:00][C][mqtt:135]: Server Address: 192.168.178.171:1883 (192.168.178.171) [00:05:00][C][mqtt:136]: Username: 'mqttAwox'[redacted] [00:05:00][C][mqtt:137]: Client ID: 'awox-ble-mesh-hub-08d1f9cee698'[redacted] [00:05:00][C][mqtt:139]: Discovery prefix: 'homeassistant' [00:05:00][C][mqtt:140]: Discovery retain: YES [00:05:00][C][mqtt:142]: Topic Prefix: 'awox-ble-mesh-hub' [00:05:00][C][mqtt:144]: Log Topic: 'awox-ble-mesh-hub/debug'

[00:05:00][D][esp-idf:000]: W (28768) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x3e

[00:05:00][D][esp-idf:000]: W (28773) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:00][D][mesh_device:142]: [0] [A4:C1:38:79:28:63] ESP_GATTC_DISCONNECT_EVT, reason 62 [00:05:00][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:00][W][esp32_ble_client:134]: [0] [] Connection failed, status=133

[00:05:00][D][esp32_ble_tracker:246]: Starting scan... [00:05:00][D][AwoxMesh:042]: scan end [00:05:00][D][AwoxMesh:056]: Total devices: 2 [00:05:00][D][AwoxMesh:058]: Available device A4:C1:38:79:28:63 => rssi: -77 [00:05:00][D][AwoxMesh:058]: Available device A4:C1:38:A1:19:17 => rssi: -92 [00:05:00][I][AwoxMesh:062]: Try to connect A4:C1:38:79:28:63 => rssi: -77 [00:05:00][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:00][D][esp32_ble_client:048]: [0] [A4:C1:38:79:28:63] Found device

[00:05:00][D][esp32_ble_tracker:214]: Pausing scan to make connection...

[00:05:00][I][esp32_ble_client:064]: [0] [A4:C1:38:79:28:63] 0x00 Attempting BLE connection

[00:05:01][D][esp-idf:000]: W (29323) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:01][D][esp-idf:000]: W (29488) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:03][D][esp-idf:000]: W (31889) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:03][D][esp-idf:000]: W (32230) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x3e

[00:05:03][D][esp-idf:000]: W (32234) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:03][D][mesh_device:142]: [0] [A4:C1:38:79:28:63] ESP_GATTC_DISCONNECT_EVT, reason 62 [00:05:03][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:03][W][esp32_ble_client:134]: [0] [] Connection failed, status=133

[00:05:03][D][esp32_ble_tracker:246]: Starting scan... [00:05:03][D][AwoxMesh:042]: scan end [00:05:03][D][AwoxMesh:056]: Total devices: 2 [00:05:03][D][AwoxMesh:058]: Available device A4:C1:38:79:28:63 => rssi: -77 [00:05:03][D][AwoxMesh:058]: Available device A4:C1:38:A1:19:17 => rssi: -92 [00:05:03][I][AwoxMesh:062]: Try to connect A4:C1:38:79:28:63 => rssi: -77 [00:05:03][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:08][D][esp32_ble_client:048]: [0] [A4:C1:38:79:28:63] Found device

[00:05:08][D][esp32_ble_tracker:214]: Pausing scan to make connection...

[00:05:08][I][esp32_ble_client:064]: [0] [A4:C1:38:79:28:63] 0x00 Attempting BLE connection

[00:05:08][D][esp-idf:000]: W (32758) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:08][D][esp-idf:000]: W (33688) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:08][D][esp-idf:000]: W (35358) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:08][D][esp-idf:000]: W (35938) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x3e

[00:05:08][D][esp-idf:000]: W (35941) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:08][D][mesh_device:142]: [0] [A4:C1:38:79:28:63] ESP_GATTC_DISCONNECT_EVT, reason 62 [00:05:08][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:08][W][esp32_ble_client:134]: [0] [] Connection failed, status=133

[00:05:08][W][component:214]: Component esp32_ble took a long time for an operation (0.42 s). [00:05:08][W][component:215]: Components should block for at most 20-30ms. [00:05:08][D][esp32_ble_tracker:246]: Starting scan... [00:05:08][D][AwoxMesh:042]: scan end [00:05:08][D][AwoxMesh:056]: Total devices: 2 [00:05:08][D][AwoxMesh:058]: Available device A4:C1:38:79:28:63 => rssi: -77 [00:05:08][D][AwoxMesh:058]: Available device A4:C1:38:A1:19:17 => rssi: -92 [00:05:08][I][AwoxMesh:062]: Try to connect A4:C1:38:79:28:63 => rssi: -77 [00:05:08][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:08][D][esp32_ble_client:048]: [0] [A4:C1:38:79:28:63] Found device

[00:05:08][D][esp32_ble_tracker:214]: Pausing scan to make connection...

[00:05:08][I][esp32_ble_client:064]: [0] [A4:C1:38:79:28:63] 0x00 Attempting BLE connection

[00:05:08][D][esp-idf:000]: W (36853) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:09][D][esp-idf:000]: W (37393) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:09][D][esp-idf:000]: W (37738) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:10][D][esp-idf:000]: W (38623) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x3e

[00:05:10][D][esp-idf:000]: W (38633) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:10][D][mesh_device:142]: [0] [A4:C1:38:79:28:63] ESP_GATTC_DISCONNECT_EVT, reason 62 [00:05:10][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:10][W][esp32_ble_client:134]: [0] [] Connection failed, status=133

[00:05:10][D][esp32_ble_tracker:246]: Starting scan... [00:05:10][D][AwoxMesh:042]: scan end [00:05:10][D][AwoxMesh:056]: Total devices: 2 [00:05:10][D][AwoxMesh:058]: Available device A4:C1:38:79:28:63 => rssi: -77 [00:05:10][D][AwoxMesh:058]: Available device A4:C1:38:A1:19:17 => rssi: -92 [00:05:10][I][AwoxMesh:062]: Try to connect A4:C1:38:79:28:63 => rssi: -77 [00:05:10][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:10][D][esp32_ble_client:048]: [0] [A4:C1:38:79:28:63] Found device

[00:05:10][D][esp32_ble_tracker:214]: Pausing scan to make connection...

[00:05:10][I][esp32_ble_client:064]: [0] [A4:C1:38:79:28:63] 0x00 Attempting BLE connection

[00:05:10][D][esp-idf:000]: W (38969) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:12][D][esp-idf:000]: W (40978) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:32][I][mqtt:274]: MQTT Connected! [00:05:32][I][app:062]: setup() finished successfully! [00:05:32][I][app:102]: ESPHome version 2023.10.6 compiled on Nov 10 2023, 23:26:03 [00:05:32][C][status_led:019]: Status LED: [00:05:32][C][status_led:020]: Pin: GPIO2

[00:05:32][C][wifi:382]: Local MAC: 08:D1:F9:CE:E6:98 [00:05:32][C][wifi:383]: SSID: 'New_Paradise'[redacted] [00:05:32][C][wifi:384]: IP Address: 192.168.178.170 [00:05:32][C][wifi:386]: BSSID: F0:B0:14:62:47:7F[redacted]

[00:05:32][C][wifi:389]: Signal strength: -65 dB ▂▄▆█ [00:05:32][C][wifi:393]: Channel: 6 [00:05:32][C][wifi:394]: Subnet: 255.255.255.0 [00:05:33][C][wifi:395]: Gateway: 192.168.178.1 [00:05:33][C][wifi:396]: DNS1: 192.168.178.1 [00:05:33][C][wifi:397]: DNS2: 0.0.0.0

[00:05:33][C][logger:417]: Level: DEBUG [00:05:33][C][logger:418]: Log Baud Rate: 115200 [00:05:33][C][logger:420]: Hardware UART: UART0 [00:05:33][C][esp32_ble:238]: ESP32 BLE: [00:05:33][C][esp32_ble:240]: MAC address: 08:D1:F9:CE:E6:9A [00:05:33][C][esp32_ble:241]: IO Capability: none [00:05:33][C][esp32_ble_tracker:617]: BLE Tracker: [00:05:33][C][esp32_ble_tracker:618]: Scan Duration: 300 s [00:05:33][C][esp32_ble_tracker:619]: Scan Interval: 320.0 ms [00:05:33][C][esp32_ble_tracker:620]: Scan Window: 30.0 ms [00:05:33][C][esp32_ble_tracker:621]: Scan Type: PASSIVE [00:05:33][C][esp32_ble_tracker:622]: Continuous Scanning: True

[00:05:33][C][mdns:116]: Hostname: awox-ble-mesh-hub [00:05:33][C][ota:097]: Over-The-Air Updates: [00:05:33][C][ota:098]: Address: awox-ble-mesh-hub.local:3232 [00:05:33][C][ota:101]: Using Password. [00:05:33][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 2 restarts

[00:05:33][C][mqtt:135]: Server Address: 192.168.178.171:1883 (192.168.178.171) [00:05:33][C][mqtt:136]: Username: 'mqttAwox'[redacted] [00:05:33][C][mqtt:137]: Client ID: 'awox-ble-mesh-hub-08d1f9cee698'[redacted] [00:05:33][C][mqtt:139]: Discovery prefix: 'homeassistant' [00:05:33][C][mqtt:140]: Discovery retain: YES [00:05:33][C][mqtt:142]: Topic Prefix: 'awox-ble-mesh-hub' [00:05:33][C][mqtt:144]: Log Topic: 'awox-ble-mesh-hub/debug'

[00:05:44][D][AwoxMesh:056]: Total devices: 2 [00:05:55][D][AwoxMesh:058]: Available device A4:C1:38:79:28:63 => rssi: -77 [00:05:55][D][AwoxMesh:058]: Available device A4:C1:38:A1:19:17 => rssi: -93 [00:05:55][I][AwoxMesh:062]: Try to connect A4:C1:38:79:28:63 => rssi: -77 [00:05:55][I][mesh_device:478]: Publish connected to mesh device - offline

[00:05:55][D][esp32_ble_client:048]: [0] [A4:C1:38:79:28:63] Found device

[00:05:55][D][esp32_ble_tracker:214]: Pausing scan to make connection...

[00:05:55][I][esp32_ble_client:064]: [0] [A4:C1:38:79:28:63] 0x00 Attempting BLE connection

[00:05:55][D][esp-idf:000]: W (21608) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:55][D][esp-idf:000]: W (24581) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[00:05:55][D][esp-idf:000]: W (27308) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

fsaris commented 12 months ago

Do you have the correct board type configured for the device your using?

esp32:
  # Match this with the board your using
  board: nodemcu-32s

The devices are recognized, but connection fails

fsaris commented 11 months ago

Also try to enable verbose logging maybe it tells you more about why it fails to connect

ogitmb commented 11 months ago

thank you so much for taking the time to look over it - I am happy to have someone working on the awox integration

The board was actually one of the issues, after i changed it (and also created a new awox account, did a factory reset on the lights and added them to the new awox account) it did kind of work for a moment. It connected to one of the lights and I was able to see it in the mqtt integration and added it to home assistant and could turn on/off. After a few minutes the connection to that light was lost but in that moment the other one connected and i could add and control it as well.

Log: logs_awox_logs_2200_connected with One,then dropped it and connected to the other one.txt

But after that i had the lights turned off and also had the esp32 restarted (as i unplugged it from the pc to connect it directly to a power plug). i could not get it to connect again at all. I recompiled the yaml with very_verboose logging to see the details but i'm not really identifying the underlying issue :-/ It does always find both lights but the conenctions keeps failing logs_awox_logs_2328_verboosenotworkinganymore.txt

Any sugggestions?

fsaris commented 11 months ago

It looks to be out of range to make a connection. The esp sees the BLE devices (you gat a rssi value for each device) but it's not enough to connect. Most esphome antennes aren't that great 😬

Try moving it nearer to one of the devices