XiaomiGateway3 icon indicating copy to clipboard operation
XiaomiGateway3 copied to clipboard

After install Xiaomi Home Hub, some bluetooth devices no more avaiable ?

Open kingwap99 opened this issue 2 years ago • 14 comments

After install Xiaomi Home Hub, all the bluetooth sensors are not available. but the bluetooth mesh light/switch can still work> How can I do to solve this issue 螢幕擷取畫面 2022-06-26 102921

螢幕擷取畫面 2022-06-26 103137 螢幕擷取畫面 2022-06-26 103035 ?

kingwap99 avatar Jun 26 '22 02:06 kingwap99

me too

ycg31 avatar Jul 06 '22 06:07 ycg31

Home Assistant Core 2022.6.7 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.2 Xiaomi Gateway 3 v2.1.0

ycg31 avatar Jul 06 '22 06:07 ycg31

Check if silabs_ncp_bt is running without issues on the gateway. I've seen many cases where bt settings were corrupted resulting in this process dying and starting up every couple of seconds, effectively not listening to BLE broadcasts.

szymucha94 avatar Jul 14 '22 14:07 szymucha94

Do you use supported gateway firmware?

AlexxIT avatar Jul 14 '22 14:07 AlexxIT

Do you use supported gateway firmware?

I would like to descript more information for this issue I faced.

[6] mgl03_1.5.1_0032_mod20211108.zip works fine, but only 1.5.4 can co-work with Xiaomi home hub

after upgrade to [7] mgl03_1.5.4_0084_mod20220510.zip the Bluetooth mesh devices such as "mesh lemesh.light.wy0c07 by LeMesh" still work fine but all the Bluetooth sensor devices such as "ble MCCGQ02HL by Xiaomi" becomes unavailable.

under the construction of Xiaomi home hub, the original Bluetooth gateways were redefined as two type of sub-gateway (auxiliary gateway and independent gateway) and I found one thing. all the sensor type devices(viewable devices) can be checked under sub-gateway, but Bluetooth mesh devices(controlable devices) not Bluetooth mesh devices(controlable devices) seems handled by Xiaomi home hub directly.

螢幕擷取畫面 2022-07-15 001418 螢幕擷取畫面 2022-07-15 001537 螢幕擷取畫面 2022-07-15 001643

kingwap99 avatar Jul 14 '22 16:07 kingwap99

I was using firmware 1.5.4_0090 and I faced all sort of problems (all TH sensors unavailable, the state of switches not updated, etc) with all the Bluetooth and Mesh devices. Until I downgraded to firmware 1.5.0_0102, all Bluetooth and the Mesh devices worked like a charm.

I guess, the best solution for now for @kingwap99 is to downgrade your XiaomiGateway3 to firmware version 1.5.0_0102.

To downgrade the firmware, open a telnet session to the Xiaomi Gateway 3 :

First find out the ip address (xxx.xxx.xxx.xxx) of your Xiaomi Gateway 3

  telnet xxx.xxx.xxx.xxx

then you will see this:

Trying xxx.xxx.xxx.xxx... Connected to xxx.xxx.xxx.xxx. Escape character is '^]'.

rlxlinux login:

the login name is admin

 rlxlinux login:admin

then run the following 3 commands one after another:

 wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" && chmod +x /tmp/curl
 export PATH="$PATH:/tmp"
 curl -s -k -L -o /tmp/update.sh https://raw.githubusercontent.com/zvldz/mgl03_fw/main/firmware/mgl03_update.sh && sh /tmp/update.sh

Select firmware 1.5.0_0102

Hope this helps.

uswong avatar Jul 20 '22 05:07 uswong

@kingwap99 you can try this PR https://github.com/AlexxIT/XiaomiGateway3/pull/672.

mihsu81 avatar Jul 28 '22 12:07 mihsu81

@kingwap99 you can try this PR #672.

just updated for 1 hr they look quite well for now and will keep update to you, if any issue thanks a lot

kingwap99 avatar Jul 28 '22 18:07 kingwap99

Read readme and don't create issue about unsupported firmwares.

AlexxIT avatar Jul 29 '22 07:07 AlexxIT

Check if silabs_ncp_bt is running without issues on the gateway. I've seen many cases where bt settings were corrupted resulting in this process dying and starting up every couple of seconds, effectively not listening to BLE broadcasts.

Hello. This is probably my case. After some point, all BLE devices became unavailable. Firmware 1.5.0_0102. I tried stock and custom. After your post I checked this process (silabs_ncp_bt) and indeed, it restarts every few seconds. If I run it from the terminal, I get the following error: [I][mible_bond] mible_wifi_config_deinit 121: Wifi config deinit [D] : check wifi status 8 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info 5330: id = 336667036, js = {"method":"_sync.ble_mesh_ctl_info","params":{"life":10,"cm_version":"3.1.6_0002","cm_commit_id":"stable-3.1/V3.1.6-2-gff7735d/2021-01-20-12:07:07"}} [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5143: iv_index 00000000 [E][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5146: get iv_flags error [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5150: iv_flags: 0 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5196: unicast address: 0001 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5202: group address: feff [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5230: netkey_id: 00 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5249: appkey_id: 0000000000000000 [I][mesh_db] mible_mesh_mgmt_add_appkey 1301: index:0, key_id: 0000000000000000 [I][mesh_gateway] mible_mesh_key_mgmt_add_appkey 254: stack initilising, wait for mesh stack ready [I][mesh_gateway] mible_mesh_query_gateway_netkey 5443: id = 1748469038, js = {"method":"_sync.ble_mesh_ctl_netkey_get","params":{"offset":0,"limit":10}} [I][mesh_sql] mible_mesh_sql_provisioner_search 292: SELECT * FROM mesh_info_v3 [I][mesh_sql] mible_mesh_sql_provisioner_add 247: provisioner has existed [I][mesh_gateway] mible_mesh_gateway_main_thread 3777: mesh thread keep alive, state:1, ot_state:8 [D] : check wifi status 8 [I][mesh_gateway] mible_mesh_query_gateway_netkey_cb 5371: netkey_id: 00 [I][mesh_gateway] mible_mesh_query_gateway_appkey 5579: id = 562199039, js = {"method":"_sync.ble_mesh_ctl_appkey_get","params":{"offset":0,"limit":10}} [I][mesh_gateway] mible_mesh_query_gateway_appkey_cb 5497: appkey_id: 0000000000000000, 00 [I] : local param init success gateway init set sar config set segment delay [W] : [mible_mesh_gateway_init_stack] prov init gecko cmd mesh prov init failed. error: 0xe09

Do you know how to fix it? Reflashing does not help.

freeball155 avatar Aug 13 '22 08:08 freeball155

@freeball155 maybe you have some problems with BT chip firmware. Because it should be flashed with each gateway firmware update.

AlexxIT avatar Aug 13 '22 11:08 AlexxIT

@freeball155 maybe you have some problems with BT chip firmware. Because it should be flashed with each gateway firmware update.

Is it possible to fix or сразу в морг? :) Below the BLE flashing log:

  • Flashing BLE firmware uart-dfu /dev/ttyS1 /tmp/full_ble_1.5.4_0090.gbl 1 OTA_STATE:0 do app!! start update ble firmware!! killall: start_ot.sh: no process killed ota_state.txt is exist killall: ncp_daemon: no process killed sh: write error: Device or resource busy in bootloader Bytes to send:384312 Syncing..DFU OK Bootloader version: 17301508 (0x1080004) DFU packet size:384312 99% finish ncp target version:140 --200--->app ota_state:0 ----->ble app updated

Probably the "sh: write error: Device or resource busy" is bad sign.

freeball155 avatar Aug 15 '22 05:08 freeball155

@freeball155 maybe you have some problems with BT chip firmware. Because it should be flashed with each gateway firmware update.

Is it possible to fix or сразу в морг? :) Below the BLE flashing log:

* Flashing BLE firmware
  uart-dfu /dev/ttyS1 /tmp/full_ble_1.5.4_0090.gbl 1 OTA_STATE:0
  do app!!
  start update ble firmware!!
  killall: start_ot.sh: no process killed
  ota_state.txt is exist
  killall: ncp_daemon: no process killed
  **sh: write error: Device or resource busy**
  in bootloader
  Bytes to send:384312
  Syncing..DFU OK
  Bootloader version: 17301508 (0x1080004)
  DFU packet size:384312
  99%
  finish
  ncp target version:140
  --200--->app ota_state:0
  ----->ble app updated

Probably the "sh: write error: Device or resource busy" is bad sign.

This is normal and always shows up.

Check if silabs_ncp_bt is running without issues on the gateway. I've seen many cases where bt settings were corrupted resulting in this process dying and starting up every couple of seconds, effectively not listening to BLE broadcasts.

Hello. This is probably my case. After some point, all BLE devices became unavailable. Firmware 1.5.0_0102. I tried stock and custom. After your post I checked this process (silabs_ncp_bt) and indeed, it restarts every few seconds. If I run it from the terminal, I get the following error: [I][mible_bond] mible_wifi_config_deinit 121: Wifi config deinit [D] : check wifi status 8 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info 5330: id = 336667036, js = {"method":"_sync.ble_mesh_ctl_info","params":{"life":10,"cm_version":"3.1.6_0002","cm_commit_id":"stable-3.1/V3.1.6-2-gff7735d/2021-01-20-12:07:07"}} [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5143: iv_index 00000000 [E][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5146: get iv_flags error [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5150: iv_flags: 0 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5196: unicast address: 0001 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5202: group address: feff [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5230: netkey_id: 00 [I][mesh_gateway] mible_mesh_query_gateway_ctl_info_cb 5249: appkey_id: 0000000000000000 [I][mesh_db] mible_mesh_mgmt_add_appkey 1301: index:0, key_id: 0000000000000000 [I][mesh_gateway] mible_mesh_key_mgmt_add_appkey 254: stack initilising, wait for mesh stack ready [I][mesh_gateway] mible_mesh_query_gateway_netkey 5443: id = 1748469038, js = {"method":"_sync.ble_mesh_ctl_netkey_get","params":{"offset":0,"limit":10}} [I][mesh_sql] mible_mesh_sql_provisioner_search 292: SELECT * FROM mesh_info_v3 [I][mesh_sql] mible_mesh_sql_provisioner_add 247: provisioner has existed [I][mesh_gateway] mible_mesh_gateway_main_thread 3777: mesh thread keep alive, state:1, ot_state:8 [D] : check wifi status 8 [I][mesh_gateway] mible_mesh_query_gateway_netkey_cb 5371: netkey_id: 00 [I][mesh_gateway] mible_mesh_query_gateway_appkey 5579: id = 562199039, js = {"method":"_sync.ble_mesh_ctl_appkey_get","params":{"offset":0,"limit":10}} [I][mesh_gateway] mible_mesh_query_gateway_appkey_cb 5497: appkey_id: 0000000000000000, 00 [I] : local param init success gateway init set sar config set segment delay [W] : [mible_mesh_gateway_init_stack] prov init gecko cmd mesh prov init failed. error: 0xe09

Do you know how to fix it? Reflashing does not help.

The problem is that BLE device database got corrupted. This db is stored in /data which is unchanged when you flash device. What you need to do is reset the gateway by pressing the button 10 times.

szymucha94 avatar Aug 15 '22 09:08 szymucha94

Good day, I have the same issue - tried stock and custom 1.5.0_0102. Gateway is not see any ble devices. It was start from latest ofical firmware and I tried to install stock 1.5.0_0102. I also tried reset gateway. If I kill process silabs_ncp_bt and try to start it manually, I recive messages like below. Does it mean that ble module is dead?

[I] : mible rtl8197 gateway: 17:01:35, version:1.5.2 current sql version: 3.33.0 sqlite3_shutdown status = 0 Can now use sqlite on multiple threads, using the same connection pthread ret = 0 [I] : Init tests rpc [I][agent_client] client_connect 917: agent client connected. pthread ret = 0 [I] : cmd send interval is 00c8 [I] : Ble process thread create. get wifi mac:00 00 00 44 ef 54 [D] : send reset init the user test timer now [E] : version:4714508.4850740.2000702724 [D] : send reset [D] : check wifi status 0 [I][rpc_agent] ot_state_callback 244: ot connected. [D] : send reset [I][rpc_agent] mible_rpc_gateway_state_report 1464: id = 618549044, js = {"method":"props","params":{"ble_mesh_switch":"enable"}} [I][rpc_agent] mible_gateway_state_report_cb 1406: gateway switch state report success [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [D] : check wifi status 8 [D] : =====================mible_gateway_resume==================== [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [D] : check wifi status 8 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [D] : check wifi status 8 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [D] : check wifi status 8 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I][rpc_agent] mible_rpc_monitor_report 1771: id = 1950638047, js = {"method":"_async.stat","params":{"pdid":0,"btstat_system":{"seq_num":0,"bt_ver":"your miio_bt version","cm_ver":"3.1.5_0006","cm_feature":"BLE-CG-WC-MG-DB-GC","gateway_flag":1,"scan_threshold":0,"scan_type":0,"max_mesh_dev":0,"interval":1800,"elapsed":24,"ot_offline":0,"mesh_auth_dev":0,"mesh_unknown_dev":0,"mesh_denied_dev":0,"mesh_beacon_online":0,"mesh_online":0,"beacon_cnt":0,"mesh_cnt":0,"recovery_cnt":0,"mem_size":58400,"free_size":2976,"fd_size":14,"hwm_size":2448,"rss_size":2448,"pss_size":1836}}} [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now [D] : send reset reset the target by gpio31 [I] : reset target by gpio now

trvla avatar Sep 18 '22 08:09 trvla

@trvla have you solve problem?

macher91 avatar Oct 30 '22 18:10 macher91

In my case reset helped.

freeball155 avatar Oct 31 '22 06:10 freeball155

I am having the same issue, on fw 1.5.4-090 i no longer have the bt temperature sensors on home assistant despite having them on mi home, coincidence (or not) is that tjis started after changing the zigbee mode to zmqtt, my question is if i reseg the device will i need to start all over and reconfigure everything?

jmpaiva avatar Nov 06 '22 23:11 jmpaiva

@trvla have you solve problem?

No, I ordered new one

trvla avatar Nov 07 '22 16:11 trvla

I had the same issue as @trvla, tried many firmware and issue persist.

Jan 5 22:58:40 rlxlinux user.notice <BT>: ^[[0m[I] : Ble process thread create. Jan 5 22:58:40 rlxlinux user.notice <BT>: ^[[0m^[[0m[I] : cmd send interval is 00c8 Jan 5 22:58:40 rlxlinux user.notice <BT>: ^[[0mget wifi mac:00 00 00 44 ef 54 Jan 5 22:58:40 rlxlinux user.notice <BT>: ^[[1;32m[D] : send reset Jan 5 22:58:40 rlxlinux user.notice <BT>: ^[[0minit the user test timer now Jan 5 22:58:40 rlxlinux user.notice <BT>: [I][rpc_agent] ot_state_callback 244: ot connected. Jan 5 22:58:40 rlxlinux user.notice <HK>: ^[[0m^[[32m Info miio_agent_socket_callback: [31] {"id":25,"result":[],"_from":2} Jan 5 22:58:40 rlxlinux user.notice <HK>: ^[[0m^[[32m Info miio_agent_ot_tx: [52] {"method":"local.query_status","params":"","id":322} Jan 5 22:58:40 rlxlinux user.notice <HK>: ^[[0m^[[32m Info miio_agent_socket_callback: [61] {"method":"local.status","params":"cloud_connected","id":322} Jan 5 22:58:40 rlxlinux user.notice <HK>: ^[[0m^[[32m Info ParseJsonContent: Method: local.status Jan 5 22:58:41 rlxlinux user.notice <HK>: ^[[0m^[[35m Default [com.apple.mfi.HomeKit.Platform:KeyValueStore] HAPPlatformKeyValueStoreEnumerate domain A0 Jan 5 22:58:41 rlxlinux user.notice <HK>: ^[[0m^[[35m Default [com.apple.mfi.HomeKit.Platform:KeyValueStore] HAPPlatformKeyValueStoreEnumerate domain A0 Jan 5 22:58:41 rlxlinux user.notice <BT>: ^[[1;32m[D] : send reset Jan 5 22:58:41 rlxlinux user.notice <BT>: ^[[0m^[[1;32m[D] : check wifi status 8 Jan 5 22:58:41 rlxlinux user.notice <BT>: ^[[0m^[[1;32m[D] : =====================mible_gateway_resume==================== Jan 5 22:58:41 rlxlinux user.notice <BT>: ^[[0m [I][rpc_agent] mible_rpc_gateway_state_report 1464: id = 1800290035, js = {"method":"props","params":{"ble_mesh_switch":"enable"}} Jan 5 22:58:41 rlxlinux user.notice <BT>: [I][rpc_agent] mible_gateway_state_report_cb 1406: gateway switch state report success Jan 5 22:58:43 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:44 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:45 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:46 rlxlinux user.notice <HK>: ^[[0m^[[35m Default [com.apple.mfi.HomeKit.Platform:KeyValueStore] HAPPlatformKeyValueStoreEnumerate domain A0 Jan 5 22:58:46 rlxlinux user.notice <HK>: ^[[0m^[[35m Default [com.apple.mfi.HomeKit.Platform:KeyValueStore] HAPPlatformKeyValueStoreEnumerate domain A0 Jan 5 22:58:46 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:47 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:48 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:49 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:49 rlxlinux user.notice <AT>: 2023-01-05 22:58:49 debug Pool: 30s timer Jan 5 22:58:49 rlxlinux user.notice <AT>: 2023-01-05 22:58:49 debug miio::Agent: Sending {"id":7,"method":"local.query_status","params":null} Jan 5 22:58:49 rlxlinux user.notice <AT>: 2023-01-05 22:58:49 debug miio::Agent: Received {"id":7,"method":"local.status","params":"cloud_connected"} Jan 5 22:58:49 rlxlinux user.notice <AT>: 2023-01-05 22:58:49 debug Pool: client status: cloud_connected Jan 5 22:58:49 rlxlinux user.notice <AT>: 2023-01-05 22:58:49 debug Pool: cloud_connected Jan 5 22:58:50 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:51 rlxlinux user.notice <HK>: ^[[0m^[[35m Default [com.apple.mfi.HomeKit.Platform:KeyValueStore] HAPPlatformKeyValueStoreEnumerate domain A0 Jan 5 22:58:51 rlxlinux user.notice <HK>: ^[[0m^[[35m Default [com.apple.mfi.HomeKit.Platform:KeyValueStore] HAPPlatformKeyValueStoreEnumerate domain A0 Jan 5 22:58:51 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:52 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:53 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:54 rlxlinux user.notice <BT>: reset the target by gpio31 Jan 5 22:58:55 rlxlinux user.notice <BT>: reset the target by gpio31

wdlid avatar Jan 05 '23 15:01 wdlid

Please reopen the issue if it is still relevant

AlexxIT avatar Apr 09 '23 05:04 AlexxIT