XiaomiGateway3 icon indicating copy to clipboard operation
XiaomiGateway3 copied to clipboard

Strange behavior: different BLE md5

Open tam-wh opened this issue 3 years ago • 5 comments

I noticed my BLE devices does not work and I'm currently on 1.5.0_0102. I flashed to a custom firmware but still the same. Then i noticed that shell.py checks MD5 for silabs_ncp_bt. For some reason, I had a different one. Any reason for the checksum?

MD5_BT = {
    '1.4.6_0012': '367bf0045d00c28f6bff8d4132b883de',
    '1.4.6_0043': 'c4fa99797438f21d0ae4a6c855b720d2',
    '1.4.7_0115': 'be4724fbc5223fcde60aff7f58ffea28',
    '1.4.7_0160': '9290241cd9f1892d2ba84074f07391d4',
    '1.5.0_0026': '9290241cd9f1892d2ba84074f07391d4',
    '1.5.0_0102': '9290241cd9f1892d2ba84074f07391d4',
}
======================================================
FIRMWARE........: 1.5.0_0102 #20210816

# md5sum /data/silabs_ncp_bt
1ef5a18ead4475b96cbd773ca5a3d613  /data/silabs_ncp_bt

tam-wh avatar Oct 24 '21 14:10 tam-wh

Check debug logs. What gateway version you can see there? Check file content. Maybe it is some HTML file

AlexxIT avatar Oct 24 '21 16:10 AlexxIT

I'm using gateway ZNDMWG03LM and below is the debug log

2021-10-25 20:37:54  DEBUG    gateway3      192.168.X.XXX | Setup gateway device {'did': 'xxxxxxxxx', 'model': 'lumi.gateway.mgl03', 'mac': '0x0000000000000000', 'wlan_mac': 'xx:xx:xx:xx:xx:xx', 'type': 'gateway', 'fw_ver': '1.5.0_0102', 'online': True, 'init': {'firmware lock': False}}

I checked and i had different MD5 for busybox and socat as well

# md5sum /bin/busybox
f358f3e4a85330288a7c7a6c3a593db1  /bin/busybox
# md5sum /bin/socat
eaf52f5eec08f8e65197d4c891032f16  /bin/socat

From shell.py

MD5_BUSYBOX = '099137899ece96f311ac5ab554ea6fec'
MD5_SOCAT = '92b77e1a93c4f4377b4b751a5390d979'

tam-wh avatar Oct 25 '21 12:10 tam-wh

Check file content. You can enable FTP and download this files

AlexxIT avatar Oct 29 '21 10:10 AlexxIT

Here's the log.

2021-10-30 12:07:30  DEBUG    main          SysInfo: {'installation_type': 'Home Assistant Container', 'version': '2021.9.7', 'dev': False, 'hassio': False, 'virtualenv': False, 'python_version': '3.9.7', 'docker': True, 'user': 'root', 'arch': 'x86_64', 'timezone': '[Removed]', 'os_name': 'Linux', 'os_version': '4.19.0-17-amd64'}
2021-10-30 12:07:33  DEBUG    main          Loaded from MiCloud 69 devices
2021-10-30 12:07:33  DEBUG    gateway3      192.168.3.102 | Start main thread
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | lumi.158[removed]
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup gateway device {'did': '[removed]', 'model': 'lumi.gateway.mgl03', 'mac': '0x[removed]', 'wlan_mac': '[removed]', 'type': 'gateway', 'fw_ver': '1.5.0_0102', 'online': True, 'init': {'firmware lock': False}}
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup zigbee[removed]
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup ble device {'did': 'blt.3.[removed]', 'mac': '[removed]', 'model': 1161, 'type': 'ble', 'online': True, 'init': {}}
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup ble device {'did': 'blt.3.[removed]', 'mac': '[removed]', 'model': 417, 'type': 'ble', 'online': True, 'init': {}}
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup ble device {'did': 'blt.3.[removed]', 'mac': '[removed]', 'model': 426, 'type': 'ble', 'online': True, 'init': {}}
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup ble device {'did': 'blt.3.[removed]', 'mac': '[removed]', 'model': 131, 'type': 'ble', 'online': True, 'init': {}}
2021-10-30 12:07:44  DEBUG    gateway3      192.168.3.102 | Setup ble device {'did': '[removed]', 'mac': '[removed]', 'model': 571, 'type': 'ble', 'online': True, 'init': {}}
2021-10-30 12:07:46  DEBUG    gateway3      192.168.3.102 | Prepare Gateway
2021-10-30 12:07:47  DEBUG    mini_miio     192.168.3.102 | timeout 1
2021-10-30 12:07:48  DEBUG    gateway3      192.168.3.102 | Version: 1.5.0_0102
2021-10-30 12:07:48  DEBUG    gateway3      192.168.3.102 | Run public mosquitto
2021-10-30 12:07:49  DEBUG    mini_miio     192.168.3.102 | Send get_properties 128B, recv 144B in 1.4 sec and 2 try
2021-10-30 12:07:49  DEBUG    mini_miio     192.168.3.102 | Send get_properties 128B, recv 144B in 0.2 sec and 1 try
2021-10-30 12:08:10  DEBUG    gateway3      192.168.3.102 | Fixed BT don't supported
2021-10-30 12:08:10  DEBUG    gateway3      192.168.3.102 | Redirect miio to MQTT
2021-10-30 12:08:50  DEBUG    gateway3      192.168.3.102 | MQTT connected
2021-10-30 12:08:50  DEBUG    gateway3      192.168.3.102 | gateway <= True
2021-10-30 12:08:51  DEBUG    gateway3      192.168.3.102 | MQTT | gw/[removed]/heartbeat b'{"networkUp":true,"networkPanId":"0x8C43","radioTxPower":7,"radioChannel":20}'
2021-10-30 12:08:51  DEBUG    gateway3      192.168.3.102 | gateway <= {'networkUp': True, 'networkPanId': '0x8C43', 'radioTxPower': 7, 'radioChannel': 20}
2021-10-30 12:08:51  DEBUG    gateway3      192.168.3.102 | MQTT | zigbee/send b'{"cmd":"report","id":2000000014,"did":"lumi.0","time":1635566931089,"rssi":0,"zseq":0,"params":[{"res_name":"8.0.2024","value":20},{"res_name":"8.0.2157","value":35907}],"dev_src":"0"}'
2021-10-30 12:08:51  DEBUG    gateway3      192.168.3.102 | 408620349 lumi.gateway.mgl03 <= {'channel': 20, 'network_pan_id': 35907} [0.16]
2021-10-30 12:08:59  DEBUG    gateway3      192.168.3.102 | MQTT | broker/ping b'{"cmd":"ping","id":4,"did":"lumi.0","dev_src":"0","time":1635566939519}'

Nothing I can see. Anyway, I rebooted my gateway and now I have a different md5 hash for silabs_ncp_bt

# md5sum /data/silabs_ncp_bt
cc868581321c77efef890f388b7cfee1  /data/silabs_ncp_bt

Date of the file is the date i rebooted the gateway

-rw-r--r--    1 admin    0           804712 Oct 30 12:08 silabs_ncp_bt

tam-wh avatar Oct 31 '21 13:10 tam-wh

You have problems with Internet. I think your traffic is hijacked and modified.

AlexxIT avatar Nov 19 '21 18:11 AlexxIT

Please reopen the issue if it is still relevant

AlexxIT avatar Apr 09 '23 05:04 AlexxIT