『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: XCray

[修仙教程] 【ESPHome】ESP32 DIY通用蓝牙网关,接入米家系门锁等各种设备

  [复制链接]

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

 楼主| 发表于 2021-7-25 11:05:03 | 显示全部楼层
ghostist 发表于 2021-7-25 09:53
pdid我在TTL LOG里看到了 但不清楚是10进制还是16进制的,是794
eid之前mqttl方案里已经做过,也不是问题 ...

TTL Log里看到的794是十进制。

可以参考这个:
https://esphome.io/components/es ... vice-data-advertise

你的锁只需要关注service data advetise,内容就保存在那个 x 里,判断一下长度,然后把每一个元素打印出来即可
回复

使用道具 举报

40

主题

2176

帖子

8286

积分

元老级技术达人

积分
8286
金钱
6095
HASS币
110
发表于 2021-7-25 12:12:48 | 显示全部楼层
XCray 发表于 2021-7-25 11:05
TTL Log里看到的794是十进制。

可以参考这个:
Using 'COM7' as serial port.
Showing logs:
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 16.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 11.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 122.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 214.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 78.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 169.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 58.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 152.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 60.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 8.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 4.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 214.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 78.00000  with 1 decimals of accuracy
[12:10:43][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:10:44][D][wifi:395]: Found networks:
[12:10:44][I][wifi:441]: - 'Vaneber_2.4G' (76:7D:24:EB0:16) ▂▄▆█
[12:10:44][D][wifi:442]:     Channel: 8
[12:10:44][D][wifi:443]:     RSSI: -43 dB
[12:10:44][D][wifi:445]: - 'ChinaNet-jJtM' (D4:5F:25:24:74:44) ▂▄▆█
[12:10:44][D][wifi:445]: - 'iTV-jJtM' (D6:5F:25:34:74:44) ▂▄▆█
[12:10:44][D][wifi:445]: - 'mu3346' (8C:AB:8E:B2:0D8) ▂▄▆█
[12:10:44][D][wifi:445]: - 'ChinaNet-UTi5' (68:A6:82:40:C7:70) ▂▄▆█
[12:10:44][D][wifi:445]: - 'iTV-UTi5' (6A:A6:82:50:C7:70) ▂▄▆█
[12:10:44][D][wifi:445]: - '15-503' (F0:E4:A2:2F:70:AC) ▂▄▆█
[12:10:44][D][wifi:445]: - 'TP-mu3346' (08:57:00:42:FD:C6) ▂▄▆█
[12:10:44][D][wifi:445]: - 'TP-LINK_803' (F4:83:CD:66:F9:4B) ▂▄▆█
[12:10:44][D][wifi:445]: - 'ChinaNet-mu3346' (DC:9C:9F:5A:AC:17) ▂▄▆█
[12:10:44][D][wifi:445]: - 'iTV-9fJM' (DE:9C:9F:5A:AC:17) ▂▄▆█
[12:10:44][D][wifi:445]: - '慕容雪' (74:54:27:51:01:BA) ▂▄▆█
[12:10:44][D][wifi:445]: - 'TP-LINK_604' (30:FC:68:FB:19:BF) ▂▄▆█
[12:10:44][D][wifi:445]: - '' (88:10:8F:74:80:A1) ▂▄▆█
[12:10:44][D][wifi:445]: - 'CMCC-N57Q' (A0:8C:F8:E7:B5:C4) ▂▄▆█
[12:10:44][D][wifi:445]: - '' (88:10:8F:74:80:A5) ▂▄▆█
[12:10:44][D][wifi:445]: - '@PHICOMM_704' (2C:B2:1A:24:AA:2E) ▂▄▆█
[12:10:44][D][wifi:445]: - 'Xiaomi_605' (EC:41:18:446:22) ▂▄▆█
[12:10:44][D][wifi:445]: - '15-801' (2E:B2:1AE:4A:F5) ▂▄▆█
[12:10:44][D][wifi:445]: - 'CMCC-s9Ya' (34:78:39:C7:47:10) ▂▄▆█
[12:10:45][D][wifi:445]: - 'xiaomi-504' (18:13:2D:F1:15:AC) ▂▄▆█
[12:10:45][I][wifi:250]: WiFi Connecting to 'Vaneber_2.4G'...
[12:10:45][I][wifi:513]: WiFi Connected!
[12:10:45][C][wifi:359]:   SSID: 'Vaneber_2.4G'
[12:10:45][C][wifi:360]:   IP Address: 192.168.50.38
[12:10:45][C][wifi:362]:   BSSID: 76:7D:24:EB0:16
[12:10:45][C][wifi:363]:   Hostname: 'test'
[12:10:45][C][wifi:367]:   Signal strength: -39 dB ▂▄▆█
[12:10:45][C][wifi:371]:   Channel: 8
[12:10:45][C][wifi:372]:   Subnet: 255.255.255.0
[12:10:45][C][wifi:373]:   Gateway: 192.168.50.1
[12:10:45][C][wifi:374]:   DNS1: 114.114.114.114
[12:10:45][C][wifi:375]:   DNS2: 8.8.8.8
[12:10:45][D][wifi:522]: Disabling AP...
[12:10:45][C][ota:029]: Over-The-Air Updates:
[12:10:45][C][ota:030]:   Address: test.local:3232
[12:10:45][C][ota:032]:   Using Password.
[12:10:45][C][api:022]: Setting up Home Assistant API server...
[12:10:45][I][app:059]: setup() finished successfully!
[12:10:46][I][app:105]: ESPHome version 1.21.0-dev compiled on Jul 25 2021, 03:53:19
[12:10:46][C][wifi:499]: WiFi:
[12:10:46][C][wifi:359]:   SSID: 'Vaneber_2.4G'
[12:10:46][C][wifi:360]:   IP Address: 192.168.50.38
[12:10:46][C][wifi:362]:   BSSID: 76:7D:24:EB0:16
[12:10:46][C][wifi:363]:   Hostname: 'test'
[12:10:46][C][wifi:367]:   Signal strength: -39 dB ▂▄▆█
[12:10:46][C][wifi:371]:   Channel: 8
[12:10:46][C][wifi:372]:   Subnet: 255.255.255.0
[12:10:46][C][wifi:373]:   Gateway: 192.168.50.1
[12:10:46][C][wifi:374]:   DNS1: 114.114.114.114
[12:10:46][C][wifi:375]:   DNS2: 8.8.8.8
[12:10:46][C][template.sensor:021]: Template Sensor 'BLE Sensor'
[12:10:46][C][template.sensor:021]:   State Class: ''
[12:10:46][C][template.sensor:021]:   Unit of Measurement: ''
[12:10:46][C][template.sensor:021]:   Accuracy Decimals: 1
[12:10:46][C][template.sensor:022]:   Update Interval: 60.0s
[12:10:46][C][logger:189]: Logger:
[12:10:46][C][logger:190]:   Level: DEBUG
[12:10:46][C][logger:191]:   Log Baud Rate: 115200
[12:10:46][C][logger:192]:   Hardware UART: UART0
[12:10:46][C][esp32_ble_tracker:606]: BLE Tracker:
[12:10:46][C][esp32_ble_tracker:607]:   Scan Duration: 300 s
[12:10:46][C][esp32_ble_tracker:608]:   Scan Interval: 320.0 ms
[12:10:46][C][esp32_ble_tracker:609]:   Scan Window: 30.0 ms
[12:10:46][C][esp32_ble_tracker:610]:   Scan Type: ACTIVE
[12:10:46][C][captive_portal:148]: Captive Portal:
[12:10:46][C][ota:029]: Over-The-Air Updates:
[12:10:46][C][ota:030]:   Address: test.local:3232
[12:10:46][C][ota:032]:   Using Password.
[12:10:46][C][api:095]: API Server:
[12:10:46][C][api:096]:   Address: test.local:6053
[12:10:47][D][api.connection:670]: Client 'Home Assistant 2021.4.3 (192.168.50.221)' connected successfully!
[12:10:48][D][esp32_ble_tracker:620]: Found device 6DB:F5:F2:32:F8 RSSI=-94
[12:10:48][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[12:10:52][D][esp32_ble_tracker:620]: Found device 44:10:EB:22:B3:68 RSSI=-75
[12:10:52][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[12:10:52][D][esp32_ble_tracker:645]:   TX Power: 2
[12:10:57][D][esp32_ble_tracker:620]: Found device 5D:8DD:85:56:4C RSSI=-80
[12:10:57][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[12:10:57][D][esp32_ble_tracker:645]:   TX Power: 2
[12:10:57][D][esp32_ble_tracker:620]: Found device 78A:07:EA:E9:80 RSSI=-94
[12:10:57][D][esp32_ble_tracker:641]:   Address Type: PUBLIC
[12:10:58][D][esp32_ble_tracker:620]: Found device 51:C6:C86:2B:2D RSSI=-92
[12:10:58][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 72.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 14.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 121.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 150.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 80.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 41.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 12.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 24.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 18.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 149.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 48.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 48.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 196.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 94.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 92.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 168.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 65.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 245.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 156.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 247.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:05][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 72.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 14.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 121.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 150.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 80.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 41.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 12.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 24.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 18.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 149.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 48.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 48.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 196.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 94.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 92.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 168.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 65.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 245.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 156.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 247.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:06][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 72.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 15.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 169.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 10.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 140.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 197.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 175.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 162.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 23.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 125.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 211.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 38.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 224.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 155.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 223.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 146.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 155.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 180.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 140.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 58.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 255.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 152.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 72.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 15.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 169.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 10.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 140.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 197.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 175.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 162.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 23.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 125.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 211.00000  with 1 decimals of accuracy
[12:11:08][D][sensor:127]: 'BLE Sensor': Sending state 38.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 224.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 155.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 223.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 146.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 155.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 180.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 65.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 245.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 156.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 72.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 15.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 169.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 10.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 140.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 197.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 175.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 162.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 23.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 125.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 211.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 38.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 224.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 155.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 223.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 146.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 155.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 180.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 185.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 58.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 255.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:09][D][sensor:127]: 'BLE Sensor': Sending state 188.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 16.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 16.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 122.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 214.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 78.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 201.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 59.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 255.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 248.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 66.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 255.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 10.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:11][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 16.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 68.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 26.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 3.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 16.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 122.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 254.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 214.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 106.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 78.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 233.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 186.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 201.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 59.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 255.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 232.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 67.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 255.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 63.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 2.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 0.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 5.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 120.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 86.00000  with 1 decimals of accuracy
[12:11:21][D][sensor:127]: 'BLE Sensor': Sending state 173.00000  with 1 decimals of accuracy
[12:11:26][D][esp32_ble_tracker:620]: Found device 68:3E:34:CC:E0:88 RSSI=-92
[12:11:26][D][esp32_ble_tracker:641]:   Address Type: PUBLIC
[12:11:26][D][esp32_ble_tracker:643]:   Name: '魅族遥控器'


我打印了33个字节,不知道  然后开关了一下门  输出是有含义的吗?
和我想的有点不一样...
回复

使用道具 举报

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

 楼主| 发表于 2021-7-25 17:22:29 | 显示全部楼层
本帖最后由 XCray 于 2021-7-25 19:25 编辑
ghostist 发表于 2021-7-25 12:12
我打印了33个字节,不知道  然后开关了一下门  输出是有含义的吗?
和我想的有点不一样... ...

晕!!!
这日志看起来多费劲啊!你好歹把示例代码优化一下呀!
      then:
        - lambda: |-
            ESP_LOGD("ble_adv", "(length %i)%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",x.size(),x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]);
            if (x.size()==25) ESP_LOGD("ble_adv","(16-24)%02X%02X%02X%02X%02X%02X%02X%02X%02X",x[16],x[17],x[18],x[19],x[20],x[21],x[22],x[23],x[24]);


这只是个简单的思路,根据你的门锁消息长度修改一下,比如第一行输出前11个字节(因为有的消息只有11字节),第二行输出其后的9个字节(如果长度大于11),第三行输出最后的4个字节(如果长度是24)。

需要分辨出每条消息,以及十六进制打印(长度最好也打印出来),看起来也更方便。
另外,很奇怪的是:你之前发的日志里,消息长度只有11、20、24,这个33字节是怎么回事?根据小米文档,mibeacon最大长度是31!

回复

使用道具 举报

40

主题

2176

帖子

8286

积分

元老级技术达人

积分
8286
金钱
6095
HASS币
110
发表于 2021-7-25 20:15:38 | 显示全部楼层
XCray 发表于 2021-7-25 17:22
晕!!!
这日志看起来多费劲啊!你好歹把示例代码优化一下呀!

33是我强制打印了x[0]到x[32]
刚giyhub无法访问 修复了下 刚编译好,马上抓包
回复

使用道具 举报

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

 楼主| 发表于 2021-7-25 20:19:14 | 显示全部楼层
ghostist 发表于 2021-7-25 12:12
我打印了33个字节,不知道  然后开关了一下门  输出是有含义的吗?
和我想的有点不一样... ...

你这么弄出来的日志最大的问题是分不清楚每条消息的开始和结尾

我试着整理了一下,如图。总共有3条消息(会有重复现象)。
mible.png
第一条消息翻译如下:
48,二进制0100 1000,含义为已加密、含Object,不含mac、cap、mesh;
44,即01000100,未绑定、无操作、安全认证、版本4;
1A03,逆序,即031A,十进制794,是你的门锁的pid;
0E,序号
799650E9290C1812,加密后的object
953030,随机数
C45E5CA8,MIC
后面应该是你多余弄出来的无关数据!
object解密后为:0700050157e4fc60,含义如下:
eid:0700,逆序,即7,门事件
长度:05
数据:0157e4fc60,其中01含义为关门,后面为时间戳,转换后为2021-07-25 12:11:03

同样分析,第二条消息解密后的object为:
0b0009a1ffffffff58e4fc60,事件id 0b,锁事件,长度09,
操作码a1,含义为人工、上锁;
ffffffff为keyid,人工操作所以此值无意义;
后面为时间戳,比前一个时间戳多了1秒。

第三条消息:10441A03107AFED66A4EE9
10意为含mac,不含其他、未加密
7AFED66A4EE9为MAC地址

3条消息长度分别为20、24、11,和你之前发的日志是一致的。

回复

使用道具 举报

40

主题

2176

帖子

8286

积分

元老级技术达人

积分
8286
金钱
6095
HASS币
110
发表于 2021-7-25 20:34:42 | 显示全部楼层
XCray 发表于 2021-7-25 17:22
晕!!!
这日志看起来多费劲啊!你好歹把示例代码优化一下呀!
[20:31:12][D][ble_adv:037]: (length 11)
[20:31:12][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:31:20][D][esp32_ble_tracker:620]: Found device 73:FE:ED:6B:29:75 RSSI=-92
[20:31:20][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[20:31:25][D][ble_adv:037]: (length 11)
[20:31:25][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:31:32][D][ble_adv:037]: (length 11)
[20:31:32][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:31:45][D][ble_adv:037]: (length 11)
[20:31:45][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:31:55][D][ble_adv:037]: (length 11)
[20:31:55][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:32:20][D][ble_adv:037]: (length 11)
[20:32:20][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:32:23][D][esp32_ble_tracker:620]: Found device E9:79:5E2:A9:6A RSSI=-81
[20:32:23][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[20:32:23][D][esp32_ble_tracker:643]:   Name: 'Mi Band 3'
[20:32:26][D][esp32_ble_tracker:620]: Found device 74:1E:6C:6B:9C:29 RSSI=-69
[20:32:26][D][esp32_ble_tracker:641]:   Address Type: RANDOM
[20:32:26][D][esp32_ble_tracker:645]:   TX Power: 2
[20:32:26][D][ble_adv:037]: (length 11)
[20:32:26][D][ble_adv:038]: (length 11)10441A03547AFED66A4EE9
[20:32:29][D][ble_adv:037]: (length 24)
[20:32:29][D][ble_adv:040]: (length 24)48441A035522B8A1A5FA5F6AED2B25D252DD87D315B5F0D8
[20:32:29][D][ble_adv:037]: (length 24)
[20:32:29][D][ble_adv:040]: (length 24)48441A035522B8A1A5FA5F6AED2B25D252DD87D315B5F0D8
[20:32:31][D][ble_adv:037]: (length 20)
[20:32:31][D][ble_adv:039]: (length 20)48441A0356101206151C7BB27820E0380E2C1D74
[20:32:32][D][ble_adv:037]: (length 20)
[20:32:32][D][ble_adv:039]: (length 20)48441A0356101206151C7BB27820E0380E2C1D74
[20:32:36][D][ble_adv:037]: (length 20)
[20:32:36][D][ble_adv:039]: (length 20)48441A0358AEC8E2BD7B75AD6E14A591CD506631
[20:32:36][D][ble_adv:037]: (length 20)
[20:32:36][D][ble_adv:039]: (length 20)48441A0358AEC8E2BD7B75AD6E14A591CD506631
[20:32:47][D][ble_adv:037]: (length 11)
[20:32:47][D][ble_adv:038]: (length 11)10441A035A7AFED66A4EE9
[20:32:57][D][ble_adv:037]: (length 11)
[20:32:57][D][ble_adv:038]: (length 11)10441A035A7AFED66A4EE9
[20:32:59][D][esp32_ble_tracker:620]: Found device 78A:07:EA:E9:80 RSSI=-97
[20:32:59][D][esp32_ble_tracker:641]:   Address Type: PUBLIC
[20:33:00][D][ble_adv:037]: (length 11)
[20:33:00][D][ble_adv:038]: (length 11)10441A035A7AFED66A4EE9


打印格式参考你的,一行长度(不管接收到几个字节,1个也打印),一行内容(11,20,24三种)
进行一次室内开关门,目前收到log如上,一起看看
回复

使用道具 举报

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

 楼主| 发表于 2021-7-25 21:04:33 | 显示全部楼层
ghostist 发表于 2021-7-25 20:34
打印格式参考你的,一行长度(不管接收到几个字节,1个也打印),一行内容(11,20,24三种)
进行一次室 ...

和之前的分析一样,长度11的消息只有mac地址,不用处理;长度20的两条解密后分别为07000500dd59fd60和07000501e259fd60,分别代表开门和关门,时间戳差5秒;长度24的解密后为0b0009a4ffffffffdc59fd60,操作码a4,代表人工门内开锁。

接下来尽量收集更多不同类型的消息,用我之前发过的python测试代码解密,弄清楚门锁发出的object都有哪些类型,然后根据这些数据修改xiaomi_ble.cpp。

目前可以确定的是:
122行0x97和0x01分别改为0x1A和0x03,即你用的门锁pid;
17行,0x05 改为 0x0b、长度 10 改为 9;opmethod的下标改为0,keyid 和 opts 的下标也都减1;即17-20行改为:
  if ((value_type == 0x0b) && (value_length == 9)) {
    const int8_t opmethod = data[0];
    const int32_t keyid = encode_uint32(data[3], data[3], data[2], data[1]);
    const int32_t opts = encode_uint32(data[8], data[7], data[6], data[5]);

门事件37行不用改,两种锁在这一条上没区别。

其他消息等你收集到相应的消息再分析修改。
回复

使用道具 举报

40

主题

2176

帖子

8286

积分

元老级技术达人

积分
8286
金钱
6095
HASS币
110
发表于 2021-7-25 21:26:24 | 显示全部楼层
XCray 发表于 2021-7-25 21:04
和之前的分析一样,长度11的消息只有mac地址,不用处理;长度20的两条解密后分别为07000500dd59fd60和070 ...
门内上儿童锁
48441A0363CC4BEC1F2E519D4A4BE379CB12E63D5DF11D5C
门内解儿童锁
48441A0364FD3D40504B05F47F96F6895FF998E1297D6717

超时未关
48441A0369E7A270843DA17B3394FD24FCFB9A7C


-----------室内开锁-门外上锁-门外指纹开锁-门内上提把手锁门-----------------
门内开锁?
48441A036EA14010BFB45E6E7BE14758D8646AB91845023E
门外上锁?
48441A03712C659FD4D68406C33A4BA675F15C68F3C182D2
门开?
48441A037306A29E0BC73ED05978182D0D4BF37A
门关?
48441A037419EE006C2024D97A8C6665A7C3ACE7
室内上锁?
48441A03759A245C2F5E11251F113CF8E3356D5257194C58


我这电脑没有python环境....疫情居家隔离了  在家玩玩
https://bbs.hassbian.com/thread-8444-1-1.html这个帖子可否参考?mqttl项目我就是参考这个的...
回复

使用道具 举报

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

 楼主| 发表于 2021-7-25 21:35:46 | 显示全部楼层
ghostist 发表于 2021-7-25 21:26
我这电脑没有python环境....疫情居家隔离了  在家玩玩
https://bbs.hassbian.com/thread-8444-1-1.html ...

jstormx大神的那个帖子意在思路,要说参考的话,看官方文档更好!地址:https://iot.mi.com/new/doc/embed ... e/object-definition

这几条消息我帮你解密一下:
0b0009a2ffffffff5b63fd60
0b0009a3ffffffff5e63fd60
07000502c963fd60
0b0009a4fffffffff363fd60
0b0009a1fffffffff963fd60
07000500fd63fd60
070005010264fd60
0b0009a1ffffffff0364fd60
回复

使用道具 举报

40

主题

2176

帖子

8286

积分

元老级技术达人

积分
8286
金钱
6095
HASS币
110
发表于 2021-7-25 21:38:06 | 显示全部楼层
XCray 发表于 2021-7-25 21:35
jstormx大神的那个帖子意在思路,要说参考的话,看官方文档更好!地址:https://iot.mi.com/new/doc/embe ...

常用的应该就这些了,我解读看看  对照着改一下~
先谢谢啦  弄好了交作业~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 20:11 , Processed in 0.063490 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表