shmuelzon / esp32-ble2mqtt

A BLE to MQTT bridge running on an ESP32
MIT License
682 stars 108 forks source link

Amazfit GTR isn't discovered #129

Open almirus opened 3 years ago

almirus commented 3 years ago

image image

2021-10-09 16:59:55.480608 (192.168.1.86): I (499052) BLE2MQTT: Discovered BLE device: c6:82:50:9f:66:36 (RSSI: -73), connecting 2021-10-09 17:00:00.428207 (192.168.1.86): W (503552) BT_GATT: gatt_rsp_timeout retry discovery primary service 2021-10-09 17:00:05.398220 (192.168.1.86): W (504542) BT_HCI: DiscCmpl evt: hdl=3, rsn=0x8 2021-10-09 17:00:10.347947 (192.168.1.86): W (504552) BT_APPL: gattc_conn_cb: if=1 st=0 id=769 rsn=0x8 2021-10-09 17:00:15.315009 (192.168.1.86): I (504552) BLE: Connection closed, reason = 0x8

shmuelzon commented 3 years ago

Hey, what exactly do you mean by "isn't discovered". It seems to be a broadcaster device, i.e. it broadcasts bits of information but isn't connectable, which would explain why we fail to connect to it. Perhaps I shouldn't even try to connect to these kind of devices. In any case, we do support some types of broadcasters but the Amazfit GTR isn't one of them. If you can tell me what the Ox570102FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02C682509F6636 and/or 0xE0FECF010000 mean, I can help with adding support for it.

almirus commented 3 years ago

@shmuelzon Is it possible to add dummy MQTT topics about the presence/absence of a gadget (maybe also signal strength) on his mac (even if there are no public services)?

shmuelzon commented 3 years ago

Technically, yes, and it was discussed here. I don't want to publish everything that's broadcasted as I believe it will be too much but, as a compromise, I suggested broadcasting the information of non-connectable devices, such as your Amazfit. While I do know now how to understand if a device is connectable or not, I've never gotten around to implementing it.

almirus commented 3 years ago

@shmuelzon It would be cool! make topic by default with: 1.name 2.signal level other are public services (to which we can to connect)