├── README └── readM365.py /README: -------------------------------------------------------------------------------- 1 | Python script to read info from a Xiaomi M365 Scooter. 2 | 3 | Based on the protocol analysis by Camilo Ruiz https://github.com/CamiAlfa/M365-BLE-PROTOCOL -------------------------------------------------------------------------------- /readM365.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- mode: python; coding: utf-8 -*- 3 | # 4 | # Read data from Xiaomi M365 Scooter 5 | from gattlib import GATTRequester, GATTResponse 6 | from struct import * 7 | from time import sleep 8 | from binascii import hexlify 9 | 10 | MASTER_TO_M365 = 0x20 11 | M365_TO_MASTER = 0x23 12 | BATTERY_TO_MASTER = 0x25 13 | 14 | DISTANCE_INFO = 0x25 15 | TRIP_INFO = 0xb0 16 | BATTERY_INFO = 0x31 17 | 18 | 19 | class Requester(GATTRequester): 20 | def on_notification(self, handle, data): 21 | payload = data[3:] 22 | # print hexlify(payload) 23 | if len(payload) > 8: 24 | data_type, address = unpack('